-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
245 lines (220 loc) · 5.81 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
[tool.poetry]
name = "objectory"
version = "0.2.1a0"
description = "A light library for general purpose object factories"
readme = "README.md"
authors = ["Thibaut Durand <durand.tibo+gh@gmail.com>"]
homepage = "https://github.com/durandtibo/objectory"
repository = "https://github.com/durandtibo/objectory"
keywords = ["factory", "abstract factory", "registry"]
license = "BSD-3-Clause"
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Intended Audience :: Information Technology",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: BSD License",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Scientific/Engineering",
"Topic :: Software Development :: Libraries",
]
packages = [
{ include = "objectory", from = "src" },
]
[tool.poetry.dependencies]
python = ">=3.9,<3.14"
tornado = ">=6.0,<7.0"
[tool.poetry.group.docs.dependencies]
mike = "^2.1"
mkdocs-material = "^9.5"
mkdocstrings = { extras = ["python"], version = ">=0.26,<0.28" }
[tool.poetry.group.dev.dependencies]
black = ">=24.10"
coverage = { extras = ["toml"], version = "^7.6" }
docformatter = { extras = ["tomli"], version = "^1.7" }
pre-commit = "^4.0"
pygments = "^2.18"
pytest = "^8.3"
pytest-cov = ">=5,<7"
pytest-timeout = "^2.3"
ruff = ">=0.6,<1.0"
xdoctest = "^1.2"
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
[tool.coverage.paths]
source = ["src", "*/site-packages"]
[tool.coverage.run]
branch = true
source = ["objectory"]
[tool.coverage.report]
show_missing = true
exclude_lines = [
"pragma: no cover",
"if TYPE_CHECKING:"
]
[tool.pytest.ini_options]
testpaths = "tests/"
log_format = "%(asctime)s - %(levelname)s - %(name)s - %(message)s"
log_level = "DEBUG"
addopts = "--color yes --durations 10 -rf"
# Configuration of the short test summary info
# https://docs.pytest.org/en/stable/usage.html#detailed-summary-report
[tool.black]
line-length = 100
target-version = ["py39", "py310", "py311", "py312"]
include = '\.pyi?$'
[tool.pylint.FORMAT]
max-line-length = 100
[tool.isort]
profile = "black"
[tool.docformatter]
recursive = true
wrap-summaries = 72
wrap-descriptions = 72
syntax = "google"
[tool.ruff]
# List of rules: https://docs.astral.sh/ruff/rules/
lint.select = [
"A", # builtins
"ANN", # annotations
"ARG", # flake8-unused-arguments
"B", # bugbear
"BLE", # flake8-blind-except
"C4", # flake8-comprehensions
"D", # pydocstyle
"E", # pycodestyle (Error)
"EM", # flake8-errmsg
"F", # pyflakes
"FA", # flake8-future-annotations
"FURB", # refurb
"ICN", # flake8-import-conventions
"INP", # flake8-no-pep420
"ISC", # flake8-implicit-str-concat
"LOG", # logging
"N", # naming
"PD", # pandas-vet
"PERF", # Perflint
"PGH", # pygrep-hooks
"PIE", # flake8-pie
"PL", # Pylint
"PT", # flake8-pytest-style
"PTH", # pathlib
"PYI", # flake8-pyi
"Q", # flake8-quotes
"RET", # flake8-return
"RSE", # flake8-raise
"S", # flake8-bandit
"SIM", # flake8-simplify
"T20", # flake8-print
"TCH", # flake8-type-checking
"TD", # flake8-todos
"TID", # flake8-tidy-imports
"TRY", # tryceratops
"UP", # pyupgrade
"W", # pycodestyle (Warning)
]
lint.ignore = [
"A003", # Class attribute `{name}` is shadowing a python builtin
"ANN101", # Missing type annotation for `self` in method
"ANN102", # Missing type annotation for `cls` in classmethod
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed.
"B905", # `zip()` without an explicit strict= parameter set. The `strict=` argument was added in Python 3.10
"E501", # Line lengths are recommended to be no greater than 79 characters.
"W505", # Doc line too long
"PLR0913", # Too many arguments in function definition (8 > 5)
"PLR2004", # Magic value used in comparison, consider replacing 0.0 with a constant variable
# The following rules are ignored because they conflict with another library like docformatter.
"D102", # Missing docstring in public method
"D105", # Missing docstring in magic method
"D107", # Missing docstring in `__init__`
"D205", # 1 blank line required between summary line and description
"D209", # Multi-line docstring closing quotes should be on a separate line
]
# Allow autofix for all enabled rules (when `--fix`) is provided.
lint.fixable = [
"A",
"ANN",
"ARG",
"B",
"BLE",
"C4",
"D",
"E",
"EM",
"F",
"FA",
"FURB",
"ICN",
"INP",
"ISC",
"LOG",
"PD",
"PERF",
"PGH",
"PIE",
"PL",
"PT",
"PTH",
"PYI",
"Q",
"RET",
"RSE",
"S",
"SIM",
"T20",
"TCH",
"TD",
"TID",
"TRY",
"W",
]
lint.unfixable = []
lint.exclude = [
".bzr",
".direnv",
".eggs",
".git",
".hg",
".mypy_cache",
".nox",
".pants.d",
".pytype",
".ruff_cache",
".tox",
".venv",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"venv",
]
# Enable on top of the Google convention.
lint.extend-select = ["D400", "D401", "D404"]
line-length = 100
target-version = "py39"
src = ["src"]
[tool.ruff.lint.per-file-ignores]
# Ignore all directories named `tests`.
"tests/**" = [
"D", # pydocstyle
"PL", # Pylint
"S101", # flake8-bandit
]
[tool.ruff.lint.mccabe]
max-complexity = 10
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.lint.pycodestyle]
max-doc-length = 72
[tool.ruff.lint.isort]
force-sort-within-sections = true
combine-as-imports = true
known-first-party = ["src"]