forked from temporalio/sdk-python
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpyproject.toml
204 lines (187 loc) · 6.32 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
[project]
name = "temporalio"
version = "1.10.0"
description = "Temporal.io Python SDK"
authors = [{ name = "Temporal Technologies Inc", email = "[email protected]" }]
requires-python = "~=3.9"
readme = "README.md"
license = { file = "LICENSE" }
keywords = [
"temporal",
"workflow",
]
dependencies = [
"protobuf>=3.20",
"python-dateutil>=2.8.2,<3 ; python_version < '3.11'",
"types-protobuf>=3.20",
"typing-extensions>=4.2.0,<5",
]
[project.optional-dependencies]
grpc = ["grpcio>=1.48.2,<2"]
opentelemetry = [
"opentelemetry-api>=1.11.1,<2",
"opentelemetry-sdk>=1.11.1,<2",
]
pydantic = ["pydantic>=2.0.0,<3"]
[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 = [
"cibuildwheel>=2.22.0,<3",
"grpcio-tools>=1.48.2,<2",
"mypy==1.4.1",
"mypy-protobuf>=3.3.0,<4",
"psutil>=5.9.3,<6",
"pydocstyle>=6.3.0,<7",
"pydoctor>=24.11.1,<25",
"pyright==1.1.377",
"pytest~=7.4",
"pytest-asyncio>=0.21,<0.22",
"pytest-timeout~=2.2",
"ruff>=0.5.0,<0.6",
"toml>=0.10.2,<0.11",
"twine>=4.0.1,<5",
"ruff>=0.5.0,<0.6",
"maturin>=1.8.2",
]
[tool.poe.tasks]
build-develop = "uv run maturin develop --uv"
build-develop-with-release = { cmd = "uv run maturin develop --release --uv" }
format = [{cmd = "uv run ruff check --select I --fix"}, {cmd = "uv run ruff format"}, ]
gen-docs = "uv run python scripts/gen_docs.py"
gen-protos = "uv run python scripts/gen_protos.py"
lint = [
{cmd = "uv run ruff check --select I"},
{cmd = "uv run ruff format --check"},
{ref = "lint-types"},
{cmd = "uv run pyright"},
{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 = "uv run mypy --namespace-packages --check-untyped-defs ."
run-bench = "uv run python scripts/run_bench.py"
test = "uv run pytest"
[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 = 600
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 = "cp39-win_amd64 cp39-manylinux_x86_64 cp39-manylinux_aarch64 cp39-macosx_x86_64 cp39-macosx_arm64"
build-verbosity = "1"
[tool.cibuildwheel.macos]
environment = { MACOSX_DEPLOYMENT_TARGET = "10.12" }
[tool.cibuildwheel.linux]
before-all = "curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain stable -y && yum install -y openssl-devel"
before-build = "pip install protoc-wheel-0"
environment = { PATH = "$PATH:$HOME/.cargo/bin", CARGO_NET_GIT_FETCH_WITH_CLI = "true" }
[tool.mypy]
ignore_missing_imports = true
exclude = [
# Ignore generated code
'temporalio/api',
'temporalio/bridge/proto'
]
[tool.pydocstyle]
convention = "google"
# https://github.com/PyCQA/pydocstyle/issues/363#issuecomment-625563088
match_dir = "^(?!(docs|scripts|tests|api|proto|\\.)).*"
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",
]
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
[tool.pyright]
include = ["temporalio", "tests"]
exclude = [
"temporalio/api",
"temporalio/bridge/proto",
"tests/worker/workflow_sandbox/testmodules/proto",
"temporalio/bridge/worker.py",
"temporalio/contrib/opentelemetry.py",
"temporalio/converter.py",
"temporalio/testing/_workflow.py",
"temporalio/worker/_activity.py",
"temporalio/worker/_replayer.py",
"temporalio/worker/_worker.py",
"temporalio/worker/workflow_sandbox/_importer.py",
"temporalio/worker/workflow_sandbox/_restrictions.py",
"temporalio/workflow.py",
"tests/api/test_grpc_stub.py",
"tests/conftest.py",
"tests/contrib/test_opentelemetry.py",
"tests/test_converter.py",
"tests/test_service.py",
"tests/test_workflow.py",
"tests/worker/test_activity.py",
"tests/worker/test_workflow.py",
"tests/worker/workflow_sandbox/test_importer.py",
"tests/worker/workflow_sandbox/test_restrictions.py",
# TODO: these pass locally but fail in CI with
# error: Import "temporalio.bridge.temporal_sdk_bridge" could not be resolved
"temporalio/bridge/client.py",
"temporalio/bridge/metric.py",
"temporalio/bridge/runtime.py",
"temporalio/bridge/testing.py",
]
[tool.ruff]
target-version = "py39"
[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/**/*",
]
[tool.uv]
# Prevent uv commands from building the package by default
package = false