-
Notifications
You must be signed in to change notification settings - Fork 1
/
tox.ini
86 lines (75 loc) · 2.68 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
# For examples of somewhat advanced tox usage, check out these two links:
# https://github.com/seanfisk/python-recipes/blob/master/tox.ini
# https://blog.ionelmc.ro/2015/04/14/tox-tricks-and-patterns/
# This link is for a tox.ini that is also the config file for pylint
# and coverage.py:
# https://gist.github.com/vporoshok/877c700fb1acf2909cf3
[tox]
mintoxversion = 4.0
# run "tox -l" (lowercase L) to list all environments.
# individual environments can be run with the "-e" flag:
# e.g.: tox -e py39-cov
# Note: the sphinx versions are spelled out so tox doesn't try to resolve them
# as python versions
envlist = py{39, 310, 311, 312, 313}{,-cov}, check-{pylint,pycodestyle,black,mypy}, docs, sphinx-{four},
[testenv]
runner = uv-venv-lock-runner
commands =
pylint: uv run pylint {toxinidir}/src/sphinx_c_autodoc -r n
pycodestyle: uv run pycodestyle {toxinidir}/src/sphinx_c_autodoc
flake8: uv run flake8 {toxinidir}/src/sphinx_c_autodoc
black: uv run black --check {toxinidir}/src/sphinx_c_autodoc {toxinidir}/tests {posargs}
mypy: uv run mypy {toxinidir}/src/sphinx_c_autodoc {posargs}
cov: uv run pytest --cov=sphinx_c_autodoc --cov-config={[coverage]file} --cov-report=xml {posargs}
docs: uv run sphinx-build {toxinidir}/docs {toxinidir}/docs/_build
[testenv:py{38, 39, 310, 311, 312, 313}]
commands =
uv run pytest {posargs}
[testenv:cov]
deps =
pytest-cov
[testenv:dev]
envdir = {toxworkdir}/dev
usedevelop = True
[sphinx]
deps =
pytest
clang==11.0
beautifulsoup4
sphinxcontrib-applehelp==1.0.4
sphinxcontrib-devhelp==1.0.2
sphinxcontrib-htmlhelp==2.0.1
sphinxcontrib-qthelp==1.0.3
sphinxcontrib-serializinghtml==1.1.5
alabaster==0.7.13
[testenv:sphinx-four]
runner = uv-venv-runner
# Not sure why, but the uv-venv-runner seems to use '.venv' instead of the
# envdir, so forcing it here
setenv =
UV_PROJECT_ENVIRONMENT = {env_dir}
deps = {[sphinx]deps}
sphinx>=4,<5
commands =
pytest {posargs}
[coverage]
file = {toxinidir}/tests/.coveragerc
[pycodestyle]
# E203 is handled by black (whitespace before ':')
# E402 is handled by pylint (wrong-import-position)
# E501 is handled py pylint (line-too-long)
# E128 is handled by pylint (bad-continuation)
# W292 is handled by pylint (missing-final-newline)
# W503 line break before binary operator, for whatever reason this and 504,
# line break after binary operator, are both enabled by default. These two
# can't happen at the same time so one has to die.
ignore=E402,E501,E128,W292,W503,E203
# No excludes, yet...
; exclude=clang,glob3,heapq3
[flake8]
count = True
show-source = True
statistics = True
max-complexity = 10
max-line-length = 127
ignore=E402,E501,E128,W292,W503,E203