-
Notifications
You must be signed in to change notification settings - Fork 7
/
tox.ini
110 lines (102 loc) · 2.69 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
[tox]
minversion = 4.4.6
ignore_basepython_conflict = true
# these are the environments that will run when you
# execute `tox` in the command-line
# bellow you will find explanations for all environments
envlist =
test
build
docs
lint
# configures which environments run with each python version
[testenv]
basepython =
{test,build,docs,lint,radon,safety}: {env:TOXPYTHON:python3}
passenv = *
# configures the unittest environment for python 3.7
[testenv:test]
setenv =
PYTHONPATH={toxinidir}/tests
PYTHONUNBUFFERED=yes
usedevelop = false
# installs dependencies we need for testing
deps =
MDAnalysis>=2.1.0
MDAnalysisTests>=2.1.0
coverage[toml]
pytest
pytest-cov
hypothesis
# before running the tests erases any prerecord of coverage
commands_pre =
coverage erase
# execute pytest
commands =
pytest \
--cov \
--cov-report=term-missing \
--cov-append --cov-config=.coveragerc \
--hypothesis-show-statistics \
{posargs}
# after executing the pytest assembles the coverage reports
commands_post =
coverage report
coverage html
coverage xml
# separates lint from build env
[testenv:lint]
deps =
flake8>=4
flake8-docstrings
flake8-bugbear
pygments
isort
skip_install = true
commands =
flake8 {posargs:src/mdacli tests}
isort --check-only --diff src/mdacli tests
# asserts package build integrity
[testenv:build]
# setenv here integrates with commit message in .bumpversion.cfg
# we can tests bump2version with an actual commit
setenv =
COMMIT_MSG = Test commit message
deps =
build
bump2version
check-manifest
twine
skip_install = true
commands_pre = python {toxinidir}/devtools/clean_dist_check.py
commands =
python --version
python -m build
twine check dist/*.whl
twine check dist/*.tar.gz
check-manifest {toxinidir}
bump2version --dry-run --verbose --allow-dirty patch
bump2version --dry-run --verbose --allow-dirty minor
bump2version --dry-run --verbose --allow-dirty major
commands_post = python {toxinidir}/devtools/clean_dist_check.py
# code quality assessment.
# This is not a check in the CI, serves just as info for the developers
[testenv:radon]
deps = radon
skip_install = true
commands =
radon cc -s --total-average --no-assert {posargs:src/mdacli}
radon mi -m -s {posargs:src/mdacli}
# Test docs building as it will occur on ReadTheDocs
[testenv:docs]
usedevelop = true
deps =
-r{toxinidir}/devtools/docs_requirements.txt
gitpython
commands =
sphinx-build {posargs:-E} -b html docs/rst dist/docs
python {toxinidir}/devtools/check_changelog.py
[testenv:safety]
deps = safety
skip_install = true
commands = safety check