-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtox.ini
94 lines (78 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
[tox]
envlist = build, docs, lint, test, update_version
# Define the minimal tox version required to run;
# if the host tox is less than this the tool with create an environment and
# provision it with a tox that satisfies it under provision_tox_env.
# At least this version is needed for PEP 517/518 support.
minversion = 3.10.0
# Activate isolated build environment. tox will use a virtual environment
# to build a source distribution from the source tree. For build tools and
# arguments use the pyproject.toml file as specified in PEP-517 and PEP-518.
isolated_build = true
[testenv]
description = Run tests and generate coverage reports
deps =
# check-manifest >= 0.42
# If your project uses README.rst, uncomment the following:
# readme_renderer
.[test]
commands =
# check-manifest --ignore 'tox.ini,tests/**'
# This repository uses a Markdown long_description, so the -r flag to
# 'setup.py check' is not needed. If your project contains a README.rst,
# use `python setup.py check -m -r -s` instead.
python setup.py check --metadata --strict
# create report directories
python create_report_dirs.py
# py.test tests {posargs}
nose2 --config tests/unittest.cfg
# generate coverage reports
coverage xml
coverage html
[testenv:lint]
description = Run flake8 and mypy checks
skip_install = true
deps =
.[test]
commands =
# create report directories
python create_report_dirs.py
flake8 src tests --output-file=reports/sca/flake8.out
mypy src --strict
[testenv:update_version]
description = Update package version file with latest changelog version
skip_install = true
deps =
changelog2version>=0.5.0,<1
commands =
changelog2version \
--changelog_file changelog.md \
--version_file src/lightweight_versioned_gitlab_pages/version.py \
--version_file_type py \
--debug
[testenv:build]
description = Build python package
skip_install = true
deps =
build>=0.9.0,<1
{[testenv:update_version]deps}
commands =
# update package version file
{[testenv:update_version]commands}
# build package
python -m build
# check for valid package name
python -c "import os; assert(not [path for path in os.listdir('dist') if 'UNKNON' in path])"
[testenv:docs]
description = Create documentation
deps =
.
-r{toxinidir}/docs/requirements.txt
{[testenv:update_version]deps}
commands =
# update package version file
{[testenv:update_version]commands}
# perform link checks
sphinx-build docs/ docs/build/linkcheck -d docs/build/docs_doctree/ --color -blinkcheck -j auto -W
# create documentation
sphinx-build docs/ docs/build/html/ -d docs/build/docs_doctree/ --color -bhtml -j auto -W