From ebbe4925502b610692ff21edb21611753284e758 Mon Sep 17 00:00:00 2001 From: Nicola Soranzo Date: Tue, 9 Dec 2025 12:25:30 +0000 Subject: [PATCH] Use a new `format` tox environment in lint GitHub action black 25.12.0 has dropped support for Python 3.9 and the psf/black@stable action fails with: ``` Traceback (most recent call last): File "/home/runner/work/_actions/psf/black/stable/action/main.py", line 98, in def find_black_version_in_array(array: object) -> str | None: TypeError: unsupported operand type(s) for |: 'type' and 'NoneType' ``` --- .github/workflows/lint.yaml | 6 ++---- tox.ini | 6 ++++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 8bde27db68e..5522e0ef051 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -56,7 +56,5 @@ jobs: run: tox -e lint_docstring_include_list - name: Run mypy checks run: tox -e mypy - - uses: psf/black@stable - with: - version: ">=25.1.0" - - uses: isort/isort-action@v1 + - name: Run format checks + run: tox -e format diff --git a/tox.ini b/tox.ini index ab1153917d2..65dcdce1c8d 100644 --- a/tox.ini +++ b/tox.ini @@ -3,6 +3,7 @@ # hyphens in an environment name are used to delimit factors envlist = first_startup + format lint lint_docstring_include_list mypy @@ -16,6 +17,8 @@ skipsdist = True [testenv] commands = first_startup: bash .ci/first_startup.sh + format: isort --check --diff . + format: black --check --diff . lint: ruff check . # Once we are happy to replace flake8 with ruff, we can replace the next line with `black --check --diff` # (since ruff delegates to black for checking/fixing many rules). @@ -31,6 +34,8 @@ commands = test_galaxy_packages_for_pulsar: bash packages/test.sh --for-pulsar allowlist_externals = bash + black + isort make passenv = CI @@ -52,6 +57,7 @@ setenv = unit: marker=not external_dependency_management deps = coverage: coverage + format: -rlib/galaxy/dependencies/dev-requirements.txt lint,lint_docstring,lint_docstring_include_list: -rlib/galaxy/dependencies/pinned-lint-requirements.txt mypy: -rlib/galaxy/dependencies/pinned-typecheck-requirements.txt mypy: -rlib/galaxy/dependencies/pinned-requirements.txt