-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpyproject.toml
248 lines (211 loc) · 6.35 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
[build-system]
# Minimum requirements for the build system to execute.
# PEP 508 specifications for PEP 518.
requires = [
"setuptools >= 61.0.0",
"setuptools_scm[toml]>=6.2",
"wheel",
]
build-backend="setuptools.build_meta"
[project]
name = "threaded"
description = "Decorators for running functions in Thread/ThreadPool/IOLoop"
requires-python = ">=3.8.0"
keywords = ["pooling", "multithreading", "threading", "asyncio", "development"]
license={text="Apache-2.0"} # Use SPDX classifier
readme = {file = "README.rst", content-type = "text/x-rst"}
authors=[{name="Aleksei Stepanov", email="[email protected]"}]
maintainers=[
{name="Aleksei Stepanov", email="[email protected]"},
{name="Antonio Esposito", email="[email protected]"},
{name="Dennis Dmitriev", email="[email protected]"},
]
dynamic = ["version", "classifiers", "dependencies"]
[project.urls]
"Documentation" = "https://threaded.readthedocs.io/"
"Repository" = "https://github.com/python-useful-helpers/threaded"
"Bug Tracker" = "https://github.com/python-useful-helpers/threaded/issues"
[tool.setuptools.packages.find]
exclude = [
"doc*",
"examples",
"test*",
"bin",
".*"
]
namespaces = false
[tool.setuptools.dynamic]
dependencies = {file = ["requirements.txt"]}
classifiers = {file = ["classifiers.txt"]}
[tool.distutils.bdist_wheel]
universal = 0
[tool.setuptools_scm]
write_to = "threaded/_version.py"
[tool.cibuildwheel]
# Disable building PyPy wheels on all platforms
# Disable musllinux as not popular platform
skip = ["pp*", "*-musllinux_*"]
before-build = "python -m pip install -U pip cython -r CI_REQUIREMENTS.txt"
build-frontend = { name = "build", args = ["--no-isolation"] }
[tool.black]
line-length = 120
target-version = ["py38"]
[tool.isort]
line_length = 120
multi_line_output = 3
force_single_line = true
[tool.doc8]
max-line-length = 150
[tool.pydocstyle]
ignore = [
"D401",
"D202",
"D203",
"D213"
]
# First line should be in imperative mood; try rephrasing
# No blank lines allowed after function docstring
# 1 blank line required before class docstring
# Multi-line docstring summary should start at the second line
match = "(?!_version|test_)*.py"
[tool.mypy]
strict = true
warn_unused_configs = true
warn_redundant_casts = true
show_error_context = true
show_column_numbers = true
show_error_codes = true
pretty = true
[tool.pytest.ini_options]
minversion = "6.0"
addopts = "-vvv -s -p no:django -p no:ipdb"
testpaths = ["test"]
mock_use_standalone_module = false
junit_family = "xunit2"
[tool.coverage.run]
omit = ["test/*"]
branch = true
[tool.coverage.report]
exclude_lines = [
# Have to re-enable the standard pragma
"pragma: no cover",
# Don't complain about missing debug-only code:
"def __repr__",
# Don't complain if tests don't hit defensive assertion code:
"raise NotImplementedError",
# Exclude methods marked as abstract
"@abstractmethod",
# Exclude import statements
"^from\b",
"^import\b",
# Exclude variable declarations that are executed when file is loaded
"^[a-zA-Z_]+\b\\s=",
# Code for static analysis is never covered:
"if typing.TYPE_CHECKING:",
# Fallback code with no installed deps is almost impossible to cover properly
"except ImportError:",
# Don't complain if non-runnable code isn't run:
"if __name__ == .__main__.:",
# OS Specific
"if platform.system()",
]
[tool.coverage.json]
pretty_print = true
[tool.ruff]
line-length = 120
output-format = "full"
target-version = "py38"
[tool.ruff.lint]
extend-select = [
"E",
"W", # also pycodestyle warnings
"PYI", # flake8-pyi
"ASYNC", # flake8-async
"FA", # from __future__ import annotations
"DTZ", # flake8-datetimez
"SLOT", # flake8-slots
"TCH", # flake8-type-checking
"PTH", # flake8-use-pathlib
"S", # flake8-bandit
"A", # flake8-builtins
"B", "T10", "EXE", # flake8-bugbear, flake8-debugger, flake8-executable
"ISC", # flake8-implicit-str-concat
"RET", "SIM", "C4", # flake8-return, flake8-simplify, flake8-comprehensions
"ICN", "PGH", # flake8-import-conventions, pygrep-hooks
"Q", # quotes
"FLY", # Flynt
"FURB", # Refurb
"TRY", "UP", "I", "PL", "PERF", "RUF", # tryceratops, pyupgrade, isort, pylint + perflint, Ruff-specific
]
extend-ignore = [
# refactor rules (too many statements/arguments/branches)
"PLR0904", "PLR0911", "PLR0912", "PLR0913", "PLR0915", "PLR2004",
"PLR6301", # "maybe staticmethod"
"PLW3201", # Bad or misspelled dunder method name `__pretty_repr__`
"RET504", # Unnecessary variable assignment before return statement
"SIM108", # Use ternary operator,
"TRY003", # long messages prepare outside, ...
]
[tool.ruff.lint.per-file-ignores]
"test_*.py" = ["SIM117", "PTH107", "PTH110", "PTH118"]
[tool.ruff.lint.isort]
force-single-line = true
known-third-party = ["logwrap", "paramiko", "tenacity", "pyyaml", "ruamel.yaml", "psutil"]
[tool.ruff.lint.pydocstyle]
convention = "pep257"
[tool.refurb]
python_version = "3.8"
enable_all = true
ignore = ["FURB120"]
[tool.pylint]
extension-pkg-whitelist = ["lxml.etree"]
ignore = ["CVS", "_version.py"]
jobs = 0
py-version = "3.8"
load-plugins = [
"pylint.extensions.docparams",
"pylint.extensions.docstyle",
"pylint.extensions.overlapping_exceptions",
"pylint.extensions.check_elif",
"pylint.extensions.for_any_all",
"pylint.extensions.code_style",
"pylint.extensions.redefined_variable_type",
"pylint.extensions.typing",
"pylint.extensions.empty_comment",
"pylint.extensions.dunder",
]
enable = "all"
disable = [
"locally-disabled",
"file-ignored",
"suppressed-message",
"similarities",
"too-many-ancestors",
"too-few-public-methods",
"too-many-public-methods",
"too-many-return-statements",
"too-many-branches",
"too-many-arguments",
"too-many-locals",
"too-many-statements",
"too-many-instance-attributes",
"too-many-lines",
"broad-except",
"logging-fstring-interpolation",
"logging-format-interpolation",
"consider-alternative-union-syntax",
"consider-using-assignment-expr",
"deprecated-typing-alias",
"invalid-name"
]
max-line-length = 120
reports = false
[tool.pylint.dunder]
good-dunder-names = ["__pretty_repr__", "__pretty_str__"]
[tool.pylint.parameter_documentation]
accept-no-param-doc = true
accept-no-raise-doc = false
accept-no-return-doc = false
accept-no-yields-doc = false
# Possible choices: ['sphinx', 'epytext', 'google', 'numpy', 'default']
default-docstring-type = "default"