Skip to content

Commit ffe4c74

Browse files
committed
Merge remote-tracking branch 'origin/main' into python_314_ci
2 parents c04bab9 + 4a70f3d commit ffe4c74

File tree

197 files changed

+36920
-3614
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

197 files changed

+36920
-3614
lines changed

.github/workflows/build-binaries.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
branches:
55
- main
66
- "releases/*"
7+
- fix-build-binaries
78

89
jobs:
910
# Compile the binaries and upload artifacts
@@ -65,7 +66,7 @@ jobs:
6566
if [ "$RUNNER_OS" = "Windows" ]; then
6667
bindir=Scripts
6768
fi
68-
./.venv/$bindir/pip install 'protobuf>=3.20,<6' 'types-protobuf>=3.20,<6' 'typing-extensions>=4.2.0,<5' pytest pytest_asyncio grpcio pydantic opentelemetry-api opentelemetry-sdk python-dateutil
69+
./.venv/$bindir/pip install 'protobuf>=3.20,<6' 'types-protobuf>=3.20,<6' 'typing-extensions>=4.2.0,<5' pytest pytest_asyncio grpcio 'nexus-rpc>=1.1.0' pydantic opentelemetry-api opentelemetry-sdk python-dateutil 'openai-agents>=0.2.3,<=0.2.9'
6970
./.venv/$bindir/pip install --no-index --find-links=../dist temporalio
7071
./.venv/$bindir/python -m pytest -s -k test_workflow_hello
7172

.github/workflows/ci.yml

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ jobs:
2424
with:
2525
submodules: recursive
2626
- uses: dtolnay/rust-toolchain@stable
27+
with:
28+
components: "clippy"
2729
- uses: Swatinem/rust-cache@v2
2830
with:
2931
workspaces: temporalio/bridge -> target
@@ -44,7 +46,7 @@ jobs:
4446
- run: poe build-develop
4547
- run: mkdir junit-xml
4648
- run: poe test ${{matrix.pytestExtraArgs}} -s --junit-xml=junit-xml/${{ matrix.python }}--${{ matrix.os }}.xml
47-
timeout-minutes: 10
49+
timeout-minutes: 15
4850
# Time skipping doesn't yet support ARM
4951
- if: ${{ !endsWith(matrix.os, '-arm') }}
5052
run: poe test ${{matrix.pytestExtraArgs}} -s --workflow-environment time-skipping --junit-xml=junit-xml/${{ matrix.python }}--${{ matrix.os }}--time-skipping.xml
@@ -57,6 +59,11 @@ jobs:
5759
TEMPORAL_CLIENT_CLOUD_API_KEY: ${{ secrets.TEMPORAL_CLIENT_CLOUD_API_KEY }}
5860
TEMPORAL_CLIENT_CLOUD_API_VERSION: 2024-05-13-00
5961
TEMPORAL_CLIENT_CLOUD_NAMESPACE: sdk-ci.a2dd6
62+
- if: ${{ matrix.openaiTestTarget && (github.event.pull_request.head.repo.full_name == '' || github.event.pull_request.head.repo.full_name == 'temporalio/sdk-python') }}
63+
run: poe test tests/contrib/openai_agents/test_openai.py ${{matrix.pytestExtraArgs}} -s --junit-xml=junit-xml/${{ matrix.python }}--${{ matrix.os }}--openai.xml
64+
timeout-minutes: 10
65+
env:
66+
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
6067
- name: "Upload junit-xml artifacts"
6168
uses: actions/upload-artifact@v4
6269
if: always()
@@ -102,6 +109,41 @@ jobs:
102109
run: |
103110
npx doctoc README.md
104111
[[ -z $(git status --porcelain README.md) ]] || (git diff README.md; echo "README changed"; exit 1)
112+
test-latest-deps:
113+
timeout-minutes: 30
114+
runs-on: ubuntu-latest
115+
steps:
116+
- uses: actions/checkout@v4
117+
with:
118+
submodules: recursive
119+
- uses: dtolnay/rust-toolchain@stable
120+
- uses: Swatinem/rust-cache@v2
121+
with:
122+
workspaces: temporalio/bridge -> target
123+
- uses: actions/setup-python@v5
124+
with:
125+
python-version: "3.13"
126+
- uses: arduino/setup-protoc@v3
127+
with:
128+
# TODO(cretz): Can upgrade proto when https://github.com/arduino/setup-protoc/issues/99 fixed
129+
version: "23.x"
130+
repo-token: ${{ secrets.GITHUB_TOKEN }}
131+
- uses: astral-sh/setup-uv@v5
132+
- run: uv tool install poethepoet
133+
- run: uv lock --upgrade
134+
- run: uv sync --all-extras
135+
- run: poe lint
136+
- run: poe build-develop
137+
- run: mkdir junit-xml
138+
- run: poe test -s --junit-xml=junit-xml/latest-deps.xml
139+
timeout-minutes: 10
140+
- name: "Upload junit-xml artifacts"
141+
uses: actions/upload-artifact@v4
142+
if: always()
143+
with:
144+
name: junit-xml--${{github.run_id}}--${{github.run_attempt}}--latest-deps--time-skipping
145+
path: junit-xml
146+
retention-days: 14
105147

