Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
267 lines (248 loc) · 9.3 KB
/
Copy pathpyproject.toml
File metadata and controls
267 lines (248 loc) · 9.3 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
[project]
name = "temporalio"
version = "1.36.0"
description = "Temporal.io Python SDK"
authors = [{ name = "Temporal Technologies Inc", email = "sdk@temporal.io" }]
requires-python = ">=3.11"
readme = "README.md"
license = "MIT"
license-files = ["LICENSE"]
keywords = ["temporal", "workflow"]
dependencies = [
"nexus-rpc==1.5.0",
"protobuf>=4.21.12,<8.0.0",
"types-protobuf>=4.24,<8.0.0",
"typing-extensions>=4.2.0,<5",
]
classifiers = [
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Programming Language :: Python :: 3.15",
]
[project.optional-dependencies]
grpc = ["grpcio>=1.49.1,<2"]
opentelemetry = ["opentelemetry-api>=1.26,<2", "opentelemetry-sdk>=1.26,<2"]
pydantic = ["pydantic>=2.0.0,<3"]
openai-agents = ["temporalio-openai-agents>=1.0.0"]
google-adk = ["temporalio-google-adk[mcp]>=0.0.1"]
langgraph = ["temporalio-langgraph>=0.1.0"]
langsmith = ["temporalio-langsmith>=0.1.1"]
deepagents = ["temporalio-deepagents>=0.0.1"]
lambda-worker-otel = [
"opentelemetry-api>=1.26,<2",
"opentelemetry-sdk>=1.26,<2",
"opentelemetry-exporter-otlp-proto-grpc>=1.11.1,<2",
"opentelemetry-semantic-conventions>=0.40b0,<1",
"opentelemetry-sdk-extension-aws>=2.0.0,<3",
]
cloud-run-worker-otel = [
"opentelemetry-api>=1.26,<2",
"opentelemetry-sdk>=1.26,<2",
"opentelemetry-exporter-otlp-proto-grpc>=1.11.1,<2",
# Keep dependency upgrades from selecting an older OTLP exporter solely
# because its protobuf constraint permits version 7.
"protobuf<7",
]
aioboto3 = ["aioboto3>=10.4.0", "types-aioboto3[s3]>=10.4.0"]
gcloud-aio-storage = ["gcloud-aio-storage>=9.6.4,<10"]
google-genai = ["temporalio-google-genai[mcp]>=0.1.0"]
strands-agents = ["temporalio-strands-agents>=0.1.0"]
[project.urls]
Homepage = "https://github.com/temporalio/sdk-python"
Repository = "https://github.com/temporalio/sdk-python"
Documentation = "https://docs.temporal.io/docs/python"
"Bug Tracker" = "https://github.com/temporalio/sdk-python/issues"
[dependency-groups]
dev = [
"basedpyright==1.34.0",
"cibuildwheel>=2.22.0,<3",
"cryptography>=46",
"mypy==2.4.0",
"psutil>=5.9.3,<6",
"pydocstyle>=6.3.0,<7",
"pydoctor>=25.10.1,<26",
"pyright==1.1.414",
# pytest-asyncio 0.21 relies on pytest internals removed in 9.2.
"pytest>=9.0,<9.2",
"pytest-asyncio>=0.21,<0.22",
"pytest-timeout~=2.2",
"ruff>=0.15.12,<0.16",
"toml>=0.10.2,<0.11",
"tomlkit>=0.13,<0.14",
"twine>=4.0.1,<5",
"maturin>=1.8.2",
"temporalio-openai-agents>=1.0.0",
"pytest-cov>=6.1.1",
"httpx>=0.28.1",
"pytest-pretty>=1.3.0",
"googleapis-common-protos>=1.75.0,<2",
"pytest-rerunfailures>=16.1",
"pytest-xdist>=3.6,<4",
"moto[s3,server]>=5",
"setuptools<82",
"opentelemetry-exporter-otlp-proto-grpc>=1.11.1,<2",
"opentelemetry-semantic-conventions>=0.40b0,<1",
"opentelemetry-sdk-extension-aws>=2.0.0,<3",
"pytest-flakefinder>=1.1.0",
]
[tool.poe.tasks]
build-develop = "uv run maturin develop --uv"
build-develop-with-release = { cmd = "uv run maturin develop --release --uv" }
# FIPS builds: swap the rustls stack onto aws-lc-rs FIPS mode (aws-lc-fips-sys), eliminating `ring`.
build-develop-fips = { cmd = "uv run maturin develop --uv --no-default-features --features fips", env = { TEMPORALIO_FIPS = "1" } }
build-wheel-fips = { cmd = "uv run maturin build --release --no-default-features --features fips", env = { TEMPORALIO_FIPS = "1" } }
format = [
{ cmd = "uv run ruff check --select I --fix" },
{ cmd = "uv run ruff format" },
{ cmd = "cargo fmt", cwd = "temporalio/bridge" },
]
gen-docs = "uv run scripts/gen_docs.py"
gen-nexus-system-api = "uv run scripts/gen_nexus_system_api.py"
gen-protos = [
{ cmd = "uv run --locked scripts/gen_protos.py" },
{ ref = "gen-nexus-system-api" },
{ cmd = "uv run scripts/gen_payload_visitor.py" },
{ cmd = "uv run scripts/gen_bridge_client.py" },
{ ref = "format" },
]
lint = [
{ cmd = "uv run ruff check --select I" },
{ cmd = "uv run ruff format --check" },
{ ref = "lint-types" },
{ ref = "lint-docs" },
]
bridge-lint = { cmd = "cargo clippy -- -D warnings", cwd = "temporalio/bridge" }
# TODO(cretz): Why does pydocstyle complain about @overload missing docs after
# https://github.com/PyCQA/pydocstyle/pull/511?
lint-docs = "uv run pydocstyle --ignore-decorators=overload"
lint-types = [
{ cmd = "uv run pyright" },
{ cmd = "uv run mypy --namespace-packages --check-untyped-defs ." },
{ cmd = "uv run basedpyright --project basedpyrightconfig.json" },
]
run-bench = "uv run python scripts/run_bench.py"
test = "uv run pytest -n auto --dist=worksteal"
update-core = { cmd = "uv run python scripts/update_core.py", help = "Update Core, import changelog fragments, and refresh bridge dependencies" }
[tool.pytest.ini_options]
asyncio_mode = "auto"
# Do not use log_cli since this shows logging for all tests, not just the ones
# that failed. Instead, show all logs for failed tests at the end.
log_level = "DEBUG"
log_format = "%(asctime)s [%(levelname)8s] %(message)s (%(filename)s:%(lineno)s)"
testpaths = ["tests"]
timeout = 60
timeout_func_only = true
filterwarnings = [
"error::temporalio.workflow.UnfinishedUpdateHandlersWarning",
"error::temporalio.workflow.UnfinishedSignalHandlersWarning",
"ignore::pytest.PytestDeprecationWarning",
"ignore::DeprecationWarning",
]
[tool.cibuildwheel]
before-all = "pip install protoc-wheel-0"
build = "cp311-win_amd64 cp311-manylinux_x86_64 cp311-manylinux_aarch64 cp311-musllinux_x86_64 cp311-musllinux_aarch64 cp311-macosx_x86_64 cp311-macosx_arm64"
build-verbosity = 1
[tool.cibuildwheel.macos]
environment = { MACOSX_DEPLOYMENT_TARGET = "10.12" }
[tool.cibuildwheel.linux]
before-all = "sh scripts/cibuildwheel_before_all_linux.sh"
before-build = "sh scripts/cibuildwheel_before_build_linux.sh"
environment = { PATH = "$PATH:$HOME/.cargo/bin", CARGO_NET_GIT_FETCH_WITH_CLI = "true" }
[[tool.cibuildwheel.overrides]]
select = "*musllinux*"
environment = { PATH = "$PATH:$HOME/.cargo/bin", CARGO_NET_GIT_FETCH_WITH_CLI = "true", RUSTFLAGS = "-C target-feature=-crt-static" }
[tool.mypy]
ignore_missing_imports = true
exclude = [
# Ignore generated code
'temporalio/api',
'temporalio/bridge/proto',
'temporalio/nexus/system/workflow_service',
]
[[tool.mypy.overrides]]
module = "temporalio.nexus.system.workflow_service.*"
ignore_errors = true
[tool.pydocstyle]
convention = "google"
# https://github.com/PyCQA/pydocstyle/issues/363#issuecomment-625563088
match_dir = "^(?!(docs|scripts|tests|api|proto|system|_support|notifications|\\.)).*"
add_ignore = [
# We like to wrap at a certain number of chars, even long summary sentences.
# https://github.com/PyCQA/pydocstyle/issues/184
"D205",
"D415",
]
[tool.pydoctor]
add-package = ["temporalio"]
docformat = "google"
html-output = "build/apidocs"
html-viewsource-base = "https://github.com/temporalio/sdk-python/tree/main"
intersphinx = [
"https://docs.python.org/3/objects.inv",
"https://googleapis.dev/python/protobuf/latest/objects.inv",
"https://opentelemetry-python.readthedocs.io/en/latest/objects.inv",
"https://nexus-rpc.github.io/sdk-python/objects.inv",
]
privacy = [
"PRIVATE:temporalio.bridge",
"PRIVATE:temporalio.types",
"PRIVATE:temporalio.worker.workflow_sandbox.restrictions",
"PRIVATE:temporalio.worker.workflow_sandbox.runner",
"HIDDEN:temporalio.testing.activity",
"HIDDEN:temporalio.testing.workflow",
"HIDDEN:temporalio.worker.activity",
"HIDDEN:temporalio.worker.interceptor",
"HIDDEN:temporalio.worker.worker",
"HIDDEN:temporalio.worker.workflow",
"HIDDEN:temporalio.worker.workflow_instance",
"HIDDEN:temporalio.worker.workflow_sandbox.importer",
"HIDDEN:temporalio.worker.workflow_sandbox.in_sandbox",
"HIDDEN:**.*_pb2*",
]
project-name = "Temporal Python"
sidebar-expand-depth = 2
warnings-as-errors = true
[tool.pyright]
enableTypeIgnoreComments = true
reportCallInDefaultInitializer = "none"
reportImplicitOverride = "none"
reportImplicitStringConcatenation = "none"
reportImportCycles = "none"
reportMissingTypeArgument = "none"
reportPrivateUsage = "none"
reportUnknownArgumentType = "none"
reportUnknownMemberType = "none"
reportUnknownParameterType = "none"
reportUnknownVariableType = "none"
reportUnnecessaryIsInstance = "none"
reportUnnecessaryTypeIgnoreComment = "none"
reportUnusedCallResult = "none"
reportUnknownLambdaType = "none"
include = ["temporalio", "tests"]
exclude = [
# Exclude auto generated files
"temporalio/api",
"temporalio/bridge/proto",
"temporalio/bridge/_visitor.py",
"tests/worker/workflow_sandbox/testmodules/proto",
]
[tool.ruff]
target-version = "py311"
[build-system]
requires = ["maturin>=1.0,<2.0"]
build-backend = "maturin"
[tool.maturin]
manifest-path = "temporalio/bridge/Cargo.toml"
module-name = "temporalio.bridge.temporal_sdk_bridge"
python-packages = ["temporalio"]
include = ["LICENSE"]
exclude = ["temporalio/bridge/target/**/*", "temporalio/bridge/sdk-core/.git"]
[tool.uv]
# Prevent uv commands from building the package by default
package = false
exclude-newer = "2 weeks"
# Nexus and the SDK compatibility extras need newly published releases.
exclude-newer-package = { nexus-rpc = false, temporalio-deepagents = false, temporalio-google-adk = false, temporalio-google-genai = false, temporalio-langgraph = false, temporalio-langsmith = false, temporalio-strands-agents = false }