-
Notifications
You must be signed in to change notification settings - Fork 2
/
tox.ini
89 lines (81 loc) · 2.12 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
# tox (https://tox.readthedocs.io/) is a tool for running tests
# in multiple virtualenvs. This configuration file will run the
# test suite on all supported python versions. To use it, "pip install tox"
# and then run "tox" from this directory.
[tox]
# we use any Python 3
envlist = py3,mypy,ruff_test
skip_missing_interpreters=true
[testenv]
deps =
-r{toxinidir}/test-requirements.txt
pytest==8.2.2
set_env =
PYTHONWARNDEFAULTENCODING=1
commands=
pytest
[testenv:mypy]
description =
Run type checks.
skip_install = True
deps =
-r{toxinidir}/test-requirements.txt
mypy==1.10.1
set_env =
; Mypy is issusing a lot of "EncodeWarning". Suppress it.
PYTHONWARNDEFAULTENCODING=
commands=
mypy sphinx_reredirects
[testenv:ruff_fix]
description = Lint and format the code (modify files).
skip_install = True
deps =
ruff
commands =
ruff check --fix
ruff format
[testenv:ruff_test]
description = Check linting and formatting rules (do NOT modify files)
skip_install = True
deps =
ruff
commands =
; Fail even if violations were fixed
ruff check --exit-non-zero-on-fix
; Fail if not properly formatted (don't modify files)
ruff format --check
[testenv:docs]
description = Build docs
skip_install = True
deps = -rdocs/requirements.txt
commands =
; -W turn warnings into errors
; -q be quiet
; _site is upload-pages-artifact default path
sphinx-build -W -b html docs _site
[testenv:build]
description = Package and release
isolated_build = True
skip_install = True
deps =
build==0.8.0
allowlist_externals =
rm
commands =
rm -rf dist
python -m build
[testenv:publish]
description =
Publish the package you have been developing to a package index server.
By default, it uses testpypi. If you really want to publish your package
to be publicly accessible in PyPI, use the `-- --repository pypi` option.
skip_install = True
changedir = {toxinidir}
passenv =
TWINE_USERNAME
TWINE_PASSWORD
TWINE_REPOSITORY
deps = twine
commands =
python -m twine check dist/*
python -m twine upload {posargs:--repository {env:TWINE_REPOSITORY:testpypi}} dist/*