-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtox.ini
119 lines (101 loc) · 3.36 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
[tox]
# tox -q -e docs
isolated_build=True
env_list =
docs, lint, mypy, pre-commit
toxworkdir = {env:TOXWORKDIR:.tox}
[gh]
# `PYVERSIONS <https://pypi.org/project/tox-gh/>`_
# `Example with pypy3.10 <https://github.com/celery/kombu/blob/main/tox.ini>`_
python =
3.9: py39
3.10: py310
3.11: py311
3.12: py312
3.13: py313
pypy3: pypy3
[testenv]
usedevelop = False
download = True
extras =
toml
basepython =
docs: python3.10
lint, mypy, pre-commit, twine: python3.9
deps =
-r requirements/pip.lock
build
# Windows can't update the pip version with pip running, so use Python
# to install things.
install_command = python -m pip install -I {opts} {packages}
passenv = *
setenv =
#PYTHONWARNINGS=ignore:removed in Python 3.14; use ast.Constant:DeprecationWarning
# Disable CPython's color output
PYTHON_COLORS=0
TOXINIDIR = {toxinidir}
# migrate build --> cibuildwheel
# https://github.com/pypa/wheel/issues/573
commands =
python -c 'import build; print(build.__path__)'
python igor.py build_next "tag"
python -m pip install --disable-pip-version-check -q .
[testenv:docs]
description = sphinx docs
# One of the PYVERSIONS, that's currently supported by Sphinx. Make sure it
# matches the `python:version:` in the .readthedocs.yml file, and the
# python-version in the `doc` job in the .github/workflows/quality.yml workflow.
# Build the docs so we know if they are successful. We build twice: once with
# -q to get all warnings, and once with -QW to get a success/fail status
# return.
deps =
-r docs/requirements.lock
allowlist_externals =
make
commands =
sphinx-build -b html -aEnqW docs docs/_build/html
rst2html --strict README.rst docs/_build/trash.html
sphinx-build -b html -b linkcheck -aEnq docs docs/_build/html
sphinx-build -b html -b linkcheck -aEnQW docs docs/_build/html
- sphinx-build -b doctest docs docs/_build/html
[testenv:lint]
description = pre-commit and build
deps =
-r requirements/dev.lock
setenv =
{[testenv]setenv}
commands =
validate-pyproject pyproject.toml
python -m isort --profile="black" --multi-line=3 --force-grid-wrap=2 --use-parentheses --trailing-comma --ensure-newline-before-comments --line-length=88 --supported-extension="py,pyi" src/
python -m isort --profile="black" --multi-line=3 --force-grid-wrap=2 --use-parentheses --trailing-comma --ensure-newline-before-comments --line-length=88 --supported-extension="py,pyi" tests/
python -m flake8 --max-line-length=88 --extend-ignore="E203,W503,W605,W293,W291,E501" src/
python -m flake8 --max-line-length=88 --extend-ignore="E203,W503,W605,W293,W291,E501" tests/
python -m black --quiet --include='\.pyi?$' src/
python -m black --quiet --include='\.pyi?$' tests/
# Within a runner, have no access to dist/ folder nor contents. Skip, `twine check`
[testenv:mypy]
description = static type checking
deps =
-r requirements/mypy.lock
setenv =
{[testenv]setenv}
commands =
mypy --python-version=3.9 -p logging_strict
[testenv:pre-commit]
description = Run pre-commit
skip_install = True
deps =
-r requirements/manage.lock
setenv =
{[testenv]setenv}
commands =
pre-commit run --all-files --show-diff-on-failure
[testenv:twine]
description = Run twine readme check
skip_install = True
deps =
twine
setenv =
{[testenv]setenv}
commands =
python -m twine check dist/*