-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathtox.ini
108 lines (94 loc) · 2.48 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
# Tox (http://tox.testrun.org/) 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]
envlist = lint, mypy, py38, py39, py310, py311, py312, py313
# Other valid environments are:
# format
# lint
# mypy
# docs
# bump
# clean
# py{38,39,310,311,312,313}-prof (to update the profiling data}
# Don't error out if a user hasn't installed all python versions.
skip_missing_interpreters =
true
[testenv]
passenv = CC, CFLAGS, FN_DEBUG, FN_COV
deps =
pytest
pytest-faulthandler
hypothesis
typing_extensions
numpy
build
commands =
# All versions need to build and patch doctest for testing the fastnumbers module.
{envpython} dev/patch-doctest.py
# Uncomment the below to see compilation output
# {envpython} -m build
# The tests.
{envpython} -m doctest fastnumbers
{envpython} dev/test-runner.py {envpython} {posargs}
# Format code
[testenv:format]
skip_install = true
deps =
ruff
clang-format
commands =
{envpython} dev/formatting.py
# Check code quality.
[testenv:lint]
setenv =
FN_WARNINGS_AS_ERRORS=1
deps =
ruff
clang-format
twine
build
commands =
{envpython} dev/formatting.py --check
ruff check
{envpython} -m build
twine check dist/*
skip_install = true
# Type checking
[testenv:mypy]
deps =
mypy
hypothesis
pytest
numpy
setuptools_scm
commands =
mypy --strict tests dev
# Build documentation.
# sphinx and sphinx_rtd_theme not in docs/requirements.txt because they
# will already be installed on readthedocs.
[testenv:docs]
deps =
-r docs/requirements.txt
commands =
sphinx-build docs/source build/sphinx/html
# Bump version
[testenv:bump]
skip_install = true
passenv = HOME
deps = setuptools_scm
commands = {envpython} dev/bump.py {posargs:}
# For running profiling.
[testenv:py38-prof]
commands = {envpython} profiling/profile.py profiling/results-3.8.md
[testenv:py39-prof]
commands = {envpython} profiling/profile.py profiling/results-3.9.md
[testenv:py310-prof]
commands = {envpython} profiling/profile.py profiling/results-3.10.md
[testenv:py311-prof]
commands = {envpython} profiling/profile.py profiling/results-3.11.md
[testenv:py312-prof]
commands = {envpython} profiling/profile.py profiling/results-3.12.md
[testenv:py313-prof]
commands = {envpython} profiling/profile.py profiling/results-3.13.md