From f612227aab01a842d1410a5c8c02b4f7656f3f89 Mon Sep 17 00:00:00 2001 From: Dan Davison Date: Mon, 31 Mar 2025 10:28:46 -0400 Subject: [PATCH 1/9] Check that intended python version is being used --- .github/workflows/ci.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2b079e60b..d885617ef 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -49,6 +49,14 @@ jobs: - uses: astral-sh/setup-uv@v5 - run: uv tool install poethepoet - run: uv sync --all-extras + - name: Check python version + shell: bash + run: | + actual=$(python -c "import sys; print('.'.join(map(str, sys.version_info[:2])))") + if [[ "$actual" != "${{ matrix.python }}" ]]; then + echo "Python version in use ($actual) does not match intended version (${{ matrix.python }})" + exit 1 + fi - run: poe bridge-lint if: ${{ matrix.clippyLinter }} - run: poe lint From 47b28becfc223c73292c95b674ce14e75b4eb641 Mon Sep 17 00:00:00 2001 From: Dan Davison Date: Mon, 31 Mar 2025 10:33:57 -0400 Subject: [PATCH 2/9] Don't use setup-python action --- .github/workflows/build-binaries.yml | 5 +---- .github/workflows/ci.yml | 5 +---- .github/workflows/run-bench.yml | 5 +---- 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build-binaries.yml b/.github/workflows/build-binaries.yml index 7186238d6..4d8d83145 100644 --- a/.github/workflows/build-binaries.yml +++ b/.github/workflows/build-binaries.yml @@ -30,9 +30,6 @@ jobs: - uses: actions/checkout@v4 with: submodules: recursive - - uses: actions/setup-python@v5 - with: - python-version: "3.13" # Install Rust locally for non-Linux (Linux uses an internal docker # command to build with cibuildwheel which uses rustup install defined @@ -44,7 +41,7 @@ jobs: with: workspaces: temporalio/bridge -> target - uses: astral-sh/setup-uv@v5 - - run: uv sync --all-extras + - run: uv sync --all-extras --python 3.13 # Add the source dist only for Linux x64 for now - if: ${{ matrix.package-suffix == 'linux-amd64' }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d885617ef..0c8892d53 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,9 +38,6 @@ jobs: - uses: Swatinem/rust-cache@v2 with: workspaces: temporalio/bridge -> target - - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python }} - uses: arduino/setup-protoc@v3 with: # TODO(cretz): Can upgrade proto when https://github.com/arduino/setup-protoc/issues/99 fixed @@ -48,7 +45,7 @@ jobs: repo-token: ${{ secrets.GITHUB_TOKEN }} - uses: astral-sh/setup-uv@v5 - run: uv tool install poethepoet - - run: uv sync --all-extras + - run: uv sync --all-extras --python ${{ matrix.python }} - name: Check python version shell: bash run: | diff --git a/.github/workflows/run-bench.yml b/.github/workflows/run-bench.yml index 6dcad63e8..ace6034bf 100644 --- a/.github/workflows/run-bench.yml +++ b/.github/workflows/run-bench.yml @@ -35,9 +35,6 @@ jobs: - uses: Swatinem/rust-cache@v2 with: workspaces: temporalio/bridge -> target - - uses: actions/setup-python@v5 - with: - python-version: "3.13" - uses: arduino/setup-protoc@v3 with: # TODO(cretz): Can upgrade proto when https://github.com/arduino/setup-protoc/issues/99 fixed @@ -47,7 +44,7 @@ jobs: - uses: astral-sh/setup-uv@v5 # Build - run: uv tool install poethepoet - - run: uv sync --all-extras + - run: uv sync --all-extras --python 3.13 - run: poe build-develop-with-release # Run a bunch of bench tests. We run multiple times since results vary. From 0778ee8e27ce3e0b0e920a8fe827b19577a16532 Mon Sep 17 00:00:00 2001 From: Dan Davison Date: Mon, 31 Mar 2025 10:36:40 -0400 Subject: [PATCH 3/9] Deliberate error --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0c8892d53..7dca234b5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -50,7 +50,7 @@ jobs: shell: bash run: | actual=$(python -c "import sys; print('.'.join(map(str, sys.version_info[:2])))") - if [[ "$actual" != "${{ matrix.python }}" ]]; then + if [[ "$actual" != "${{ 3.13 }}" ]]; then echo "Python version in use ($actual) does not match intended version (${{ matrix.python }})" exit 1 fi From ad7e7a50e99ffeb0f27c52d7bb13c0b7a6fb4079 Mon Sep 17 00:00:00 2001 From: Dan Davison Date: Mon, 31 Mar 2025 10:45:18 -0400 Subject: [PATCH 4/9] Install python on $PATH in addition to in virtualenv --- .github/workflows/ci.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7dca234b5..4447ba8b4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,13 +45,19 @@ jobs: repo-token: ${{ secrets.GITHUB_TOKEN }} - uses: astral-sh/setup-uv@v5 - run: uv tool install poethepoet + - run: uv --preview python install --default ${{ matrix.python }} - run: uv sync --all-extras --python ${{ matrix.python }} - name: Check python version shell: bash run: | + actual=$(uv run python -c "import sys; print('.'.join(map(str, sys.version_info[:2])))") + if [[ "$actual" != "${{ 3.13 }}" ]]; then + echo "Python version in use by uv ($actual) does not match intended version (${{ matrix.python }})" + exit 1 + fi actual=$(python -c "import sys; print('.'.join(map(str, sys.version_info[:2])))") if [[ "$actual" != "${{ 3.13 }}" ]]; then - echo "Python version in use ($actual) does not match intended version (${{ matrix.python }})" + echo "Python version on PATH ($actual) does not match intended version (${{ matrix.python }})" exit 1 fi - run: poe bridge-lint From 4543376c249958e535c7e2191df11296b5a30666 Mon Sep 17 00:00:00 2001 From: Dan Davison Date: Mon, 31 Mar 2025 10:57:20 -0400 Subject: [PATCH 5/9] Revert "Don't use setup-python action" This reverts commit 47b28becfc223c73292c95b674ce14e75b4eb641. --- .github/workflows/build-binaries.yml | 3 +++ .github/workflows/ci.yml | 3 +++ .github/workflows/run-bench.yml | 3 +++ 3 files changed, 9 insertions(+) diff --git a/.github/workflows/build-binaries.yml b/.github/workflows/build-binaries.yml index 4d8d83145..b585e3bf8 100644 --- a/.github/workflows/build-binaries.yml +++ b/.github/workflows/build-binaries.yml @@ -30,6 +30,9 @@ jobs: - uses: actions/checkout@v4 with: submodules: recursive + - uses: actions/setup-python@v5 + with: + python-version: "3.13" # Install Rust locally for non-Linux (Linux uses an internal docker # command to build with cibuildwheel which uses rustup install defined diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4447ba8b4..25b662c1b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,6 +38,9 @@ jobs: - uses: Swatinem/rust-cache@v2 with: workspaces: temporalio/bridge -> target + - uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python }} - uses: arduino/setup-protoc@v3 with: # TODO(cretz): Can upgrade proto when https://github.com/arduino/setup-protoc/issues/99 fixed diff --git a/.github/workflows/run-bench.yml b/.github/workflows/run-bench.yml index ace6034bf..d08c98e93 100644 --- a/.github/workflows/run-bench.yml +++ b/.github/workflows/run-bench.yml @@ -35,6 +35,9 @@ jobs: - uses: Swatinem/rust-cache@v2 with: workspaces: temporalio/bridge -> target + - uses: actions/setup-python@v5 + with: + python-version: "3.13" - uses: arduino/setup-protoc@v3 with: # TODO(cretz): Can upgrade proto when https://github.com/arduino/setup-protoc/issues/99 fixed From c088cc2543ce010ae0a816ba78372f3ebb02dfca Mon Sep 17 00:00:00 2001 From: Dan Davison Date: Mon, 31 Mar 2025 11:06:36 -0400 Subject: [PATCH 6/9] Don't use uv --preview to install --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 25b662c1b..045d0b685 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -48,7 +48,6 @@ jobs: repo-token: ${{ secrets.GITHUB_TOKEN }} - uses: astral-sh/setup-uv@v5 - run: uv tool install poethepoet - - run: uv --preview python install --default ${{ matrix.python }} - run: uv sync --all-extras --python ${{ matrix.python }} - name: Check python version shell: bash From 5537499fb654bef06399a954c2efdbfe90837996 Mon Sep 17 00:00:00 2001 From: Dan Davison Date: Mon, 31 Mar 2025 11:10:38 -0400 Subject: [PATCH 7/9] Revert "Deliberate error" This reverts commit 0778ee8e27ce3e0b0e920a8fe827b19577a16532. --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 045d0b685..a5d32d584 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -53,12 +53,12 @@ jobs: shell: bash run: | actual=$(uv run python -c "import sys; print('.'.join(map(str, sys.version_info[:2])))") - if [[ "$actual" != "${{ 3.13 }}" ]]; then + if [[ "$actual" != "${{ matrix.python }}" ]]; then echo "Python version in use by uv ($actual) does not match intended version (${{ matrix.python }})" exit 1 fi actual=$(python -c "import sys; print('.'.join(map(str, sys.version_info[:2])))") - if [[ "$actual" != "${{ 3.13 }}" ]]; then + if [[ "$actual" != "${{ matrix.python }}" ]]; then echo "Python version on PATH ($actual) does not match intended version (${{ matrix.python }})" exit 1 fi From 87a747ca37aeea755a067605ed4dc27c4a829d13 Mon Sep 17 00:00:00 2001 From: Dan Davison Date: Mon, 31 Mar 2025 12:34:23 -0400 Subject: [PATCH 8/9] Specify python version with `uv sync` --- .github/workflows/ci.yml | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a5d32d584..473c42bec 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -97,7 +97,7 @@ jobs: TEMPORAL_TEST_PROTO3: 1 run: | uv add --python 3.9 "protobuf<4" - uv sync --all-extras + uv sync --all-extras --python 3.9 poe build-develop poe gen-protos poe format diff --git a/README.md b/README.md index 58e775da1..1983ed982 100644 --- a/README.md +++ b/README.md @@ -1544,7 +1544,7 @@ poe test -s --log-cli-level=DEBUG -k test_sync_activity_thread_cancel_caught #### Proto Generation and Testing To allow for backwards compatibility, protobuf code is generated on the 3.x series of the protobuf library. To generate -protobuf code, you must be on Python <= 3.10, and then run `uv add "protobuf<4"` + `uv sync --all-extras`. Then the +protobuf code, run `uv add "protobuf<4" --python 3.10` + `uv sync --all-extras --python 3.10`. Then the protobuf files can be generated via `poe gen-protos`. Tests can be run for protobuf version 3 by setting the `TEMPORAL_TEST_PROTO3` env var to `1` prior to running tests. From 90923ea9894f3f4db256942da595007f5e94a843 Mon Sep 17 00:00:00 2001 From: Dan Davison Date: Tue, 1 Apr 2025 18:12:06 -0400 Subject: [PATCH 9/9] partial revert --- .github/workflows/build-binaries.yml | 2 +- .github/workflows/ci.yml | 17 ++--------------- .github/workflows/run-bench.yml | 2 +- 3 files changed, 4 insertions(+), 17 deletions(-) diff --git a/.github/workflows/build-binaries.yml b/.github/workflows/build-binaries.yml index b585e3bf8..7186238d6 100644 --- a/.github/workflows/build-binaries.yml +++ b/.github/workflows/build-binaries.yml @@ -44,7 +44,7 @@ jobs: with: workspaces: temporalio/bridge -> target - uses: astral-sh/setup-uv@v5 - - run: uv sync --all-extras --python 3.13 + - run: uv sync --all-extras # Add the source dist only for Linux x64 for now - if: ${{ matrix.package-suffix == 'linux-amd64' }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 473c42bec..2b079e60b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -48,20 +48,7 @@ jobs: repo-token: ${{ secrets.GITHUB_TOKEN }} - uses: astral-sh/setup-uv@v5 - run: uv tool install poethepoet - - run: uv sync --all-extras --python ${{ matrix.python }} - - name: Check python version - shell: bash - run: | - actual=$(uv run python -c "import sys; print('.'.join(map(str, sys.version_info[:2])))") - if [[ "$actual" != "${{ matrix.python }}" ]]; then - echo "Python version in use by uv ($actual) does not match intended version (${{ matrix.python }})" - exit 1 - fi - actual=$(python -c "import sys; print('.'.join(map(str, sys.version_info[:2])))") - if [[ "$actual" != "${{ matrix.python }}" ]]; then - echo "Python version on PATH ($actual) does not match intended version (${{ matrix.python }})" - exit 1 - fi + - run: uv sync --all-extras - run: poe bridge-lint if: ${{ matrix.clippyLinter }} - run: poe lint @@ -97,7 +84,7 @@ jobs: TEMPORAL_TEST_PROTO3: 1 run: | uv add --python 3.9 "protobuf<4" - uv sync --all-extras --python 3.9 + uv sync --all-extras poe build-develop poe gen-protos poe format diff --git a/.github/workflows/run-bench.yml b/.github/workflows/run-bench.yml index d08c98e93..6dcad63e8 100644 --- a/.github/workflows/run-bench.yml +++ b/.github/workflows/run-bench.yml @@ -47,7 +47,7 @@ jobs: - uses: astral-sh/setup-uv@v5 # Build - run: uv tool install poethepoet - - run: uv sync --all-extras --python 3.13 + - run: uv sync --all-extras - run: poe build-develop-with-release # Run a bunch of bench tests. We run multiple times since results vary.