-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtox.ini
40 lines (33 loc) · 1.25 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
[tox]
envlist = py{310,311,312}
# Use a virtual environment to build a source distribution from the source tree.
isolated_build = true
# Ignore errors related to absence of some python interpreters on the current machine.
skip_missing_interpreters = {env:TOX_SKIP_MISSING_INTERPRETERS:True}
[testenv]
description = "Execute the test driver using {basepython}."
allowlist_externals = poetry
commands_pre = poetry install --extras cpu --with tests
commands = poetry run pytest
skip_install = true
[testenv:docs]
description = "Build the documentation."
allowlist_externals = poetry
setenv = PYTHONHASHSEED=0
commands_pre = poetry install --no-root --with docs
commands =
-poetry run python -c '__import__("shutil").rmtree("docs/_build/html")' 2>/dev/null
# Generate the documentation and output it in html format.
poetry run sphinx-build -E -W --builder=html docs docs/_build/html
skip_install = true
[testenv:lint]
description = "Check the code style."
allowlist_externals =
git
poetry
commands_pre = poetry install --no-root --with dev
commands =
poetry run pre-commit run --all-files --show-diff-on-failure --config .githooks.yml
# The process will fail if files undergo modifications at the end.
git diff --exit-code
skip_install = true