-
Notifications
You must be signed in to change notification settings - Fork 7
/
tox.ini
124 lines (113 loc) · 3.1 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
120
121
122
123
124
[flake8]
# D104 Missing docstring in public package
# F401 ... imported but unused
per-file-ignores =
*/__init__.py: D104, F401,
tests/* : D101, D102, D103, D104
tests/conftest.py: D101, D102, D103, E402
# D100 Missing docstring in public module
# D107 Missing docstring in __init__
# W503 line break before binary operator
# D105 Missing docstring in magic method
# E203 whitespace before ':'
# D400 First line should end with a period
# false positive:
# B024 ... is an abstract base class, but it has no abstract methods
ignore = D100,D107,W503,D105,E203,D400,B024
exclude =
.git,
__pycache__,
docs/*
max_line_length = 120
filename = *.py
[gh-actions]
python =
3.8: py38
3.9: py39
3.10: py310
3.11: py311
[gh-actions:env]
PLATFORM =
ubuntu-latest: linux
macos-latest: macos
[pytest]
python_files = test_*.py
testpaths = tests/
xfail_strict = true
requests_mock_case_sensitive = true
[tox]
min_version=3.20.0
isolated_build = true
skip_missing_interpreters = true
envlist =
covclean
lint
py{38,39,310,311}-{linux,macos}
coverage
readme
docs
[testenv]
platform =
linux: linux
macos: (macos|osx|darwin)
deps =
pytest
pytest-mock
pytest-cov
pytest-socket
requests-mock>=1.9.2
numpy
networkx
{py310-linux}: rpy2<4
# log level ERROR because we print out info from fixture and -s also prints useless stuff from R
setenv =
OMNIPATH_AUTOLOAD = false
{py39-linux}: _PYTEST_TOX_POSARGS=--test-server --log-cli-level=ERROR
passenv = TOXENV,CI,CODECOV_*,GITHUB_ACTIONS
usedevelop = true
commands =
pytest --cov --cov-append --cov-config={toxinidir}/.coveragerc --ignore docs/ {posargs:-vv {env:_PYTEST_TOX_POSARGS:}}
[testenv:covclean]
description = Clean coverage files.
deps = coverage
skip_install = True
commands = coverage erase
[testenv:lint]
description = Perform linting.
deps = pre-commit>=2.7.1
skip_install = true
commands =
pre-commit run --all-files --show-diff-on-failure {posargs:}
[testenv:coverage]
description = Report the coverage difference.
deps =
coverage
diff_cover
skip_install = true
depends = py{37,38,39,310,311}-{linux,macos}
parallel_show_output = True
commands =
coverage report --omit="tox/*"
coverage xml --omit="tox/*" -o {toxinidir}/coverage.xml
diff-cover --compare-branch origin/master {toxinidir}/coverage.xml
[testenv:docs]
description = Build the documentation.
skip_install = true
deps = -r{toxinidir}/docs/requirements.txt
whitelist_externals = sphinx-build
commands =
sphinx-build --color -b html {toxinidir}/docs/source {toxinidir}/docs/build/html
python -c 'import pathlib; print(f"Documentation is available under:", pathlib.Path(f"{toxinidir}") / "docs" / "build" / "html" / "index.html")'
[testenv:clean-docs]
description = Clean the documentation artifacts.
deps =
skip_install = true
changedir = {toxinidir}/docs
whitelist_externals = make
commands = make clean
[testenv:readme]
description = Check if README renders on PyPI.
deps = twine >= 1.12.1
skip_install = true
commands = pip wheel -q -w {envtmpdir}/build --no-deps .
twine check {envtmpdir}/build/*