-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpyproject.toml
More file actions
347 lines (309 loc) · 9.16 KB
/
pyproject.toml
File metadata and controls
347 lines (309 loc) · 9.16 KB
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
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
[build-system]
requires = ["uv_build>=0.10.7,<0.11.0"]
build-backend = "uv_build"
[project]
name = "waku"
version = "0.34.1"
description = "Python framework for backends that grow"
readme = "README.md"
license = "MIT"
keywords = ["architecture", "modular", "decoupled", "framework", "dishka", "ioc", "di", "cqrs", "eventstore", "eventsourcing"]
authors = [
{ name = "Daniil Kharkov", email = "fadeddexofan@gmail.com" },
{ name = "Doctor", email = "thirvondukr@gmail.com" },
]
requires-python = ">=3.11"
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Topic :: Software Development :: Libraries",
"Topic :: Software Development :: Libraries :: Application Frameworks",
"Typing :: Typed",
]
dependencies = [
"anyio>=4.7.0",
"dishka>=1.8.0",
"typing-extensions>=4.12.2",
]
[project.optional-dependencies]
eventsourcing = ["adaptix>=3.0.0b11"]
eventsourcing-sqla = ["waku[eventsourcing]", "sqlalchemy[asyncio]>=2"]
[project.urls]
Repository = "https://github.com/waku-py/waku"
Documentation = "https://docs.wakupy.dev/"
Changelog = "https://github.com/waku-py/waku/blob/master/CHANGELOG.md"
Issues = "https://github.com/waku-py/waku/issues"
[dependency-groups]
dev = [
"pysentry-rs==0.4.3",
]
docs = [
"mkdocstrings[python]>=1.0.3",
"pymdown-extensions>=10.21",
"zensical>=0.0.24",
]
lint = [
"deptry==0.24.0",
"gitlint==0.19.1",
"prek==0.3.4",
"ruff==0.15.4",
]
test = [
"coverage==7.13.4",
"psycopg[binary]>=3.3.3",
"pytest==9.0.2",
"pytest-clarity==1.0.1",
"pytest-cov==7.0.0",
"pytest-deadfixtures==3.1.0",
"pytest-mock==3.15.1",
"pytest-randomly==4.0.1",
"pytest-timeout==2.4.0",
"sqlalchemy[asyncio]>=2.0.47",
"testcontainers[postgres]>=4.14.1",
"uvloop==0.22.1; sys_platform != 'win32' and python_version < '3.14'",
]
typecheck = [
"mypy==1.19.1",
"pyrefly==0.55.0",
"ty==0.0.20",
]
# ----- UV settings -----
[tool.uv]
default-groups = "all"
required-version = ">=0.10.7"
override-dependencies = ["click>=8.3.1"]
# ----- Pytest settings -----
[tool.pytest.ini_options]
xfail_strict = true
norecursedirs = ".* docs examples site __pycache__"
disable_test_id_escaping_and_forfeit_all_rights_to_community_support = true
addopts = [
"--doctest-modules",
"--strict-markers",
"--strict-config",
"--cov-fail-under=96",
]
# pytest-timeout settings
timeout = 15
session_timeout = 100
# ----- Coverage settings -----
[tool.coverage.run]
branch = true
source = ["src", "tests"]
omit = ["*__dishka_factory_*"]
[tool.coverage.report]
show_missing = true
skip_covered = true
omit = ["*__dishka_factory_*"]
exclude_also = [
"def __repr__",
"raise AssertionError",
"raise NotImplementedError",
"if (?:t(yping)?\\.)?TYPE_CHECKING:",
"@(?:t(yping)?\\.)?overload",
"@(abc\\.)?abstractmethod",
"class .*\\(.*\\bProtocol\\b.*\\):",
"(?:t(yping)?\\.)?assert_never",
]
# ----- Ruff settings -----
[tool.ruff]
unsafe-fixes = true
show-fixes = true
line-length = 120
target-version = "py311"
extend-exclude = ["pyproject.toml"]
[tool.ruff.lint]
preview = true
extend-select = ["ALL"]
ignore = [
"A005", # Module is shadowing a Python builtin module
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed
"COM812", # Trailing comma missing. Conflicts with ruff format
"CPY", # flake8-copyright
"D1", # All 1xx pydocstyle codes
"D203", # 1 blank line required before class docstring
"D213", # Multi-line docstring summary should start at the second line
"DOC201", # `return` is not documented in docstring
"DOC502", # Raised exception is not explicitly raised
"E501", # Never enforce line length
"ISC001", # Implicitly concatenated string literals on one line. Conflicts with ruff format
"RET504", # Unnecessary variable assignment before `return` statement
"RUF001", # ruff unicode specific rules
"RUF002", # ruff unicode specific rules
"RUF003", # ruff unicode specific rules
"TD", # flake8-todos
"TRY003", # Duplicates EM101 warning
]
unfixable = [
"B", # Avoid trying to fix flake8-bugbear violations.
"ERA", # Avoid deleting commented-out code
]
flake8-quotes = { inline-quotes = "single", multiline-quotes = "double" }
mccabe = { max-complexity = 10 }
pydocstyle = { convention = "google" }
pylint = { max-args = 7 }
[tool.ruff.lint.per-file-ignores]
"docs/code/*" = [
"ARG001", # Unused function argument
"ARG002", # Unused method argument
"I001", # Import block is un-sorted or un-formatted
"INP001", # File is part of an implicit namespace package
"PLR2004", # Magic value used in comparison
"PLR6301", # Method could be a function, class method, or static method
"RUF029", # Function is declared async but doesn't use async features
"S101", # Usage of assert
"SIM117", # Multiple with-statements should be combined
"TC001",
"T201", # `print` found
]
"examples/*" = [
"ARG001", # Unused function argument
"INP001", # File is part of an implicit namespace package
"PLR6301", # Method could be a function, class method, or static method
"RUF029", # Function is declared async but doesn't use async features
"S101", # Usage of assert
"SIM117", # Multiple with-statements should be combined
"T201", # `print` found
"TRY400", # Use `logging.exception` instead of `logging.error
]
"tests/*" = [
"FBT001", # Boolean-typed positional argument in function definition
"N806", # Variable in function should be lowercase
"PLR2004", # Magic value comparison
"RUF069", # Unreliable floating point equality comparison
"S101", # Usage of assert
"S311", # Usage of non-cryptographic random
"TRY002", # Raise Exception or BaseException directly
]
[tool.ruff.lint.flake8-tidy-imports]
ban-relative-imports = "all"
[tool.ruff.lint.isort]
force-wrap-aliases = true
combine-as-imports = true
section-order = [
"future",
"standard-library",
"third-party",
"first-party",
"tests",
"local-folder",
]
[tool.ruff.lint.isort.sections]
tests = ["tests"]
[tool.ruff.format]
preview = true
quote-style = "single"
docstring-code-format = true
# ----- Deptry settings -----
[tool.deptry]
extend_exclude = ["docs"]
known_first_party = ["waku"]
[tool.deptry.per_rule_ignores]
DEP002 = ["psycopg", "waku"]
DEP004 = ["gitlint", "pytest", "sqlalchemy"]
# ----- Mypy settings -----
[tool.mypy]
# Mypy configuration:
# https://mypy.readthedocs.io/en/latest/config_file.html
exclude = [
"benchmarks",
"docs/code/eventsourcing",
"docs/code/getting_started",
"docs/code/integrations",
"docs/code/providers",
]
exclude_gitignore = true
follow_imports = "normal"
allow_redefinition = false
allow_redefinition_new = true
# Any is 'ok' as long as it is a wildcard
disallow_any_explicit = false
ignore_errors = false
ignore_missing_imports = false
implicit_reexport = false
local_partial_types = true
strict = true
strict_optional = true
show_error_codes = true
no_implicit_optional = true
warn_unreachable = true
warn_no_return = true
[[tool.mypy.overrides]]
module = "gitlint.*"
ignore_missing_imports = true
# ----- ty settings -----
[tool.ty.environment]
python = "./.venv"
python-version = "3.11"
[tool.ty.src]
exclude = [
"docs/code/eventsourcing",
"docs/code/getting_started",
"docs/code/integrations",
"docs/code/providers",
]
[tool.ty.rules]
unused-type-ignore-comment = "ignore"
# ----- Semantic release settings -----
[tool.semantic_release]
build_command = """
command -v uv 2>/dev/null || pip install uv==0.10.7
uv lock --upgrade-package "$PACKAGE_NAME"
git add uv.lock
uv build
"""
assets = []
commit_message = "chore(release): {version} [skip ci]"
commit_parser = "conventional"
logging_use_named_masks = true
major_on_zero = false
allow_zero_version = true
version_toml = ["pyproject.toml:project.version"]
tag_format = "v{version}"
[tool.semantic_release.branches.main]
match = "(master|main)"
prerelease = false
prerelease_token = "rc"
[tool.semantic_release.branches.other]
match = ".*"
prerelease = true
prerelease_token = "dev"
[tool.semantic_release.changelog]
mode = "update"
insertion_flag = "<!-- version list -->"
template_dir = "config/release-templates"
exclude_commit_patterns = [
'''Merged? .*''',
'''build\((?!deps\): .+)''',
'''chore(?:\([^)]*?\))?: .+''',
'''ci(?:\([^)]*?\))?: .+''',
'''refactor(?:\([^)]*?\))?: .+''',
'''style(?:\([^)]*?\))?: .+''',
'''test(?:\([^)]*?\))?: .+''',
]
[tool.semantic_release.changelog.environment]
autoescape = true
[tool.semantic_release.commit_author]
env = "GIT_COMMIT_AUTHOR"
default = "semantic-release <semantic-release>"
[tool.semantic_release.commit_parser_options]
# Also used in `gitlint_plugins.py` for allowed commit types check
allowed_tags = ["build", "chore", "ci", "docs", "feat", "fix", "perf", "style", "refactor", "test"]
minor_tags = ["feat"]
patch_tags = ["fix", "perf"]
default_bump_level = 0
parse_squash_commits = true
ignore_merge_commits = true
[tool.semantic_release.remote]
name = "origin"
type = "github"
[tool.semantic_release.publish]
upload_to_vcs_release = true