-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
155 lines (143 loc) · 6.1 KB
/
Copy pathpyproject.toml
File metadata and controls
155 lines (143 loc) · 6.1 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
[project]
name = "faststream-outbox"
version = "0"
description = "FastStream transactional-outbox integration backed by a Postgres table"
authors = [
{ name = "Artur Shiriev", email = "me@shiriev.ru" },
]
readme = "README.md"
requires-python = ">=3.11,<4"
license = "MIT"
keywords = ["faststream", "outbox", "transactional-outbox", "postgresql", "messaging", "asyncio", "python"]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Programming Language :: Python :: Free Threading :: 2 - Beta",
"Typing :: Typed",
"Topic :: Software Development :: Libraries",
]
dependencies = [
"faststream>=0.7.6,<0.8",
# 2.0.31 is the first release that tolerates the __static_attributes__ and __firstlineno__
# attributes Python 3.13 added; below it SQLAlchemy's TypingOnly check fails at import. Marked,
# because 2.0 is fine on 3.11/3.12 and there is no reason to raise the floor for older
# interpreters.
"sqlalchemy[asyncio]>=2.0; python_version < '3.13'",
"sqlalchemy[asyncio]>=2.0.31; python_version == '3.13'",
# 2.0.54 is the first release whose cyextensions declare Py_MOD_GIL_NOT_USED. Below it,
# importing SQLAlchemy re-enables the GIL process-wide on a free-threaded interpreter. There is
# no marker for a free-threaded build, so ordinary 3.14 carries the same floor for a reason that
# only affects 3.14t.
"sqlalchemy[asyncio]>=2.0.54; python_version >= '3.14'",
# Not imported here: faststream pulls pydantic through fast-depends[pydantic], which allows it
# back to 1.x. FastStream's serializer calls model_dump, so publishing a model raises
# AttributeError on pydantic 1 — v2 is a real requirement of ours, not a preference. The two
# marked floors are wheel coverage: pydantic-core ships no cp313 wheel before pydantic 2.8.1
# (2.8.0 carries pydantic-core 2.20.0, which has none) and no cp314 wheel before 2.12.
# 2.0.2, not 2.0: the fastapi extra excludes 2.0.0 and 2.0.1.
"pydantic>=2.0.2; python_version < '3.13'",
"pydantic>=2.8.1; python_version == '3.13'",
"pydantic>=2.12; python_version >= '3.14'",
# 4.12.2, not 4.12.0: pydantic requires >=4.12.2 on 3.13+, and pinning 4.12.0 drags pydantic
# back to a build whose pydantic-core has no cp313 wheel either.
"typing-extensions>=4.12.2",
# pydantic 2.12, the 3.14 floor above, requires >=4.14.1.
"typing-extensions>=4.14.1; python_version >= '3.14'",
]
[project.optional-dependencies]
asyncpg = [
# asyncpg declares requires-python >=3.9 throughout but ships no cp313 wheel before 0.30 and
# no cp314/cp314t before 0.31, so a resolver picks an sdist that cannot build rather than
# reporting a conflict. Marked, because 0.29 is fine on 3.11/3.12 and there is no reason to
# raise the floor for older interpreters.
"asyncpg>=0.29; python_version < '3.13'",
"asyncpg>=0.30; python_version == '3.13'",
"asyncpg>=0.31; python_version >= '3.14'",
]
validate = ["alembic>=1.13"]
# 0.113 is the first release our FastAPI router works with; 0.112 and below raise
# "TypeError: must be called with a dataclass type or instance" building the routes.
fastapi = ["fastapi>=0.113"]
prometheus = ["prometheus-client>=0.19"]
# 1.21 added the schema_url argument to get_meter, which the telemetry middleware passes.
opentelemetry = ["opentelemetry-api>=1.21", "opentelemetry-sdk>=1.21"]
all = ["faststream-outbox[asyncpg,validate,fastapi,prometheus,opentelemetry]"]
[dependency-groups]
dev = [
"pytest>=8",
"pytest-asyncio>=0.24",
"pytest-cov>=5",
"asyncpg>=0.29; python_version < '3.13'",
"asyncpg>=0.30; python_version == '3.13'",
"asyncpg>=0.31; python_version >= '3.14'",
"alembic>=1.13",
"fastapi>=0.113",
"faststream[kafka]>=0.7.6,<0.8",
"httpx2>=2.2",
"prometheus-client>=0.19",
"opentelemetry-api>=1.21",
"opentelemetry-sdk>=1.21",
]
lint = [
"ruff",
"ty",
"eof-fixer",
]
[build-system]
requires = ["uv_build"]
build-backend = "uv_build"
[tool.uv.build-backend]
module-name = "faststream_outbox"
module-root = ""
[tool.ruff]
fix = true
unsafe-fixes = true
line-length = 120
[tool.ruff.lint]
select = ["ALL"]
ignore = [
"D1", # docstrings are not forced; a docstring exists when it says something
"D203", # conflicts with D211
"D213", # conflicts with D212
"COM812", # conflicts with the formatter
"ISC001", # conflicts with the formatter
"CPY001", # no per-file copyright header
"FBT", # boolean positional arguments are fine
"TCH", # imports stay real; TYPE_CHECKING-only imports break runtime introspection
"ANN", # typing.Any is the honest annotation at the FastStream broker boundary
]
isort.lines-after-imports = 2
isort.no-lines-before = ["standard-library", "local-folder"]
[tool.ruff.lint.pylint]
# FastStream broker/subscriber/publisher kwargs ladders are wide by design;
# raise PLR0913 (too-many-arguments) so the common 10–14 arg factories don't
# need per-site `# noqa` comments. Outliers (e.g. FastAPI router constructor
# at ~32 args) carry a localized `# noqa: PLR0913`.
max-args = 15
[tool.ruff.lint.extend-per-file-ignores]
"tests/**" = [
"S101", # allow asserts
"PLR2004", # allow magic values
]
# FastStream's LoggerProto.log takes a preformatted message and no %-args, so these three log calls are f-strings.
"faststream_outbox/message.py" = ["G004"]
[tool.pytest.ini_options]
testpaths = ["tests"]
addopts = ""
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "function"
[project.urls]
Homepage = "https://faststream-outbox.modern-python.org"
Documentation = "https://faststream-outbox.modern-python.org"
Repository = "https://github.com/modern-python/faststream-outbox"
Issues = "https://github.com/modern-python/faststream-outbox/issues"
Changelog = "https://github.com/modern-python/faststream-outbox/releases"
[tool.coverage.run]
omit = ["benchmarks/*"]
[tool.coverage.report]
fail_under = 100
exclude_also = ["if typing.TYPE_CHECKING:"]