ci: type-check API on all supported versions locally too (#152)

This commit is contained in:
Hynek Schlawack 2023-08-15 08:19:09 +02:00 committed by GitHub
parent 1d0b9de7e9
commit 811841d1b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 22 additions and 20 deletions

View File

@ -68,15 +68,18 @@ jobs:
V=py$(echo $V | tr -d .)
fi
echo TOX_PYTHON=$V >>$GITHUB_ENV
python -Im pip install tox
python -Im tox run \
--installpkg dist/*.whl \
-f $V
- run: |
python -Im tox run \
--installpkg dist/*.whl \
-e mypy-api
-f ${{ env.TOX_PYTHON }}-tests
- run: |
python -Im tox run \
--installpkg dist/*.whl \
-f ${{ env.TOX_PYTHON }}-mypy
if: ${{ !startsWith(matrix.python-version, 'pypy-') }}
- name: Upload coverage data

View File

@ -43,8 +43,9 @@ dependencies = [
[project.optional-dependencies]
tests = ["hypothesis", "pytest"]
typing = ["mypy"]
docs = ["sphinx", "sphinx-notfound-page", "furo", "myst-parser"]
dev = ["argon2-cffi[tests]", "mypy"]
dev = ["argon2-cffi[tests,typing]", "tox>4"]
[project.urls]
Documentation = "https://argon2-cffi.readthedocs.io/"

28
tox.ini
View File

@ -2,31 +2,35 @@
min_version = 4
env_list =
pre-commit,
mypy-{pkg,api},
py3{7,8,9,10,11,12}
mypy-pkg,
py3{7,8,9,10,11,12}-{tests,mypy}
py311-bindings-main,
pypy3,
pypy3-tests,
system-argon2,
docs,
coverage-report
[testenv]
description = Run tests and do NOT measure coverage.
description = Run tests and do NOT measure coverage / type-check.
package = wheel
wheel_build_env = .pkg
extras = tests
extras =
tests: tests
mypy: typing
pass_env =
FORCE_COLOR
NO_COLOR
commands =
pytest {posargs}
python -Im argon2 -n 1 -t 1 -m 8 -p 1
tests: pytest {posargs}
tests: python -Im argon2 -n 1 -t 1 -m 8 -p 1
mypy: mypy tests/typing
[testenv:py3{7,11}]
[testenv:py3{7,11}-tests]
description = Run tests and measure coverage.
deps = coverage[toml]
deps =
coverage[toml]
commands =
coverage run -m pytest {posargs}
coverage run -m argon2 -n 1 -t 1 -m 8 -p 1
@ -86,12 +90,6 @@ deps = mypy
commands = mypy src
[testenv:mypy-api]
description = Check only API types.
deps = mypy
commands = mypy tests/typing
[testenv:docs]
description = Build docs and run doctests.
# Keep base_python in-sync with .readthedocs.yaml and ci.yml/docs.