From 58c7284244ff95287fb64075d368e9399038191a Mon Sep 17 00:00:00 2001 From: Chris Green Date: Mon, 16 Nov 2026 17:29:49 -0600 Subject: [PATCH 1/2] ci(python): align checks and normalize baseline formatting --- .github/workflows/python-check.yaml | 32 ++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/.github/workflows/python-check.yaml b/.github/workflows/python-check.yaml index 89bc24ceb..cf1fd0d29 100644 --- a/.github/workflows/python-check.yaml +++ b/.github/workflows/python-check.yaml @@ -143,9 +143,15 @@ jobs: ${{ steps.setup.outputs.pr_number || github.event.pull_request.number || github.event.issue.number }} with: script: | - const includesPath = path => [ - 'scripts/', 'ci/', '.devcontainer/', '.github/format-tools/' - ].some(prefix => path.startsWith(prefix)) || path === 'pyproject.toml'; + const pythonSourcePath = path => path.endsWith('.py') && [ + 'scripts/', 'ci/', '.devcontainer/', 'plugins/python/python/', 'test/python/' + ].some(prefix => path.startsWith(prefix)); + const includesPath = path => pythonSourcePath(path) || + path === 'docs/source/conf.py' || + path.startsWith('.github/format-tools/') || + path === 'pyproject.toml' || + path === '.pre-commit-config.yaml' || + /^\.github\/workflows\/.+\.ya?ml$/.test(path); let relevant = true; const changedPaths = []; if (context.eventName === 'pull_request' || context.eventName === 'issue_comment') { @@ -253,6 +259,15 @@ jobs: ruff check --config "$GITHUB_WORKSPACE/workflow-tools/pyproject.toml" . continue-on-error: true + - name: Run ruff format check + id: ruff_format + working-directory: ${{ needs.setup.outputs.checkout_path }} + env: + FORCE_COLOR: 1 + run: | + ruff format --config "$GITHUB_WORKSPACE/workflow-tools/pyproject.toml" --check . + continue-on-error: true + - name: Run MyPy check id: mypy working-directory: ${{ needs.setup.outputs.checkout_path }} @@ -262,13 +277,20 @@ jobs: continue-on-error: true - name: Evaluate Python checks result - if: always() && (steps.ruff.outcome != 'skipped' || steps.mypy.outcome != 'skipped') + if: > + always() && ( + steps.ruff.outcome != 'skipped' || + steps.ruff_format.outcome != 'skipped' || + steps.mypy.outcome != 'skipped' + ) env: REPO: ${{ needs.setup.outputs.repo }} # yamllint disable rule:line-length run: | REPO_NAME="${REPO##*/}" - if [ "${{ steps.ruff.outcome }}" = 'success' ] && [ "${{ steps.mypy.outcome }}" = 'success' ]; then + if [ "${{ steps.ruff.outcome }}" = 'success' ] && \ + [ "${{ steps.ruff_format.outcome }}" = 'success' ] && \ + [ "${{ steps.mypy.outcome }}" = 'success' ]; then echo "✅ Python checks passed." else echo "::error::Python checks failed. Comment '@${REPO_NAME}bot python-fix' on the PR to request a fix." From 2224e1ff8954d7d1ba5cc8ce0816f35a5db5749e Mon Sep 17 00:00:00 2001 From: Chris Green Date: Fri, 20 Nov 2026 18:47:33 -0600 Subject: [PATCH 2/2] ci: use relocated tooling config for ruff format --- .github/workflows/python-check.yaml | 2 +- scripts/test/test_workflow_tooling.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/python-check.yaml b/.github/workflows/python-check.yaml index 4f0f80f89..0924a37a5 100644 --- a/.github/workflows/python-check.yaml +++ b/.github/workflows/python-check.yaml @@ -279,7 +279,7 @@ jobs: env: FORCE_COLOR: 1 run: | - ruff format --config "$GITHUB_WORKSPACE/workflow-tools/pyproject.toml" --check . + ruff format --config "$RUNNER_TEMP/workflow-tools/pyproject.toml" --check . continue-on-error: true - name: Run MyPy check diff --git a/scripts/test/test_workflow_tooling.py b/scripts/test/test_workflow_tooling.py index 1be4dce7a..a35aade7f 100644 --- a/scripts/test/test_workflow_tooling.py +++ b/scripts/test/test_workflow_tooling.py @@ -240,6 +240,7 @@ def test_lint_configuration_is_from_workflow_snapshot(self): for name in ("python-check", "python-fix"): content = (ROOT / f".github/workflows/{name}.yaml").read_text() self.assertIn("$RUNNER_TEMP/workflow-tools/pyproject.toml", content) + self.assertNotIn("$GITHUB_WORKSPACE/workflow-tools/pyproject.toml", content) def test_untrusted_formatter_workflows_disable_uv_cache(self): """Prevent source-processing jobs from writing reusable uv caches."""