-
Notifications
You must be signed in to change notification settings - Fork 15
/
tox.ini
138 lines (120 loc) · 3.23 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
[tox]
envlist = py38,py39,py310,lint,doc
isolated_build = True
# UNIT TESTS #
[testenv]
deps = pytest
commands = pytest
# LINTING & FORMATTING #
[testenv:lint]
description = Lint Python source code
deps =
{[testenv:black]deps}
{[testenv:flake8]deps}
{[testenv:pylint]deps}
commands =
{[testenv:black]commands}
{[testenv:flake8]commands}
{[testenv:pylint]commands}
[testenv:black]
deps = black
commands = black --check .
[testenv:flake8]
deps =
darglint
flake8
flake8-docstrings
flake8-isort
commands = flake8 src/diepvries
[flake8]
exclude = .tox
ignore =
# Line break before operator: not PEP8 compliant, handled by Black
# https://black.readthedocs.io/en/stable/the_black_code_style.html#line-breaks-binary-operators
W503
# Whitespace before ':': not PEP8 compliant, handled by Black
# https://black.readthedocs.io/en/stable/the_black_code_style.html#slices
E203
# Unused import: handled by Pylint
F401
extend-select =
D400
D401
D404
# docstring maximum length is infinite by default, and not handled by black
max-doc-length = 88
max-line-length = 88
# pydocstyle (through flake-docstrings)
docstring-convention = google
# darglint
docstring-style = google
strictness = long
[isort]
# Overrides to play nicely with Black
# https://black.readthedocs.io/en/stable/the_black_code_style.html#how-black-wraps-lines
multi_line_output=3
include_trailing_comma=True
force_grid_wrap=0
use_parentheses=True
line_length=88
[testenv:pylint]
deps = pylint
commands = pylint --rcfile=tox.ini src/diepvries
[pylint]
## MESSAGES CONTROL
disable =
duplicate-code
## BASIC
good-names=e
## DESIGN
max-args=10
max-attributes=10
# DOCUMENTATION #
[testenv:doc]
allowlist_externals = touch
deps =
sphinx
sphinx-autodoc-typehints
myst-parser
commands =
# Build apidoc
sphinx-apidoc --implicit-namespaces -M -t doc_templates --separate -o doc/api src/diepvries
# Build final documentation
sphinx-build \
-b html \
-C \
-D project="diepvries" \
-D copyright="Picnic Technologies" \
-D extensions="sphinx.ext.autodoc,sphinx.ext.napoleon,sphinx_autodoc_typehints,sphinx.ext.graphviz,myst_parser" \
-D napoleon_google_docstring=1 \
-D napoleon_numpy_docstring=0 \
-D napoleon_include_init_with_doc=1 \
-D napoleon_include_private_with_doc=0 \
-D napoleon_include_special_with_doc=1 \
-D exclude_patterns="build" \
-D html_static_path="static/" \
-D html_theme="alabaster" \
-D html_theme_options.description="Data Vault framework in Python" \
-D html_theme_options.fixed_sidebar="true" \
-D html_theme_options.sidebar_collapse="false" \
-D html_theme_options.logo="diepvries-round.svg" \
-D html_theme_options.logo_name="true" \
doc \
doc/html
# Tell GitHub to also serve folders prefixed with _
touch doc/html/.nojekyll
[testenv:serve-docs]
skip_install = true
commands = python -m http.server --directory doc/html
# BUILD #
[testenv:build]
deps = build
commands =
python -m build
[testenv:upload]
deps = twine
passenv = TWINE_USERNAME, TWINE_PASSWORD
setenv =
TWINE_NON_INTERACTIVE = 1
commands =
python -m twine upload dist/*