generated from rmi-electricity/cheshire
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtox.ini
84 lines (76 loc) · 2.56 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
[tox]
envlist = ci
[testenv]
allowlist_externals =
bash
coverage
sphinx-build
pytest
skip_install = false
passenv = RMICFEZIL_SAS_TOKEN
covargs = --cov={envsitepackagesdir}/etoolbox --cov-append --cov-report=lcov:coverage.info
covreport = coverage report --sort=cover
[testenv:linters]
description = Run the pre-commit, flake8 and bandit linters.
commands =
pre-commit run --all-files --show-diff-on-failure python-no-eval
pre-commit run --all-files --show-diff-on-failure python-no-log-warn
pre-commit run --all-files --show-diff-on-failure python-check-blanket-noqa
pre-commit run --all-files --show-diff-on-failure check-merge-conflict
pre-commit run --all-files --show-diff-on-failure check-yaml
pre-commit run --all-files --show-diff-on-failure check-case-conflict
pre-commit run --all-files --show-diff-on-failure debug-statements
pre-commit run --all-files --show-diff-on-failure name-tests-test
ruff check .
[testenv:docs]
description = Build the HTML docs from scratch using Sphinx.
commands =
bash -c 'rm -rf docs/_build'
doc8 docs/ README.rst
rstcheck --config pyproject.toml --recursive ./
sphinx-build -b html docs docs/_build/html
; sphinx-build -W -b html docs docs/_build/html
[testenv:ci]
description = Run all continuous integration (CI) checks & generate test coverage.
extras =
tests
doc
optional
recreate = true
commands =
coverage erase
{[testenv:linters]commands}
{[testenv:docs]commands}
pytest {posargs} {[testenv]covargs} \
--doctest-modules {envsitepackagesdir}/etoolbox \
tests/unit
{[testenv]covreport}
#######################################################################################
# Software Package Build & Release (not currently part of RMI process)
#######################################################################################
[testenv:build]
description = Prepare Python source and binary packages for release.
basepython = python3
extras =
dev
commands =
bash -c 'rm -rf build/* dist/*'
python3 -m build
twine check dist/*
[testenv:testrelease]
description = Do a dry run of Python package release using the PyPI test server.
basepython = python3
extras =
dev
commands =
{[testenv:build]commands}
twine upload --sign --verbose --repository testpypi --skip-existing dist/*
[testenv:release]
description = Release the package to the production PyPI server.
basepython = python3
skip_install = true
extras =
dev
commands =
{[testenv:build]commands}
twine upload --sign --verbose --skip-existing dist/*