-
Notifications
You must be signed in to change notification settings - Fork 2
/
tox.ini
97 lines (87 loc) · 2.22 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
# TOX configuration file. See (https://tox.readthedocs.io/)
#
# Setup:
# $ python3 -m venv venv
# $ source venv/bin/activate # (Windows: venv\Scripts\activate)
# (venv) $ pip install -U pip setuptools
# (venv) $ pip install -e .[dev]
#
# Run tests in ./tests/:
# (venv) $ tox
#
# Run tests with coverage in ./tests/:
# (venv) $ tox -ecov
#
# Check style (flake8) in ./src/ and ./tests/:
# (venv) $ tox -elint
#
# Generate documentation zip in ./dist/:
# (venv) $ tox -edocs
#
# Build source and binary distributables in ./dist/:
# (venv) $ tox -ebuild
#
[tox]
envlist = py3
[testenv]
deps =
pytest
commands =
pytest --basetemp="{envtmpdir}" {posargs}
[testenv:cov]
deps =
pytest
pytest-cov
commands =
pytest --basetemp="{envtmpdir}" --cov="{envsitepackagesdir}/qecsimext" {posargs}
[testenv:lint]
skip_install = true
deps =
flake8
flake8-bugbear
commands =
flake8 src tests
[testenv:docs]
deps =
sphinx
sphinx_rtd_theme
commands =
sphinx-build -W -bhtml -d"{envtmpdir}/doctrees" ./docs "{envtmpdir}/html/qecsimext"
python -c "import shutil; shutil.rmtree(r'{envtmpdir}/html/qecsimext/_static/fonts/', ignore_errors=True)"
python -c "import shutil, qecsimext; shutil.make_archive(f'dist/qecsimext-\{qecsimext.__version__\}-docs', 'zip', r'{envtmpdir}/html', 'qecsimext')"
[testenv:build]
skip_install = true
deps =
; check-manifest # commented to allow users to build without version control
docutils
wheel
commands =
; check-manifest # commented to allow users to build without version control
python setup.py check -mrs
python setup.py build --build-base="{envtmpdir}/build" sdist bdist_wheel
# tool configurations
[pytest]
testpaths = tests
addopts = --verbose
[flake8]
# E = pycodestyle errors: https://www.flake8rules.com/
# F = flake8 pyflakes
# W = pycodestyle warnings
# C = mccabe complexity
# B = bugbear warnings: https://pypi.org/project/flake8-bugbear/
# B9 = bugbear opinions
select = E, F, W, C, B, B9
ignore =
# line length, handled by pep8 E501
B950
# bare except, handled by bugbear B001
E722
# line break before binary operator, invalid
W503
# Enforced by E501
max-line-length = 120
[check-manifest]
ignore =
tox.ini
docs/**
tests/**