-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
pyproject.toml
274 lines (246 loc) · 9.02 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
[build-system]
requires = ["flit_core >=3.3,<4,!=3.7"]
build-backend = "flit_core.buildapi"
[project]
name = "alluka"
version = "0.4.0"
readme = "README.md"
requires-python = ">=3.11.0,<3.15"
license = {file = "LICENSE"}
authors = [ {name = "Faster Speeding", email="[email protected]"} ]
keywords = ["DI", "injection", "dependency injection" ]
classifiers = [
"Development Status :: 4 - Beta",
"Framework :: AnyIO",
"Framework :: AsyncIO",
"Framework :: Trio",
"License :: OSI Approved :: BSD License",
"Intended Audience :: Developers",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: Implementation :: CPython",
"Topic :: Software Development :: Libraries",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Utilities",
"Typing :: Typed"
]
dependencies = ["typing-extensions>=4.5, <5"]
dynamic = ["description"]
[project.urls]
Homepage = "https://github.com/FasterSpeeding/Alluka"
Repository = "https://github.com/FasterSpeeding/Alluka"
Documentation = "https://alluka.cursed.solutions/"
Changelog = "https://alluka.cursed.solutions/changelog"
[dependency-groups]
docs = [
"markdown-include>=0.8",
"mkdocs>=1.4.2",
"mkdocstrings[python]>=0.19",
"mkdocs-material>=8.5.11",
"mkdocs-minify-plugin>=0.6.4",
]
freeze-locks = ["uv"]
lint = [
"codespell>=2.2.2",
"pre-commit-hooks>=4.4",
"slotscheck>=0.16.1",
"ruff",
]
publish = ["flit>=3.8.0"]
reformat = [
"black>=22.10.0",
"isort>=5.11.3",
"pre-commit-hooks>=4.4",
"pycln>=2.1.2",
"sort-all>=1.2",
]
templating = ["Jinja2>=3.1.2"]
tests = [
"pytest>=7",
"pytest-cov>=4",
"pytest-sugar>=0.9.6",
"pytest-timeout>=2.1",
# Comes with a builtin pytest plugin.
"anyio>=3.6.2",
"pytest-xdist>=3.1",
# Needed to run tests in trio.
"trio>=0.22, <1",
]
type-checking = [
"mypy>=0.991",
"nox",
"pyright>=1.1.285",
{include-group = "tests"},
]
[tool.black]
include = ".*pyi?$"
line-length = 120
skip-magic-trailing-comma = true
target-version = ["py311"]
[tool.coverage.run]
concurrency = ["multiprocessing"]
parallel = true
branch = true
timid = false
source = ["alluka"]
[tool.coverage.report]
precision = 2
show_missing = true
skip_covered = false
exclude_lines = [
"^\\s*\\.\\.\\.$",
"^\\s*@abc.abstractmethod$",
"^if typing.TYPE_CHECKING:$"
]
[tool.isort]
profile = "black"
force_single_line = true
[tool.mypy]
# some good strict settings
strict = true
warn_unreachable = true
# more narrow type ignores
show_error_codes = true
# these are used by pyright
warn_unused_ignores = false
warn_redundant_casts = false
# compatibility with pyright
allow_redefinition = true
[tool.piped]
default_sessions = [
"reformat",
"verify-markup",
"lint",
"spell-check",
"slot-check",
"type-check",
"test",
"verify-types",
]
mypy_allowed_to_fail = true
mypy_targets = ["alluka"]
project_name = "alluka"
top_level_targets = ["./alluka", "./docs_src", "./noxfile.py", "./tests"]
[tool.piped.github_actions.freeze_for_pr]
[tool.piped.github_actions.lint]
[tool.piped.github_actions.pr_docs]
[tool.piped.github_actions.publish]
[tool.piped.github_actions.py_test]
codeclimate_token = "a965935acdc9066802d7201945219784c0f24d22e8a2dff0e6529207726bc8af"
python_versions = ["3.11", "3.12", "3.13", "3.14-dev"]
[tool.piped.github_actions.reformat]
[tool.piped.github_actions.release_docs]
[tool.piped.github_actions.resync_piped]
[tool.piped.github_actions.type_check]
[tool.piped.github_actions.update_licence]
[tool.piped.github_actions.upgrade_locks]
[tool.piped.github_actions.verify_types]
[tool.pycln]
exclude = "docs_src"
[tool.pyright]
include = ["alluka", "docs_src", "noxfile.py", "tests"]
pythonVersion = "3.11"
typeCheckingMode = "strict"
reportMissingModuleSource = "error" # Is only "warning" on strict mode.
# Error code which are disabled even when general strict.
reportShadowedImports = "error"
reportCallInDefaultInitializer = "none" # Ended up just complaining about cases where this was fine (e.g. timedeltas).
reportImplicitStringConcatenation = "none" # Conflicts with flake8 config.
reportMissingSuperCall = "none" # Way too strict (requires calls to `object.__init__`).
reportPropertyTypeMismatch = "error"
reportUninitializedInstanceVariable = "error"
reportUnnecessaryTypeIgnoreComment = "error"
reportUnusedCallResult = "none" # Enforces doing `_ = ...`.
# Error codes which lead to too many false-positives.
reportUnknownMemberType = "warning" # This messes with instance checking generic objects
reportUnknownArgumentType = "warning" # Pretty much the same as reportUnknownMemberType
reportImportCycles = "warning" # This isn't necessarily an issue if it's type checking only.
reportUnknownVariableType = "warning" # Lotta false-positives, might fix/change later.
[tool.pytest.ini_options]
testpaths = ["tests"]
timeout = 15
required_plugins = ["anyio"]
filterwarnings = [
"error",
"ignore:Use Context or CachingContext:DeprecationWarning",
"ignore:Use ContextOverride:DeprecationWarning",
]
[tool.ruff.lint]
select = ["ALL"]
ignore = [
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed in ``
"COM812", # Trailing comma missing (incompatible with black)
"FIX002", # Line contains TODO, consider resolving the issue
"I001", # [*] Import block is un-sorted or un-formatted
"S101", # Use of `assert` detected
"SIM108", # Use ternary operator `` instead of `if`-`else`-block
"TD002", # Missing author in TODO; try: `# TODO(<author_name>): ...` or `# TODO @<author_name>: ...`
"TD003", # Missing issue link on the line following this TODO
]
[tool.ruff.lint.per-file-ignores]
"docs_src/**/*.py" = [
"B008", # Do not perform function call `` in argument defaults; instead, perform the call within the function, or read the default from a module-level singleton variable
"D100", # Missing docstring in public module
"D101", # Missing docstring in public class
"D102", # Missing docstring in public method
"D103", # Missing docstring in public function
"F841", # Local variable `` is assigned to but never used
"INP001", # File `` is part of an implicit namespace package. Add an `__init__.py`.
"PIE790", # [*] Unnecessary `...` literal
"T201", # `print` found
]
"noxfile.py" = [
"F403", # `from noxfile import *` used; unable to detect undefined name
]
"tests/**/*.py" = [
"D100", # Missing docstring in public module
"D101", # Missing docstring in public class
"D102", # Missing docstring in public method
"D103", # Missing docstring in public function
"D104", # Missing docstring in public package
"FBT001", # Boolean-typed positional argument in function definition
"PGH003", # Use specific rule codes when ignoring type issues
"PLR2004", # Magic value used in comparison, consider replacing `` with a constant variable
"SLF001", # Private member accessed: ``
]
"tests/test__client.py" = [
"B008", # Do not perform function call `` in argument defaults; instead, perform the call within the function, or read the default from a module-level singleton variable
]
"tests/test_async_callback_di_future_annotations.py" = [
"B008", # Do not perform function call `` in argument defaults; instead, perform the call within the function, or read the default from a module-level singleton variable
"PLW0603", # Using the global statement to update `` is discouraged
"UP007", # [*] Use `X | Y` for type annotations
]
"tests/test_async_callback_di.py" = [
"B008", # Do not perform function call `` in argument defaults; instead, perform the call within the function, or read the default from a module-level singleton variable
"UP007", # [*] Use `X | Y` for type annotations
]
"tests/test_callback_di_future_annotations.py" = [
"B008", # Do not perform function call `` in argument defaults; instead, perform the call within the function, or read the default from a module-level singleton variable
"PLW0603", # Using the global statement to update `` is discouraged
"UP007", # [*] Use `X | Y` for type annotations
]
"tests/test_callback_di.py" = [
"B008", # Do not perform function call `` in argument defaults; instead, perform the call within the function, or read the default from a module-level singleton variable
"UP007", # [*] Use `X | Y` for type annotations
]
[tool.ruff.lint.mccabe]
max-complexity = 20
[tool.ruff.lint.pycodestyle]
# Technically this is 120, but black has a policy of "1 or 2 over is fine if it is tidier", so we have to raise this.
max-line-length = 130
[tool.ruff.lint.pydocstyle]
convention = "numpy"
[tool.ruff.lint.pylint]
max-args = 12
max-branches = 15
max-returns = 10
[tool.slotscheck]
strict-imports = true
require-superclass = true
require-subclass = true
[tool.uv]
reinstall-package = ["alluka"]