Skip to content

Commit a971dcf

Browse files
committed
add call to cargo fmt after generation. Move generated python services to a generated directory to allow pydocstyle exclusion. Add linter ignore rule on tests/worker/test_workflow.py:4840 to avoid a linter rule about method assignment.
1 parent aa1fff8 commit a971dcf

File tree

11 files changed

+966
-688
lines changed

11 files changed

+966
-688
lines changed

pyproject.toml

Lines changed: 44 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -6,29 +6,23 @@ authors = [{ name = "Temporal Technologies Inc", email = "sdk@temporal.io" }]
66
requires-python = ">=3.9"
77
readme = "README.md"
88
license = { file = "LICENSE" }
9-
keywords = [
10-
"temporal",
11-
"workflow",
12-
]
9+
keywords = ["temporal", "workflow"]
1310
dependencies = [
14-
"nexus-rpc==1.1.0",
15-
"protobuf>=3.20,<7.0.0",
16-
"python-dateutil>=2.8.2,<3 ; python_version < '3.11'",
17-
"types-protobuf>=3.20",
18-
"typing-extensions>=4.2.0,<5",
11+
"nexus-rpc==1.1.0",
12+
"protobuf>=3.20,<7.0.0",
13+
"python-dateutil>=2.8.2,<3 ; python_version < '3.11'",
14+
"types-protobuf>=3.20",
15+
"typing-extensions>=4.2.0,<5",
1916
]
2017

2118
[project.optional-dependencies]
2219
grpc = ["grpcio>=1.48.2,<2"]
23-
opentelemetry = [
24-
"opentelemetry-api>=1.11.1,<2",
25-
"opentelemetry-sdk>=1.11.1,<2",
26-
]
20+
opentelemetry = ["opentelemetry-api>=1.11.1,<2", "opentelemetry-sdk>=1.11.1,<2"]
2721
pydantic = ["pydantic>=2.0.0,<3"]
2822
openai-agents = [
29-
"openai-agents>=0.3,<0.4",
30-
"eval-type-backport>=0.2.2; python_version < '3.10'",
31-
"mcp>=1.9.4, <2; python_version >= '3.10'",
23+
"openai-agents>=0.3,<0.4",
24+
"eval-type-backport>=0.2.2; python_version < '3.10'",
25+
"mcp>=1.9.4, <2; python_version >= '3.10'",
3226
]
3327

3428
[project.urls]
@@ -39,48 +33,50 @@ Documentation = "https://docs.temporal.io/docs/python"
3933

4034
[dependency-groups]
4135
dev = [
42-
"cibuildwheel>=2.22.0,<3",
43-
"grpcio-tools>=1.48.2,<2",
44-
"mypy==1.4.1",
45-
"mypy-protobuf>=3.3.0,<4",
46-
"psutil>=5.9.3,<6",
47-
"pydocstyle>=6.3.0,<7",
48-
"pydoctor>=24.11.1,<25",
49-
"pyright==1.1.403",
50-
"pytest~=7.4",
51-
"pytest-asyncio>=0.21,<0.22",
52-
"pytest-timeout~=2.2",
53-
"ruff>=0.5.0,<0.6",
54-
"toml>=0.10.2,<0.11",
55-
"twine>=4.0.1,<5",
56-
"ruff>=0.5.0,<0.6",
57-
"maturin>=1.8.2",
58-
"pytest-cov>=6.1.1",
59-
"httpx>=0.28.1",
60-
"pytest-pretty>=1.3.0",
61-
"openai-agents[litellm]>=0.3,<0.4"
36+
"cibuildwheel>=2.22.0,<3",
37+
"grpcio-tools>=1.48.2,<2",
38+
"mypy==1.4.1",
39+
"mypy-protobuf>=3.3.0,<4",
40+
"psutil>=5.9.3,<6",
41+
"pydocstyle>=6.3.0,<7",
42+
"pydoctor>=24.11.1,<25",
43+
"pyright==1.1.403",
44+
"pytest~=7.4",
45+
"pytest-asyncio>=0.21,<0.22",
46+
"pytest-timeout~=2.2",
47+
"ruff>=0.5.0,<0.6",
48+
"toml>=0.10.2,<0.11",
49+
"twine>=4.0.1,<5",
50+
"maturin>=1.8.2",
51+
"pytest-cov>=6.1.1",
52+
"httpx>=0.28.1",
53+
"pytest-pretty>=1.3.0",
54+
"openai-agents[litellm]>=0.3,<0.4",
6255
]
6356

