This repository has been archived by the owner on Feb 27, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
tox.ini
93 lines (84 loc) · 2.77 KB
/
tox.ini
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
[tox]
minversion = 3.25
envlist = py39, py310, py311
skipsdist = True
skip_missing_interpreters = True
[gh-actions]
python =
3.9: py39
3.10: py310
3.11: py311
[testenv]
usedevelop = True
isolated_build = True
setenv =
TOXINIDIR = {toxinidir}
VIRTUALENV_PIP = 22.2
[testenv:lockfiles]
description =
Create/update lock files for pinning dependencies.
deps =
pip-tools==6.11.0
skip_install = True
commands =
python -m piptools compile -q --no-emit-index-url --extra=test,docs --output-file=requirements/constraints.txt pyproject.toml {posargs}
python -m piptools compile -q --no-emit-index-url --output-file=requirements/base.txt requirements/constraints.txt pyproject.toml {posargs}
python -m piptools compile -q --no-emit-index-url --extra=test --output-file=requirements/test.txt requirements/constraints.txt pyproject.toml {posargs}
python -m piptools compile -q --no-emit-index-url --extra=docs --output-file=requirements/docs.txt requirements/constraints.txt pyproject.toml {posargs}
[testenv:py{39,310,311}]
description =
Run automated tests.
deps =
-r{toxinidir}/requirements/test.txt
commands =
python --version
python -m pip --version
python -m black src/ tests/ --check --diff --verbose
python -m isort src/ tests/ --check --diff --verbose
python -m mypy src/ tests/
python -m pylint src/ tests/ --verbose
python -m pytest --cov --cov-report=term-missing --cov-report=html --junitxml=test_report.xml tests/ --verbose
[testenv:docs]
description =
Invoke sphinx-multiversion to build the docs.
deps =
-r{toxinidir}/requirements/docs.txt
setenv =
DOCSDIR = {toxinidir}/docs
BUILDDIR = {toxinidir}/build/sphinx
BUILD = html
allowlist_externals =
sphinx-multiversion
commands =
sphinx-multiversion "{env:DOCSDIR}" "{env:BUILDDIR}/{env:BUILD}" -W --dev-name dev --skip-if-outputdir-exists
[testenv:format]
description =
Format the codebase.
skip_install = True
changedir = {toxinidir}
deps =
black ~= 22.12
isort ~= 5.12
commands =
python -m isort src/ tests/
python -m black src/ tests/
[testenv:clean]
description =
Delete all build artifacts.
skip_install = True
changedir = {toxinidir}
commands =
python -c 'from shutil import rmtree; rmtree("build", True); rmtree("dist", True); rmtree("docs/api", True)'
[testenv:build]
description =
Build the package in isolation according to instructions in:
https://setuptools.readthedocs.io/en/latest/build_meta.html#how-to-use-it
https://github.com/pypa/pep517/issues/91
https://github.com/pypa/build
# NOTE: build is still experimental, please refer to the links for updates/issues
skip_install = True
changedir = {toxinidir}
deps =
build[virtualenv] == 0.8.0
commands =
python -m build