Skip to content

Commit ebbe492

Browse files
committed
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 <module> def find_black_version_in_array(array: object) -> str | None: TypeError: unsupported operand type(s) for |: 'type' and 'NoneType' ```
1 parent e8bad29 commit ebbe492

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

.github/workflows/lint.yaml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,5 @@ jobs:
5656
run: tox -e lint_docstring_include_list
5757
- name: Run mypy checks
5858
run: tox -e mypy
59-
- uses: psf/black@stable
60-
with:
61-
version: ">=25.1.0"
62-
- uses: isort/isort-action@v1
59+
- name: Run format checks
60+
run: tox -e format

tox.ini

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# hyphens in an environment name are used to delimit factors
44
envlist =
55
first_startup
6+
format
67
lint
78
lint_docstring_include_list
89
mypy
@@ -16,6 +17,8 @@ skipsdist = True
1617
[testenv]
1718
commands =
1819
first_startup: bash .ci/first_startup.sh
20+
format: isort --check --diff .
21+
format: black --check --diff .
1922
lint: ruff check .
2023
# Once we are happy to replace flake8 with ruff, we can replace the next line with `black --check --diff`
2124
# (since ruff delegates to black for checking/fixing many rules).
@@ -31,6 +34,8 @@ commands =
3134
test_galaxy_packages_for_pulsar: bash packages/test.sh --for-pulsar
3235
allowlist_externals =
3336
bash
37+
black
38+
isort
3439
make
3540
passenv =
3641
CI
@@ -52,6 +57,7 @@ setenv =
5257
unit: marker=not external_dependency_management
5358
deps =
5459
coverage: coverage
60+
format: -rlib/galaxy/dependencies/dev-requirements.txt
5561
lint,lint_docstring,lint_docstring_include_list: -rlib/galaxy/dependencies/pinned-lint-requirements.txt
5662
mypy: -rlib/galaxy/dependencies/pinned-typecheck-requirements.txt
5763
mypy: -rlib/galaxy/dependencies/pinned-requirements.txt

0 commit comments

Comments
 (0)