-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
275 lines (256 loc) · 7.72 KB
/
pyproject.toml
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
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
[build-system]
requires = ["setuptools>=45", "wheel", "setuptools_scm[toml]>=6.2"]
build-backend = "setuptools.build_meta"
##############################################################################
# -- setuptools_scm: versions from Git tags ----------------------------------
#####
#
# Reference: https://github.com/pypa/setuptools_scm
#
# The setuptools_scm configuration file can be either
#
# - pyproject.toml (must contains a [tool.pytest.ini_options] table)
# - setup.py (deprecated)
# - setup.cfg (deprecated)
#
###
[tool.setuptools_scm]
#####
##############################################################################
##############################################################################
# -- pytest: test runner -----------------------------------------------------
#####
#
# Reference: https://docs.pytest.org/en/stable/customize.html
#
# The pytest configuration file can be either
#
# - pytest.ini
# - pyproject.toml (must contains a [tool.pytest.ini_options] table)
# - tox.ini (must contains a [pytest] section)
# - setup.cfg (not recommended) (contains a [tool:pytest] section)
#
# It is important to understand that there is no merging of configuration
# files, as it would lead to ambiguity.
#
###
[tool.pytest.ini_options]
addopts = [
# Verbose mode shows context of execution on failure
"-v",
"-W", "error",
]
testpaths = [
]
norecursedirs = [
"test/integrated/*samples",
]
doctest_optionflags = [
"NORMALIZE_WHITESPACE",
"IGNORE_EXCEPTION_DETAIL",
"ELLIPSIS",
]
#####
##############################################################################
##############################################################################
# -- coverage.py: test coverage measures -------------------------------------
#####
#
# Reference: https://coverage.readthedocs.io/en/latest/config.html
#
# The coverage.py configuration file can be either
#
# - As specified by the --rcfile=FILE flag
# - As specified by the COVERAGE_RCFILE environment variable
# - .coveragerc
# - setup.cfg (sections must be prefixed with "coverage:")
# - tox.ini (sections must be prefixed with "coverage:")
# - pyproject.toml (must be within the "tool.coverage" namespace,
# and coverage[toml] extra must be installed.)
###
[tool.coverage.run]
# Read more about configuring coverage.py at
# http://coverage.readthedocs.io/en/coverage-4.5.1/config.html
branch = true
omit = [
"test/*",
"*/conf.py" # The sphinx pytest fixture emits conf.py files, we don't want that
]
source = [
"sphinx_compendia"
]
data_file = "build/report/coverage/coverage"
parallel = true
[tool.coverage.paths]
source = [
"src",
".nox/*/site-packages"
]
[tool.coverage.report]
# Don’t include files in the report that are 100% covered files.
skip_covered = false
show_missing = true
# Sort the text report by the named column.
# Allowed values are “Name”, “Stmts”, “Miss”, “Branch”, “BrPart”, or “Cover”.
sort = "Miss"
# Regexes for lines to exclude from consideration
exclude_lines = [
# Have to re-enable the standard pragma
"pragma: no cover",
"noqa",
# Don't complain about missing debug-only code
"def __repr__",
"if self\\.debug",
# Don't complain if tests don't hit defensive assertion code
"raise AssertionError",
"raise NotImplementedError",
# Don't complain if non-runnable code isn't run
"if 0:",
"if __name__ == .__main__.:",
]
omit = [
]
[tool.coverage.html]
show_contexts = true
directory = "build/report/coverage/html"
[tool.coverage.xml]
output = "build/report/coverage.xml"
#####
##############################################################################
##############################################################################
# -- mypy: type checking -----------------------------------------------------
#####
#
# Reference: https://mypy.readthedocs.io/en/stable/config_file.html
#
# The mypy configuration file can be either (in priority order)
#
# - specified with the --config-file flag
# - mypy.ini
# - .mypy.ini
# - setup.cfg
# - $XDG_CONFIG_HOME/mypy/config
# - ~/.config/mypy/config
# - ~/.mypy.ini
#
# It is important to understand that there is no merging of configuration
# files, as it would lead to ambiguity.
#
###
[tool.mypy]
strict = true
#no_implicit_reexport = True
follow_imports_for_stubs = true
# output options
pretty = true
# reports
#html_report = "build/report/mypy"
[[tool.mypy.overrides]]
module = [
]
ignore_missing_imports = true
#####
##############################################################################
#####
##############################################################################
##############################################################################
# -- black: code format ------------------------------------------------------
#####
#
# Reference: https://black.readthedocs.io/en/stable/usage_and_configuration/the_basics.html#configuration-via-a-file
#
# The black configuration file can be
#
# - pyproject.toml (must contains a [tool.black] table)
#
###
[tool.black]
line-length = 80
include = '\.pyi?$'
extend-exclude = '''
(
/(
\.eggs
| \.git
| \.mypy_cache
| \.pytest_cache
| \.nox
| \.venv
| build
| dist
)/
)
'''
#####
##############################################################################
##############################################################################
# -- isort: import linter ----------------------------------------------------
#####
#
# Reference: https://pycqa.github.io/isort/docs/configuration/config_files/
#
# The isort configuration file can be either
#
# - as specified by the --settings-path flag
# - .isort.cfg (must contain a [settings] section)
# - pyproject.toml (must contains a [tool.isort] table)
# - setup.cfg (must contain a [isort] section)
# - tox.ini (must contains a [isort] section)
#
# It is important to understand that there is no merging of configuration
# files, as it would lead to ambiguity.
#
###
#####
##############################################################################
[tool.isort]
profile = "black"
src_paths = ["src", "test"]
line_length = 80
add_imports= [
"from __future__ import annotations",
]
extend_skip = [
"noxfile.py",
]
#####
##############################################################################
##############################################################################
# -- pydocstyle: docstring style guide enforcement ---------------------------
#####
#
# Reference: http://www.pydocstyle.org/en/stable/usage.html
#
# The pydocstyle configuration file can be either
#
# - setup.cfg
# - tox.ini
# - .pydocstyle
# - .pydocstyle.ini
# - .pydocstylerc
# - .pydocstylerc.ini
# - pyproject.toml
#
###
[tool.pydocstyle]
# We use the Google docstring style.
convention = "google"
add-ignore = [
"D100", # Missing docstring in public module
"D101", # Missing docstring in public classe
"D102", # Missing docstring in public method
"D103", # Missing docstring in public function
"D105", # Missing docstring in magic method
"D106", # Missing docstring in nested class
"D107", # Missing docstring in __init__
"D200", # Allow starting docstring on second line (under """)
"D205", # Allow starting docstring on second line (under """)
"D212", # Allow starting docstring on second line (under """)
"D415", # Allow starting docstring on second line (under """)
"D405", # Allow 'See also' instead of 'See Also'
"D402", # Allow backticks in summary line
"D417", # Relax argument description, as per the actual Google style guide.
# See https://github.com/PyCQA/pydocstyle/issues/449
]
#####
##############################################################################