-
Notifications
You must be signed in to change notification settings - Fork 147
Expand file tree
/
Copy pathpyproject.toml
More file actions
213 lines (194 loc) · 6.38 KB
/
Copy pathpyproject.toml
File metadata and controls
213 lines (194 loc) · 6.38 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
[project]
name = "dapr"
dynamic = ["version"]
description = "The official release of Dapr Python SDK."
readme = "README.md"
requires-python = ">=3.10"
license = {text = "Apache-2.0"}
authors = [{name = "Dapr Authors", email = "dapr@dapr.io"}]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
]
dependencies = [
"protobuf>=4.22.5,<8.0.0",
"grpcio>=1.76.0,<2.0.0",
"grpcio-status>=1.76.0,<2.0.0",
"aiohttp>=3.9.5,<4.0.0",
"python-dateutil>=2.8.1,<3.0.0",
"typing-extensions>=4.4.0,<5.0.0",
]
[project.optional-dependencies]
fastapi = [
"fastapi>=0.60.1,<1.0.0",
"uvicorn>=0.11.6,<1.0.0",
]
flask = [
"Flask>=1.1.4,<4.0.0",
]
grpc = [
"cloudevents>=1.0.0,<2.0.0",
]
langgraph = [
"langgraph>=0.3.6,<2.0.0",
"langchain>=0.1.17,<2.0.0",
"python-ulid>=3.0.0,<4.0.0",
"msgpack>=1.0,<2.0",
]
strands = [
"strands-agents>=1.30.0,<2.0.0",
"python-ulid>=3.0.0,<4.0.0",
"msgpack>=1.0,<2.0",
]
# workflow has no third-party runtime deps beyond core dapr. The empty extra
# exists so users get a consistent `pip install dapr[<ext>]` shape and so the
# extra is reserved if workflow ever grows external deps.
workflow = []
all = ["dapr[fastapi,flask,grpc,langgraph,strands,workflow]"]
[project.urls]
Documentation = "https://github.com/dapr/docs"
Source = "https://github.com/dapr/python-sdk"
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.version]
source = "regex"
path = "VERSION"
pattern = '(?P<version>\S+)'
[tool.hatch.build.targets.wheel]
# IMPORTANT: do NOT introduce dapr/ext/__init__.py. `dapr.ext` is kept as an
# implicit PEP 420 namespace package so external plugins can publish their own
# distributions under `dapr.ext.*` without colliding with this wheel's
# `RECORD`. Materialising `dapr/ext/__init__.py` here would lock out every
# future externally-published dapr.ext.* plugin by claiming ownership of the
# namespace parent.
# TODO: drop flask_dapr in 1.22 (with the shim).
packages = ["dapr", "flask_dapr"]
# Repo-internal docs (contributor / AI-agent guidance) live next to the code
# for discoverability but should not ship in the published wheel.
exclude = [
"**/AGENTS.md",
"dapr/ext/*/README.md",
]
# No workspace members. Before the bundling, each extension was a separate
# workspace package under ext/. Now all extension code lives in the core
# `dapr` package and is opt-in via [project.optional-dependencies].
[tool.uv.workspace]
members = []
[dependency-groups]
dev = [
# Pull in every extension's third-party deps so the full test suite runs
# in the dev env. `dapr` here resolves to this workspace project itself,
# so `dapr[all]` activates every extras list declared above.
"dapr[all]",
"mypy==1.20.2",
"mypy-extensions~=1.1.0",
"mypy-protobuf==5.0.0",
"grpcio-tools==1.76.0",
"types-python-dateutil~=2.9.0",
"types-grpcio-status~=1.0.0",
"coverage>=7.13.4,<7.15.0",
"wheel~=0.46.3",
"opentelemetry-sdk>=1.40,<1.42",
"opentelemetry-instrumentation-grpc~=0.61b0",
"opentelemetry-exporter-zipkin~=1.11.1",
"httpx~=0.28.1",
"pyOpenSSL~=26.0.0",
"cryptography>=42.0.0",
"redis>=7.4.0",
"Flask~=3.1.3",
"pytest~=9.0.2",
"pytest-asyncio>=0.23",
"ruff==0.14.1",
"python-dotenv~=1.2.2",
"pydantic~=2.13.3",
"PyYAML~=6.0.3",
]
tests = [
{include-group = "dev"},
"mechanical-markdown~=0.8.0",
"langchain-ollama>=1.0.1,<1.2.0",
]
[tool.ruff]
target-version = "py310"
line-length = 100
fix = true
extend-exclude = [".github", "dapr/proto", "dapr/ext/workflow/_durabletask/internal/*_pb2*"]
# Honor extend-exclude even when ruff is invoked with explicit file paths
# (pre-commit hooks, lint-staged, manual debugging). Without this, ruff would
# happily lint and "fix" the generated `*_pb2.py` stubs and strip the
# `import attestation_pb2` lines that the protobuf descriptor pool needs.
force-exclude = true
[tool.ruff.lint]
select = [
"I", # isort
"W", # pycodestyle warnings
"F", # pyflakes
"E", # pycodestyle errors
# TODO: Add those back progressively as we fix the issues
# "C", # flake8-comprehensions
# "B", # flake8-bugbear
# "UP", # pyupgrade
]
# TODO: Add those back progressively as we fix the issues
ignore = ["E501", "E203", "E712", "E722", "E713"]
[tool.ruff.lint.isort]
# Extensions now live inside the core `dapr` wheel, so `dapr` and the
# `flask_dapr` shim are first-party, not third-party imports.
known-first-party = ["dapr", "flask_dapr"]
# Without this, same-package autodetection on files under `dapr/ext/*` keeps
# `dapr` in the third-party group, so the first-party setting above never
# takes effect for the bundled extensions.
detect-same-package = false
[tool.ruff.format]
quote-style = 'single'
[tool.mypy]
python_version = "3.10"
install_types = true
non_interactive = true
warn_unused_configs = true
warn_redundant_casts = true
show_error_codes = true
check_untyped_defs = true
namespace_packages = true
packages = [
"dapr",
"flask_dapr",
]
[[tool.mypy.overrides]]
module = ["dapr.proto.*"]
ignore_errors = true
[[tool.mypy.overrides]]
module = ["grpc.aio"]
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = ["langgraph.*", "langchain.*", "strands.*", "strands_agents.*"]
ignore_missing_imports = true
# Bundling the extensions into the core wheel brings their source under mypy's
# namespace walk for the first time. These modules carry pre-existing type
# errors that were previously hidden by the separate-workspace-package layout.
# Ignored here to keep this packaging PR scope-limited; clean up in a follow-up.
# TODO: drop these overrides as each module's type errors are fixed.
[[tool.mypy.overrides]]
module = [
"dapr.ext.fastapi.*",
"dapr.ext.langgraph.*",
"dapr.ext.strands.*",
"dapr.ext.workflow.*",
]
ignore_errors = true
[tool.pytest.ini_options]
markers = [
'example_dir(name): set the example directory for the dapr fixture',
'perf: timing-sensitive dispatch regression tests',
]
pythonpath = ["."]
asyncio_mode = "auto"