-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtox.ini
110 lines (100 loc) · 3.06 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
[tox]
envlist = ci
[testenv]
allowlist_externals =
bash
coverage
sphinx-build
# shared directory for re-used packages
envdir = {toxinidir}/.env_tox
passenv =
CI
CONDA_PREFIX
GITHUB_*
GOOGLE_APPLICATION_CREDENTIALS
HOME
SQLALCHEMY_WARN_20
covargs = --cov={envsitepackagesdir}/ferc_xbrl_extractor --cov-append --cov-report=xml
covreport = coverage report --sort=cover
#######################################################################################
# Code and Documentation Linters
#######################################################################################
[testenv:ruff]
description = Run the ruff linter on the entire PUDL codebase
skip_install = false
extras =
test
commands =
ruff check ./
[testenv:pre_commit]
description = Run git pre-commit hooks not covered by the other linters.
skip_install = false
extras =
tests
commands =
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
[testenv:linters]
description = Run the pre-commit and ruff linters
skip_install = false
extras =
{[testenv:pre_commit]extras}
{[testenv:ruff]extras}
commands =
{[testenv:pre_commit]commands}
{[testenv:ruff]commands}
#######################################################################################
# Lint and Build the Docs
#######################################################################################
[testenv:doc8]
description = Check the documentation input files for syntactical correctness.
skip_install = false
extras =
docs
commands =
doc8 docs/ README.rst
[testenv:docs]
description = Build the HTML docs from scratch using Sphinx.
skip_install = false
extras =
{[testenv:doc8]extras}
commands =
bash -c 'rm -rf docs/_build'
{[testenv:doc8]commands}
sphinx-build -W -b html docs docs/_build/html
#######################################################################################
# Test the code
#######################################################################################
[testenv:unit]
description = Run all the software unit tests.
extras =
tests
commands =
pytest {posargs} {[testenv]covargs} \
--doctest-modules {envsitepackagesdir}/ferc_xbrl_extractor \
tests/unit
[testenv:integration]
description = Run all software integration tests
extras =
tests
commands =
pytest {posargs} {[testenv]covargs} tests/integration
[testenv:ci]
description = Run all continuous integration (CI) checks & generate test coverage.
skip_install = false
recreate = true
extras =
{[testenv:linters]extras}
{[testenv:docs]extras}
{[testenv:unit]extras}
{[testenv:integration]extras}
commands =
coverage erase
{[testenv:linters]commands}
{[testenv:docs]commands}
{[testenv:unit]commands}
{[testenv:integration]commands}
{[testenv]covreport}