forked from catalyst-cooperative/pudl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tox.ini
179 lines (163 loc) · 4.55 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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
[tox]
envlist =
etl
nbval
validate
docs
flake8
doc8
pre-commit
bandit
linters
travis
build
release
[testenv]
whitelist_externals =
bash
# shared directory for re-used packages
envdir = {toxinidir}/.env_pudl
passenv =
CI
TRAVIS
TRAVIS_*
[testenv:flake8]
skip_install = true
deps =
flake8
flake8-docstrings
flake8-builtins
pep8-naming
pydocstyle
commands =
flake8 --format="%(path)40s:%(row)-4d %(code)s %(text)s" src/pudl/ test/ setup.py
[testenv:doc8]
skip_install = true
deps =
sphinx
doc8
commands =
doc8 --ignore-path docs/ferc/form1 --ignore-path docs/_build docs/
[testenv:pre-commit]
skip_install = true
deps =
pre-commit
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
[testenv:bandit]
skip_install = true
deps =
bandit
commands =
bandit -r src/pudl/ -c .bandit.yml
# Run some automated code quality control checks:
[testenv:linters]
skip_install = true
deps =
{[testenv:pre-commit]deps}
{[testenv:bandit]deps}
{[testenv:flake8]deps}
commands =
{[testenv:pre-commit]commands}
{[testenv:bandit]commands}
{[testenv:flake8]commands}
# Test the ETL processing pipeline:
[testenv:etl]
extras =
test
commands =
pytest {posargs} --disable-warnings --log-cli-level=info --log-cli-format="%(asctime)s [%(levelname)8s] %(name)s:%(lineno)s %(message)s" --log-date-format="%Y-%m-%d %H:%M:%S" --cov-report=term --cov-report=xml --cov-config=.coveragerc --cov={envsitepackagesdir}/pudl -m data_package
# Data validation tests / notebooks
[testenv:validate]
skip_install = false
extras =
test
commands =
pytest --disable-warnings --live_pudl_db=AUTO --live_ferc_db=AUTO --pudl_in=AUTO --pudl_out=AUTO test/validate
# Notebook validation tests
[testenv:nbval]
skip_install = false
extras =
{[testenv:validate]extras}
commands =
pytest --disable-warnings -sv --nbval-lax test/notebooks
pytest --disable-warnings -sv --nbval-lax src/pudl/package_data/notebooks
bash -c 'rm -f src/pudl/package_data/notebooks/*.csv'
# Test building the Sphinx docs:
[testenv:docs]
skip_install = false
deps =
{[testenv:doc8]deps}
extras =
doc
commands =
# Remove the old docs build output to start fresh:
bash -c 'rm -rf docs/_build'
# Generate autodoc based entries for all the modules, excluding:
# * package_data (which is not actually code)
# * the graveyard pudl.analysis.analysis module
# * the not ready pudl.glue.zipper module
sphinx-apidoc --separate --output-dir docs/api src/pudl "src/pudl/package_data/*" "src/pudl/analysis/analysis.py" "src/pudl/glue/zipper.py"
{[testenv:doc8]commands}
sphinx-build -W -b html docs docs/_build/html
#sphinx-build -b latex docs docs/_build/latex
#sphinx-build -b epub docs docs/_build/epub
[testenv:scripts]
skip_install = false
commands =
bash -c 'pudl_setup --help > /dev/null'
bash -c 'pudl_data --help > /dev/null'
bash -c 'ferc1_to_sqlite --help > /dev/null'
bash -c 'pudl_etl --help > /dev/null'
bash -c 'datapkg_to_sqlite --help > /dev/null'
bash -c 'epacems_to_parquet --help > /dev/null'
[testenv:travis]
skip_install = false
extras =
{[testenv:docs]extras}
{[testenv:etl]extras}
deps =
{[testenv:linters]deps}
commands =
{[testenv:linters]commands}
{[testenv:docs]commands}
{[testenv:etl]commands}
{[testenv:scripts]commands}
# Release tooling
[testenv:build]
basepython = python3
skip_install = true
deps =
wheel
setuptools
setuptools_scm
commands =
bash -c 'rm -rf build/* dist/*'
python setup.py sdist bdist_wheel
[testenv:testrelease]
basepython = python3
skip_install = true
deps =
{[testenv:build]deps}
twine
commands =
{[testenv:build]commands}
twine check dist/*
twine upload --sign --verbose --repository testpypi --skip-existing dist/*
[testenv:release]
basepython = python3
skip_install = true
deps =
{[testenv:build]deps}
twine
commands =
{[testenv:build]commands}
twine check dist/*
twine upload --sign --verbose --skip-existing dist/*