From 133d8a81ecb283821d63a622ee2ae24b946d062a Mon Sep 17 00:00:00 2001 From: Michael Seifert Date: Fri, 11 Mar 2022 12:53:49 +0100 Subject: [PATCH] Fix CI linting workflow (#308) * 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 * ci: Install Python 3.10 for the "lint" workflow, as expected by the tox configuration. Signed-off-by: Michael Seifert * 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 * 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 * build: Removed the explicit interpreter version dependency from tox's "version-info" environment. Signed-off-by: Michael Seifert --- .github/workflows/main.yml | 2 +- tox.ini | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a5ffe577..9036f312 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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" diff --git a/tox.ini b/tox.ini index 53aca291..00d45222 100644 --- a/tox.ini +++ b/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 @@ -23,7 +22,6 @@ allowlist_externals = make [testenv:lint] -skip_install = true basepython = python3.10 extras = testing deps = @@ -41,7 +39,6 @@ commands = coverage report [testenv:version-info] -basepython = python3.9 deps = packaging == 21.3 commands = @@ -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