-
Notifications
You must be signed in to change notification settings - Fork 14
/
tox.ini
97 lines (86 loc) · 3.5 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
94
95
96
97
[tox]
envlist =
py37
py38
py39
py310
py311
py312
py313
pypy3.7
pypy3.10
check
minversion = 4.8.0
[testenv]
description = run the tests with pytest
deps = -r{toxinidir}/requirements/requirements-test.txt
commands =
; -W error: turn warnings into errors
{envpython} -m pytest -W error {tty:--color=yes} \
--cov-branch --cov {envsitepackagesdir}/wakepy --cov-fail-under=100 {posargs}
; The following makes the packaging use the external builder defined in
; [testenv:.pkg_external] instead of using tox to create sdist/wheel.
; https://tox.wiki/en/latest/config.html#external-package-builder
package = external
[testenv:show-uncovered-lines]
description = Show the uncovered lines in the test coverage report
deps = -r{toxinidir}/requirements/requirements-test.txt
skip_install = true
commands =
{envpython} -m coverage report --show-missing --skip-covered
[testenv:check]
description = Check the code
deps = -r{toxinidir}/requirements/requirements-check.txt
commands =
python -m isort . --check --diff
python -m black . --check
python -m ruff check --no-fix .
python -m mypy .
[testenv:mypy]
; This is a separate tox environment from the 'check' as this one
; is means to be ran solely in the CI pipelines and used to check the
; code with mypy using the oldest supported python version.
description = Run mypy for /src
deps = -r{toxinidir}/requirements/requirements-mypy.txt
commands =
python -m mypy src
[testenv:builddocs]
description = Build documentation
deps = -r{toxinidir}/requirements/requirements-docs.txt
commands =
; -E: Don’t use a saved environment (the structure caching all cross-references),
; but rebuild it completely.
; -W: Turn warnings into errors. This means that the build stops at the first
; warning and sphinx-build exits with exit status 1.
sphinx-build -EW docs{/}source{/} docs{/}build
[testenv:build]
; Builds the sdist (.tar.gz) and wheel (.whl) file.
description = Build distribution packages (sdist, wheel)
commands =
; The command below is no-op, but as it requires install (i.e. does not
; have skip_install=True), it will trigger the commands of .pkg_external.
python -c 'print("sdist and wheel are available in /dist ")'
[testenv:.pkg_external]
; This is a special environment which is used to build the sdist and wheel
; to the dist/ folder automatically *before* any other environments are ran.
; All of this require the "package = external" setting.
deps =
; The build package from PyPA. See: https://build.pypa.io/en/stable/
build==1.1.1
; The build backend required here as we build with --no-isolation flag
; (which is faster). This is already an isolated environment.
; Build tested working only on python 3.10. (and will not work on python
; 3.7)
setuptools==69.1.0; python_version>='3.10'
setuptools_scm==8.1.0; python_version>='3.10'
wheel==0.43.0; python_version>='3.10'
commands =
; See also the tox_on_install in toxfile.py which is guaranteed to be
; called before any invocations of this command.
; This is called once per each environment (if not skip_istall=True).
; We use the tox_on_install hook to create a dummy file /dist/.TOX-ASKS-REBUILD
; to communicate if a build should be really done or not.
python tests/tox_build_wakepy.py
; This determines which files tox may use to install wakepy in the test
; environments. The .whl is created with the tox_build_wakepy.py
package_glob = {toxinidir}{/}dist{/}wakepy-*-py3-none-any.whl