From 1a473f897b55d08d324d9ba82aec154f281dfe19 Mon Sep 17 00:00:00 2001 From: Matthew Lee <4513875+mattdeform@users.noreply.github.com> Date: Mon, 10 Aug 2026 12:21:44 +1200 Subject: [PATCH 1/2] Test session scoping, env vars pushed into GITHUB_ENV, and formatting fail now fails SA. --- .github/workflows/reusable-maya-tests.yml | 4 ++-- .github/workflows/reusable-static-analysis.yml | 2 +- tests/maya/conftest.py | 4 +++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/reusable-maya-tests.yml b/.github/workflows/reusable-maya-tests.yml index 5fde593..fb6b703 100644 --- a/.github/workflows/reusable-maya-tests.yml +++ b/.github/workflows/reusable-maya-tests.yml @@ -78,8 +78,8 @@ jobs: - name: Set Maya environment variables run: | - export XDG_RUNTIME_DIR=/var/tmp/runtime-root - export MAYA_DISABLE_ADP=1 + echo "XDG_RUNTIME_DIR=/var/tmp/runtime-root" >> $GITHUB_ENV + echo "MAYA_DISABLE_ADP=1" >> $GITHUB_ENV - name: Run tests run: mayapy -m pytest tests diff --git a/.github/workflows/reusable-static-analysis.yml b/.github/workflows/reusable-static-analysis.yml index dd39c58..88c4e81 100644 --- a/.github/workflows/reusable-static-analysis.yml +++ b/.github/workflows/reusable-static-analysis.yml @@ -36,7 +36,7 @@ jobs: uses: psf/black@stable with: src: "src" - options: "--diff" + options: "--check --diff" - name: Analysing the code with mypy run: mypy src \ No newline at end of file diff --git a/tests/maya/conftest.py b/tests/maya/conftest.py index c1e8709..45786ff 100644 --- a/tests/maya/conftest.py +++ b/tests/maya/conftest.py @@ -1,6 +1,6 @@ import pytest -@pytest.fixture(autouse=True) +@pytest.fixture(scope="session", autouse=True) def run_in_maya(): from maya import ( standalone, @@ -8,3 +8,5 @@ def run_in_maya(): ) standalone.initialize() cmds.scriptEditorInfo(e=True, sw=True, se=True, si=True) + yield + standalone.uninitialize() \ No newline at end of file From 59b5b305d271aedb067d38943971705df9b95df5 Mon Sep 17 00:00:00 2001 From: Matthew Lee <4513875+mattdeform@users.noreply.github.com> Date: Mon, 10 Aug 2026 12:26:16 +1200 Subject: [PATCH 2/2] formatting --- src/mayapythonprojecttemplate/example.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mayapythonprojecttemplate/example.py b/src/mayapythonprojecttemplate/example.py index fc11e0c..5c64f92 100644 --- a/src/mayapythonprojecttemplate/example.py +++ b/src/mayapythonprojecttemplate/example.py @@ -1,4 +1,4 @@ -""" mayapythonprojecttemplate package. """ +"""mayapythonprojecttemplate package.""" from maya import cmds