-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
252 lines (225 loc) · 5.89 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
[build-system]
requires = ["setuptools >= 64.0.0", "wheel"]
build-backend = "setuptools.build_meta"
##
# Project / Setuptools definition
##
[project]
name = "dwas"
version = "0.0.4"
description = "dwas is a command line tool to define and run your development workflows"
readme = "README.rst"
requires-python = ">= 3.8"
authors = [
{ name = "Benjamin Schubert", email = "[email protected]" }
]
keywords = ["workflows", "virtual", "environments", "isolated", "testing"]
license = {text = "MIT"}
classifiers = [
"Development Status :: 2 - Pre-Alpha",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: Software Development :: Testing",
"Topic :: Utilities",
]
dynamic = ["dependencies", "optional-dependencies"]
[project.urls]
homepage = "https://github.com/BenjaminSchubert/dwas"
repository = "https://github.com/BenjaminSchubert/dwas"
tracker = "https://github.com/BenjaminSchubert/dwas/issues"
documentation = "https://dwas.readthedocs.io/en/latest/"
changelog = "https://github.com/BenjaminSchubert/dwas/CHANGELOG.rst"
[project.entry-points.console_scripts]
dwas = "dwas.__main__:main"
[tool.setuptools.packages.find]
where = ["src"]
[tool.setuptools.package-data]
dwas = ["py.typed"]
[tool.setuptools.dynamic]
dependencies.file = "requirements/requirements.txt"
optional-dependencies.test.file = "requirements/requirements-test.txt"
optional-dependencies.docs.file = "requirements/requirements-docs.txt"
##
# Linters / Formatters
##
##
# Black
[tool.black]
line-length = 79
##
# Docformatter
[tool.docformatter]
black = true
recursive = true
make-summary-multi-line = true
pre-summary-newline = true
wrap-summaries = 89
wrap-descriptions = 72
##
# Isort
[tool.isort]
profile = "black"
line_length = 79
skip_gitignore = true
##
# Mypy
[tool.mypy]
check_untyped_defs = true
ignore_missing_imports = false
strict = true
warn_no_return = true
warn_return_any = true
warn_unused_configs = true
warn_unused_ignores = true
[[tool.mypy.overrides]]
module = "tests.*"
allow_untyped_defs = true
allow_untyped_calls = true
[[tool.mypy.overrides]]
module = "virtualenv.*"
ignore_missing_imports = true
##
# Pylint
[tool.pylint.main]
load-plugins = "pylint.extensions.docparams"
[tool.pylint.format]
good-names = ["id", "fd"]
[tool.pylint."MESSAGE CONTROL"]
disable = [
"fixme",
# This one can never be disabled per-file.
"duplicate-code",
# Stylistic decisions
"too-few-public-methods",
"too-many-arguments",
# XXX: Mypy and pylint sometimes conflict here, but mypy will check too
# Mainly around callback protocols
# See https://github.com/python/mypy/issues/5876
"arguments-differ",
# TODO: enable those, we want documentation
"missing-class-docstring",
"missing-function-docstring",
"missing-module-docstring",
# Taken care of by ruff
"broad-exception-caught",
]
[tool.pylint.variables]
"init-import" = true
##
# Ruff
[tool.ruff]
target-version = "py38"
select = ["ALL"]
ignore = [
##
# Typing
"ANN101", # Don't annotate 'self'
"ANN102", # Don't annotate 'cls'
"ANN401", # Allow typing with ANY
##
# Format
"COM812", # Don't put trailing commas everywhere
"E501", # line length is handled by black
##
# Docs
"D200",
"D203",
"D212",
"D404",
##
# Stylistic decisions
"PLR0911", # pylint too many return statements
"PLR0912", # pylint too many branches
"PLR0913", # pylint too many arguments
"PLR0915", # pylint too many statements
"N818", # we name exception as Exception not Error
"FIX", # We want to put fixmes longterm
"TD", # We want to be able to add todos without issu links
"INP001", # Not every .py file is part of a package
"PT004", # Don't add `_` in front of fixtures returning nothing
"S101", # Allow asserts
"TID252", # We want relative imports
"PLR2004", # Disable magic numbers check
# Exception handling
"EM101",
"EM102",
"RSE102",
"TRY002",
"TRY003",
# We are not doing cryptographic stuff
"S311",
# This is buggy and doesnt' say how to validate
"S603",
# We want to be able tor rely on PATH and not hardcode binaries
"S607",
]
flake8-pytest-style.parametrize-values-type = "tuple"
flake8-pytest-style.parametrize-values-row-type = "tuple"
flake8-pytest-style.fixture-parentheses = false
lint.isort.known-first-party = ["dwas"]
[tool.ruff.lint.per-file-ignores]
"docs/*" = ["D"]
"tests/*" = [
# No need to type annotate tests
"ANN",
# No need to document tests
"D100",
"D101",
"D102",
"D103",
"D104",
# too many arguments, acceptable for tests
"PLR0913",
# Allow prints in tests
"T201",
]
##
# Testing
##
##
# Pytest
[tool.pytest.ini_options]
addopts = "--ignore tests/predefined/examples --verbose --verbose --cov --cov-config=pyproject.toml --cov-report="
log_level = "DEBUG"
xfail_strict = true
markers = [
"predefined: tests for the predefined steps provided by dwas",
"project: the project in which to run tests (only used by test setup)"
]
filterwarnings = [
"error",
"ignore:The --rsyncdir command line argument.*:DeprecationWarning"
]
##
# Coverage
[tool.coverage.run]
branch = true
source = [
"dwas",
"tests/",
]
[tool.coverage.paths]
source = [
"src/dwas",
"**/src/dwas",
"**/site-packages/dwas/",
]
tests = [
"tests/",
"**/tests/",
]
[tool.coverage.report]
exclude_lines = [
"# pragma: nocover",
"^if TYPE_CHECKING:$",
"@(abc\\.)?abstractmethod",
# This is '...' alone on a line
"^\\s*\\.\\.\\.$",
]