Skip to content

Commit

Permalink
Fix CI linting workflow (#308)
Browse files Browse the repository at this point in the history
* ci: No longer fail silently when the expected Python interpreter is missing.

 The tox "lint" target expects Python 3.10 to be installed, but CI only installs Python 3.9. skip_missing_interpreters caused the "lint" workflow in CI to exit successfully, even though no linting was performed.

Signed-off-by: Michael Seifert <m.seifert@digitalernachschub.de>

* ci: Install Python 3.10 for the "lint" workflow, as expected by the tox configuration.

Signed-off-by: Michael Seifert <m.seifert@digitalernachschub.de>

* ci: Do not inlcude tox's "lint" environment in the set of "3.9" environments of a GitHub actions run.

Linting is performed explicitly in a separate workflow and does not need to be run as part of the Python 3.9 tests. Additionally, linting currently expects Python 3.10 and will fail during the Python 3.9 test run.

Signed-off-by: Michael Seifert <m.seifert@digitalernachschub.de>

* build: Dependencies for tox's "lint" environent are installed correctly.

The lint environment requires mypy from the test dependencies to be installed. Although the environment defines `extras = testing`, it also specifies `skip_install = true`, which also skips installation of test dependencies.

This change removes skip_install = true, so that mypy is installed correctly.

Signed-off-by: Michael Seifert <m.seifert@digitalernachschub.de>

* build: Removed the explicit interpreter version dependency from tox's "version-info" environment.

Signed-off-by: Michael Seifert <m.seifert@digitalernachschub.de>
  • Loading branch information
seifertm committed Mar 11, 2022
1 parent 82d212b commit 133d8a8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Expand Up @@ -22,7 +22,7 @@ jobs:
fetch-depth: 0
- uses: actions/setup-python@v3
with:
python-version: '3.9'
python-version: '3.10'
- name: Install GitHub matcher for ActionLint checker
run: |
echo "::add-matcher::.github/actionlint-matcher.json"
Expand Down
5 changes: 1 addition & 4 deletions tox.ini
@@ -1,7 +1,6 @@
[tox]
minversion = 3.14.0
envlist = py37, py38, py39, py310, lint, version-info, pytest-min
skip_missing_interpreters = true
isolated_build = true
passenv =
CI
Expand All @@ -23,7 +22,6 @@ allowlist_externals =
make

[testenv:lint]
skip_install = true
basepython = python3.10
extras = testing
deps =
Expand All @@ -41,7 +39,6 @@ commands =
coverage report

[testenv:version-info]
basepython = python3.9
deps =
packaging == 21.3
commands =
Expand All @@ -51,6 +48,6 @@ commands =
python =
3.7: py37, pytest-min
3.8: py38
3.9: py39, lint
3.9: py39
3.10: py310
pypy3: pypy3

0 comments on commit 133d8a8

Please sign in to comment.