forked from SethMMorton/fastnumbers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtox.ini
103 lines (91 loc) · 2.5 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
# 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 = py36, py37, py38, py39, py310
# Other valid environments are:
# format
# format-check
# docs
# bump
# clean
# py{36,37,38}-nb (to update the Jupyter Notebooks}
# Don't error out if a user hasn't installed all python versions.
skip_missing_interpreters =
true
[testenv]
passenv = CC CFLAGS
deps =
pytest
pytest-faulthandler
hypothesis
typing_extensions
commands =
# All versions need to build and patch doctest for testing the fastnumbers module.
{envpython} dev/patch_doctest.py
# Install into this virtual environment.
# It was chosen to do this manually here instead of by implicitly as
# part of virtual environment setup so that compilation output is shown.
{envpython} setup.py install --force
# The tests.
{envpython} -m doctest fastnumbers
pytest --doctest-glob=README.rst
# Check that code is formatted
[testenv:format-check]
skip_install = true
deps = black
commands = {envpython} dev/check-formatting.py
# Format code
[testenv:format]
skip_install = true
deps = black
whitelist_externals = astyle
commands =
black .
astyle --recursive --options=dev/astyle.cfg --suffix=none src/*.c
astyle --recursive --options=dev/astyle.cfg --suffix=none --exclude=fn_bool.h --exclude=pstdint.h --exclude=docstrings.h include/fastnumbers/*.h
# Type checking
[testenv:mypy]
deps =
mypy
hypothesis
pytest
typing_extensions
commands =
mypy --strict tests
# Build documentation.
# sphinx and sphinx_rtd_theme not in docs/requirements.txt because they
# will already be installed on readthedocs.
[testenv:docs]
skip_install = false
deps =
sphinx
sphinx_rtd_theme
m2r2
commands =
{envpython} setup.py build_sphinx
# Bump version
[testenv:bump]
skip_install = true
passenv = HOME
deps = bump2version
commands = {envpython} dev/bump.py {posargs:}
# Clean up the working directory
[testenv:clean]
skip_install = true
deps =
commands = {envpython} dev/clean.py
# For running jupyter notebooks.
[testenv:py36-nb]
skip_install = false
deps = jupyter
commands = jupyter notebook TIMING_36.ipynb
[testenv:py37-nb]
skip_install = false
deps = jupyter
commands = jupyter notebook TIMING_37.ipynb
[testenv:py38-nb]
skip_install = false
deps = jupyter
commands = jupyter notebook TIMING_38.ipynb