106148
# Runs the sdk features repo tests with this repo's current SDK code
107149
features-tests:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ temporalio/bridge/temporal_sdk_bridge*
99
/.idea
1010
/sdk-python.iml
1111
/.zed
12+
*.DS_Store

README.md

Lines changed: 390 additions & 32 deletions
Large diffs are not rendered by default.

pyproject.toml

Lines changed: 45 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
[project]
22
name = "temporalio"
3-
version = "1.12.0"
3+
version = "1.18.1"
44
description = "Temporal.io Python SDK"
55
authors = [{ name = "Temporal Technologies Inc", email = "[email protected]" }]
6-
requires-python = "~=3.9"
6+
requires-python = ">=3.9"
77
readme = "README.md"
88
license = { file = "LICENSE" }
99
keywords = [
1010
"temporal",
1111
"workflow",
1212
]
1313
dependencies = [
14-
"protobuf>=3.20",
14+
"nexus-rpc==1.1.0",
15+
"protobuf>=3.20,<7.0.0",
1516
"python-dateutil>=2.8.2,<3 ; python_version < '3.11'",
1617
"types-protobuf>=3.20",
1718
"typing-extensions>=4.2.0,<5",
@@ -24,6 +25,11 @@ opentelemetry = [
2425
"opentelemetry-sdk>=1.11.1,<2",
2526
]
2627
pydantic = ["pydantic>=2.0.0,<3"]
28+
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'",
32+
]
2733