6457
[tool.poe.tasks]
6558
build-develop = "uv run maturin develop --uv"
6659
build-develop-with-release = { cmd = "uv run maturin develop --release --uv" }
67-
format = [{cmd = "uv run ruff check --select I --fix"}, {cmd = "uv run ruff format"}, ]
60+
format = [
61+
{ cmd = "uv run ruff check --select I --fix" },
62+
{ cmd = "uv run ruff format" },
63+
]
6864
gen-docs = "uv run scripts/gen_docs.py"
6965
gen-protos = "uv run scripts/gen_protos.py"
7066
gen-protos-docker = "uv run scripts/gen_protos_docker.py"
7167
lint = [
72-
{cmd = "uv run ruff check --select I"},
73-
{cmd = "uv run ruff format --check"},
74-
{ref = "lint-types"},
75-
{ref = "lint-docs"},
68+
{ cmd = "uv run ruff check --select I" },
69+
{ cmd = "uv run ruff format --check" },
70+
{ ref = "lint-types" },
71+
{ ref = "lint-docs" },
7672
]
7773
bridge-lint = { cmd = "cargo clippy -- -D warnings", cwd = "temporalio/bridge" }
7874
# TODO(cretz): Why does pydocstyle complain about @overload missing docs after
7975
# https://github.com/PyCQA/pydocstyle/pull/511?
8076
lint-docs = "uv run pydocstyle --ignore-decorators=overload"
8177
lint-types = [
82-
{ cmd = "uv run pyright"},
83-
{ cmd = "uv run mypy --namespace-packages --check-untyped-defs ."},
78+
{ cmd = "uv run pyright" },
79+
{ cmd = "uv run mypy --namespace-packages --check-untyped-defs ." },
8480
]
8581
run-bench = "uv run python scripts/run_bench.py"
8682
test = "uv run pytest"
@@ -120,17 +116,18 @@ ignore_missing_imports = true
120116
exclude = [
121117
# Ignore generated code
122118
'temporalio/api',
123-
'temporalio/bridge/proto'
119+
'temporalio/bridge/proto',
124120
]
125121

126122
[tool.pydocstyle]
127123
convention = "google"
128124
# https://github.com/PyCQA/pydocstyle/issues/363#issuecomment-625563088
129-
match_dir = "^(?!(docs|scripts|tests|api|proto|\\.)).*"
125+
match_dir = "^(?!(docs|scripts|tests|api|proto|generated|\\.)).*"
130126
add_ignore = [
131127
# We like to wrap at a certain number of chars, even long summary sentences.
132128
# https://github.com/PyCQA/pydocstyle/issues/184
133-
"D205", "D415"
129+
"D205",
130+
"D415",
134131
]
135132

136133
[tool.pydoctor]
@@ -226,9 +223,7 @@ manifest-path = "temporalio/bridge/Cargo.toml"
226223
module-name = "temporalio.bridge.temporal_sdk_bridge"
227224
python-packages = ["temporalio"]
228225
include = ["LICENSE"]
229-
exclude = [
230-
"temporalio/bridge/target/**/*",
231-
]
226+
exclude = ["temporalio/bridge/target/**/*"]
232227

233228
[tool.uv]
234229
# Prevent uv commands from building the package by default

scripts/gen_bridge_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
def generate_python_services(
1919
file_descriptors: list[FileDescriptor],
20-
output_file: str = "temporalio/bridge/services_generated.py",
20+
output_file: str = "temporalio/bridge/generated/services_generated.py",
2121
):
2222
print("generating python services")
2323

scripts/gen_protos_docker.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,9 @@
4242
)
4343

4444
subprocess.run(["uv", "run", "poe", "format"], check=True)
45+
46+
subprocess.run(
47+
["cargo", "fmt"],
48+
check=True,
49+
cwd=os.path.join(os.getcwd(), "temporalio", "bridge"),
50+
)
File renamed without changes.

0 commit comments

Comments
 (0)