-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtox.ini
58 lines (50 loc) · 1.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
# 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]
skipdist = True
skip_missing_interpreters = True
isolated_build = True
envlist = py{39,310,311,312}, docs, pre-commit
# Keep python version for docs in sync with docs testenv:docs and .readthedocs.yml
[gh-actions]
python =
3.9: py39, docs, pre-commit
3.10: py310
3.11: py311
3.12: py312
# Use tox defaults when creating the source distribution and installing the
# build system requirements (poetry-core).
[testenv:.package]
install_command =
[testenv]
description = run unit tests
skip_install = true
allowlist_externals = poetry
commands_pre = poetry install
commands =
poetry run pytest {posargs}
[testenv:docs]
# Keep basepython in sync with gh-actions and .readthedocs.yml.
description = invoke sphinx-build to build the HTML docs
basepython = python3.12
commands =
poetry run sphinx-build -d "{toxworkdir}/docs_doctree" docs "{toxworkdir}/docs_out" --color -W -bhtml {posargs}
python -c 'import pathlib; print("documentation available under file://\{0\}".format(pathlib.Path(r"{toxworkdir}") / "docs_out" / "index.html"))'
[testenv:serve-docs]
# Keep basepython in sync with gh-actions and .readthedocs.yml.
description = live-serve docs with sphinx-autobuild
basepython = python3.12
commands =
poetry run sphinx-autobuild --port=0 --open-browser docs docs/_build/html
[testenv:pre-commit]
description = run linters and formatters
basepython = python3.12
commands =
poetry run pre-commit run --all-files
[testenv:typing]
description = run type checks
basepython = python3.12
commands =
poetry run mypy ./src