2834
[project.urls]
2935
Homepage = "https://github.com/temporalio/sdk-python"
@@ -40,7 +46,7 @@ dev = [
4046
"psutil>=5.9.3,<6",
4147
"pydocstyle>=6.3.0,<7",
4248
"pydoctor>=24.11.1,<25",
43-
"pyright==1.1.377",
49+
"pyright==1.1.403",
4450
"pytest~=7.4",
4551
"pytest-asyncio>=0.21,<0.22",
4652
"pytest-timeout~=2.2",
@@ -49,27 +55,33 @@ dev = [
4955
"twine>=4.0.1,<5",
5056
"ruff>=0.5.0,<0.6",
5157
"maturin>=1.8.2",
58+
"pytest-cov>=6.1.1",
59+
"httpx>=0.28.1",
5260
"pytest-pretty>=1.3.0",
61+
"openai-agents[litellm]>=0.3,<0.4"
5362
]
5463

5564
[tool.poe.tasks]
5665
build-develop = "uv run maturin develop --uv"
5766
build-develop-with-release = { cmd = "uv run maturin develop --release --uv" }
5867
format = [{cmd = "uv run ruff check --select I --fix"}, {cmd = "uv run ruff format"}, ]
59-
gen-docs = "uv run python scripts/gen_docs.py"
60-
gen-protos = "uv run python scripts/gen_protos.py"
68+
gen-docs = "uv run scripts/gen_docs.py"
69+
gen-protos = "uv run scripts/gen_protos.py"
70+
gen-protos-docker = "uv run scripts/gen_protos_docker.py"
6171
lint = [
6272
{cmd = "uv run ruff check --select I"},
6373
{cmd = "uv run ruff format --check"},
6474
{ref = "lint-types"},
65-
{cmd = "uv run pyright"},
6675
{ref = "lint-docs"},
6776
]
6877
bridge-lint = { cmd = "cargo clippy -- -D warnings", cwd = "temporalio/bridge" }
6978
# TODO(cretz): Why does pydocstyle complain about @overload missing docs after
7079
# https://github.com/PyCQA/pydocstyle/pull/511?
7180
lint-docs = "uv run pydocstyle --ignore-decorators=overload"
72-
lint-types = "uv run mypy --namespace-packages --check-untyped-defs ."
81+
lint-types = [
82+
{ cmd = "uv run pyright"},
83+
{ cmd = "uv run mypy --namespace-packages --check-untyped-defs ."},
84+
]
7385
run-bench = "uv run python scripts/run_bench.py"
7486
test = "uv run pytest"
7587

@@ -93,7 +105,7 @@ filterwarnings = [
93105
[tool.cibuildwheel]
94106
before-all = "pip install protoc-wheel-0"
95107
build = "cp39-win_amd64 cp39-manylinux_x86_64 cp39-manylinux_aarch64 cp39-macosx_x86_64 cp39-macosx_arm64"
96-
build-verbosity = "1"
108+
build-verbosity = 1
97109

98110
[tool.cibuildwheel.macos]
99111
environment = { MACOSX_DEPLOYMENT_TARGET = "10.12" }
@@ -151,16 +163,31 @@ project-name = "Temporal Python"
151163
sidebar-expand-depth = 2
152164

153165
[tool.pyright]
166+
enableTypeIgnoreComments = true
167+
reportAny = "none"
168+
reportCallInDefaultInitializer = "none"
169+
reportExplicitAny = "none"
170+
reportIgnoreCommentWithoutRule = "none"
171+
reportImplicitAbstractClass = "none"
172+
reportImplicitOverride = "none"
173+
reportImplicitStringConcatenation = "none"
174+
reportImportCycles = "none"
175+
reportMissingTypeArgument = "none"
176+
reportPrivateUsage = "none"
177+
reportUnannotatedClassAttribute = "none"
178+
reportUnknownArgumentType = "none"
179+
reportUnknownMemberType = "none"
180+
reportUnknownParameterType = "none"
181+
reportUnknownVariableType = "none"
182+
reportUnnecessaryIsInstance = "none"
183+
reportUnnecessaryTypeIgnoreComment = "none"
184+
reportUnusedCallResult = "none"
154185
include = ["temporalio", "tests"]
155186
exclude = [
156187
"temporalio/api",
157188
"temporalio/bridge/proto",
158189
"tests/worker/workflow_sandbox/testmodules/proto",
159190
"temporalio/bridge/worker.py",
160-
"temporalio/contrib/opentelemetry.py",
161-
"temporalio/converter.py",
162-
"temporalio/testing/_workflow.py",
163-
"temporalio/worker/_activity.py",
164191
"temporalio/worker/_replayer.py",
165192
"temporalio/worker/_worker.py",
166193
"temporalio/worker/workflow_sandbox/_importer.py",
@@ -169,11 +196,13 @@ exclude = [
169196
"tests/api/test_grpc_stub.py",
170197
"tests/conftest.py",
171198
"tests/contrib/test_opentelemetry.py",
199+
"tests/contrib/pydantic/models.py",
200+
"tests/contrib/pydantic/models_2.py",
201+
"tests/contrib/pydantic/test_pydantic.py",
202+
"tests/contrib/pydantic/workflows.py",
172203
"tests/test_converter.py",
173204
"tests/test_service.py",
174-
"tests/test_workflow.py",
175205
"tests/worker/test_activity.py",
176-
"tests/worker/test_workflow.py",
177206
"tests/worker/workflow_sandbox/test_importer.py",
178207
"tests/worker/workflow_sandbox/test_restrictions.py",
179208
# TODO: these pass locally but fail in CI with
@@ -182,6 +211,7 @@ exclude = [
182211
"temporalio/bridge/metric.py",
183212
"temporalio/bridge/runtime.py",
184213
"temporalio/bridge/testing.py",
214+
"temporalio/envconfig.py",
185215
]
186216

187217
[tool.ruff]

scripts/_proto/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ RUN uv add "protobuf<4"
1212
RUN uv sync --all-extras
1313
RUN poe gen-protos
1414

15-
CMD cp -r ./temporalio/api/* /api_new && cp -r ./temporalio/bridge/proto/* /bridge_new
15+
CMD ["sh", "-c", "cp -r ./temporalio/api/* /api_new && cp -r ./temporalio/bridge/proto/* /bridge_new"]

scripts/gen_docs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
print("Generating documentation...")
99

1010
# Run pydoctor
11-
subprocess.check_call("pydoctor")
11+
subprocess.check_call(["pydoctor", "--quiet"])
1212

1313
# Copy favicon
1414
shutil.copyfile(

0 commit comments

Comments
 (0)