forked from RDFLib/rdflib
-
Notifications
You must be signed in to change notification settings - Fork 1
/
tox.ini
89 lines (82 loc) · 2.95 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
# https://tox.wiki/en/latest/user_guide.html
# https://tox.wiki/en/latest/config.html
[tox]
envlist =
flake8,py3{7,8,9,10,11},covreport,docs,precommit
isolated_build = True
toxworkdir={env:TOX_WORK_DIR:{tox_root}/.tox}
[testenv]
passenv =
DBUS_SESSION_BUS_ADDRESS # This is needed for keyring acccess on Linux.
allowlist_externals = poetry
setenv =
extensive: BERKELEYDB_DIR = /usr
COVERAGE_FILE = {env:COVERAGE_FILE:{toxinidir}/.coverage.{envname}}
MYPY_CACHE_DIR = {envdir}/.mypy_cache
docs: POETRY_ARGS_docs = --only=docs
extensive: POETRY_ARGS_extensive = --extras=berkeleydb --extras=networkx
lxml: POETRY_ARGS_lxml = --extras=lxml
commands_pre =
py3{7,8,9,10,11}: python -c 'import os; print("\n".join(f"{key}={value}" for key, value in os.environ.items()))'
py3{7,8,9,10,11}: poetry lock --check
py3{7,8,9,10,11}: poetry install --no-root --only=main --only=dev --only=flake8 --only=tests --extras=html {env:POETRY_ARGS_docs:} {env:POETRY_ARGS_extensive:} {env:POETRY_ARGS_lxml:} {env:POETRY_ARGS:} --sync
commands =
{env:TOX_EXTRA_COMMAND:}
{env:TOX_MYPY_COMMAND:poetry run python -m mypy --show-error-context --show-error-codes --junit-xml=test_reports/{env:TOX_JUNIT_XML_PREFIX:}mypy-junit.xml}
{posargs:poetry run pytest -ra --tb=native {env:TOX_PYTEST_ARGS:--junit-xml=test_reports/{env:TOX_JUNIT_XML_PREFIX:}pytest-junit.xml --cov --cov-report=}}
docs: poetry run sphinx-build -T -W -b html -d {envdir}/doctree docs docs/_build/html
[testenv:covreport]
skip_install = true
parallel_show_output = true
depends = py3{7,8,9,10}{-extensive,}{-docs,}
setenv =
COVERAGE_FILE=
commands_pre =
poetry install --no-root --only=tests
commands =
poetry run python -m coverage combine
poetry run python -m coverage report
[testenv:flake8]
skip_install = true
commands_pre =
poetry install --no-root --only=flake8
commands =
poetry run python -m flakeheaven lint
[testenv:docs]
passenv =
TERM
DBUS_SESSION_BUS_ADDRESS
setenv =
PYTHONHASHSEED = 0
commands_pre =
poetry install --no-root --only=docs
commands =
poetry run sphinx-build -T -W -b html -d {envdir}/doctree docs docs/_build/html
[testenv:py37-extensive-min]
base = void
deps =
pytest==7.*
pytest-cov==4.*
setenv =
BERKELEYDB_DIR = /usr
COVERAGE_FILE = {env:COVERAGE_FILE:{toxinidir}/.coverage.{envname}}
PIP_CONSTRAINT = devtools/constraints.min
extras =
berkeleydb
networkx
lxml
html
commands =
{envpython} --version
pip freeze
{posargs:{envpython} -m pytest -ra --tb=native {env:TOX_PYTEST_ARGS:--junit-xml=test_reports/{env:TOX_JUNIT_XML_PREFIX:}pytest-junit.xml --cov --cov-report=}}
[testenv:precommit{,all}]
skip_install = true
deps = pre-commit
passenv =
HOMEPATH # needed on Windows
PRE_COMMIT_HOME # so that users can configure it
XDG_CACHE_HOME # so that pre-commit won't use the default
commands =
precommit: pre-commit run
precommitall: pre-commit run --all-files