-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpyproject.toml
272 lines (254 loc) · 5.8 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
# SPDX-License-Identifier: MIT
# or select a license from:
# https://spdx.org/licenses/
#
# Example of a `pyproject.toml` file for a Python-only package.
#
[project]
name = "my_py_package"
description = "A short description of the package."
authors = [
{ name = "Author Name", email = "[email protected]" },
]
readme = "README.md"
requires-python = ">=3.10,<3.13"
dynamic = ["version"]
classifiers = [
"Development Status :: 3 - Alpha",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Operating System :: OS Independent",
"Intended Audience :: Science/Research",
"Intended Audience :: Developers",
]
# RESTRICTION: Dependencies MUST NOT conflict with the dependencies of the core package.
dependencies =[
# Add your dependencies here.
"typer<1",
]
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.version]
path = "my_py_package/_version.py"
[project.scripts]
my-py-package = "my_py_package.cli:app"
[project.optional-dependencies]
dev = [
'autoflake==2.3.1',
'bandit==1.8.2',
'black==25.1.0',
'flake8==7.1.1',
'isort==6.0.0',
'mypy==1.15.0',
'pre-commit==4.1.0',
'pydocstyle==6.3.0',
'pylint==3.3.4',
'python-dotenv==1.0.1',
'ruff==0.9.6',
'types-PyYAML==6.0.12.20241230',
'yamllint==1.35.1',
'toml; python_version <= "3.10"',
'types-toml== 0.10.8.20240310',
]
test = [
'pytest==8.3.4',
'pytest-asyncio==0.25.3',
'pytest-cov==6.0.0',
'pytest-html==4.1.1',
'pytest-sugar==1.0.0',
'pytest-timeout==2.3.1',
'pytest-xdist==3.6.1',
]
docs = [
'mdx-include==1.4.2',
'mdx_truly_sane_lists==1.3',
'mkdocs==1.6.1',
'mkdocs-macros-plugin==1.3.7',
'mkdocs-material==9.6.4',
'mkdocs-minify-html-plugin==0.2.4',
'mkdocstrings[crystal,python]==0.28.1',
'mkdocstrings-python==1.15.0'
]
# black
[tool.black]
line-length = 80
skip-string-normalization=true
include = '''
\.pyi?$
'''
exclude = '''
/(
\.git
| \.mypy_cache
| \.venv
| .local
| _build
| __init__.py
| .local
)/
'''
# mypy
[tool.mypy]
files = '.'
show_error_codes = true
# xcode/dmypy: follow-imports=silent not supported
# follow_imports = 'skip'
platform = 'linux'
check_untyped_defs = true
disallow_any_generics = true
disallow_incomplete_defs = true
disallow_subclassing_any = false
disallow_untyped_calls = true
disallow_untyped_decorators = true
disallow_untyped_defs = true
ignore_missing_imports = false
no_implicit_reexport = true
strict_optional = true
warn_redundant_casts = true
warn_unused_configs = true
warn_unused_ignores = true
plugins = [
# 'pydantic.mypy'
]
exclude = [
'.venv',
'.local',
]
# [tool.pydantic-mypy]
# init_forbid_extra = true
# init_typed = true
# warn_required_dynamic_aliases = false
# isort
[tool.isort]
profile ='black'
skip=[
'.venv',
'.local',
]
include_trailing_comma=true
force_grid_wrap=0
use_parentheses=true
line_length=80
# pydocstyle
[tool.pydocstyle]
match-dir='([^!(.venv)].*)([^!(.local)].*)'
# pylint
[tool.pylint.master]
load-plugins = [
'pylint.extensions.mccabe',
'pylint.extensions.redefined_variable_type',
'pylint.extensions.broad_try_clause',
'pylint.extensions.no_self_use',
'pylint.extensions.docparams',
]
extension-pkg-whitelist= []
# reports=true
recursive=true
fail-under=8.0
ignore=["CVS"]
ignore-paths = [
".venv",
".local*",
]
unsafe-load-any-extension="no"
[tool.pylint.messages_control]
enable=["c-extension-no-member"]
[tool.pylint.format]
max-line-length=80
[tool.pylint.similarities]
ignore-imports="yes"
ignore-signatures="yes"
min-similarity-lines=10
[tool.pylint.broad_try_clause]
max-try-statements=3
[tool.pylint.design]
max-args=10
max-attributes=10
max-positional-arguments=10
[tool.pylint.string]
check-quote-consistency = true
check-str-concat-over-line-jumps = true
[tool.pylint.parameter_documentation]
accept-no-param-doc=false
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 = "numpy"
# bandit
[tool.bandit]
exclude_dirs = [
".venv",
".local",
]
# B104: bind to all interfaces (0.0.0.0)
# B110: allow pass on try/except
# B404: allow import subprocess
# B602, B603: allow shell=True (subprocess,popen)
skips = ['B104', 'B110', 'B404', 'B602', 'B603' ]
[tool.bandit.assert_used]
skips = ['*_test.py', '*/test_*.py']
# ruff
[tool.ruff]
line-length = 80
extend-exclude = [
".venv",
".local",
]
[tool.ruff.lint]
select = ["E4", "E7", "E9", "F", "Q"]
ignore = []
# # Allow fix for all enabled rules (when `--fix`) is provided.
fixable = ["ALL"]
unfixable = []
# # Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
[tool.ruff.format]
# exclude = ["*.pyi", "*.j2"]
# Like Black, use double quotes for strings.
quote-style = "double"
# Like Black, indent with spaces, rather than tabs.
indent-style = "space"
# Like Black, respect magic trailing commas.
skip-magic-trailing-comma = false
line-ending = "lf"
# pytest
[tool.pytest.ini_options]
# If not using pytest-asyncio/async tests remove the next two lines.
asyncio_mode = 'auto'
asyncio_default_fixture_loop_scope='session'
#
filterwarnings = [
"ignore::DeprecationWarning",
]
python_files = [
"tests.py",
"test_*.py",
"*_tests.py",
]
addopts = """
-d \
-n auto \
--exitfirst \
--durations=10 \
--color=yes \
--timeout=120
"""
# coverage
[tool.coverage.run]
omit = [
"example.py",
]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"if TYPE_CHECKING:",
"if __name__ == .__main__.:",
]
fail_under = 80
precision = 2