Skip to content

Commit

Permalink
Drop Python 3.8, add 3.13 (#694)
Browse files Browse the repository at this point in the history
  • Loading branch information
cretz authored Jan 10, 2025
1 parent 3901cb7 commit 7af48a7
Show file tree
Hide file tree
Showing 13 changed files with 467 additions and 484 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
# Compile the binaries and upload artifacts
compile-binaries:
strategy:
fail-fast: true
fail-fast: false
matrix:
include:
- os: ubuntu-latest
Expand All @@ -32,7 +32,7 @@ jobs:
submodules: recursive
- uses: actions/setup-python@v5
with:
python-version: "3.12"
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
Expand Down
27 changes: 9 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,30 +12,23 @@ jobs:
strategy:
fail-fast: false
matrix:
python: ["3.8", "3.12"]
python: ["3.9", "3.13"]
os: [ubuntu-latest, ubuntu-arm, macos-intel, macos-arm, windows-latest]
include:
- os: ubuntu-latest
python: "3.12"
python: "3.13"
docsTarget: true
cloudTestTarget: true
clippyLinter: true
- os: ubuntu-latest
python: "3.8"
python: "3.9"
protoCheckTarget: true
- os: ubuntu-arm
runsOn: ubuntu-24.04-arm64-2-core
- os: macos-intel
runsOn: macos-13
- os: macos-arm
runsOn: macos-14
# macOS ARM 3.8 does not have an available Python build at
# https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json.
# See https://github.com/actions/setup-python/issues/808 and
# https://github.com/actions/python-versions/pull/259.
exclude:
- os: macos-arm
python: "3.8"
runsOn: macos-latest
runs-on: ${{ matrix.runsOn || matrix.os }}
steps:
- uses: actions/checkout@v4
Expand All @@ -47,17 +40,13 @@ jobs:
workspaces: temporalio/bridge -> target
- uses: actions/setup-python@v5
with:
# Pinning due to failed Windows builds on 3.12.5 https://github.com/temporalio/sdk-python/issues/637
python-version: ${{ matrix.python == '3.12' && '3.12.4' || matrix.python }}
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
version: "23.x"
repo-token: ${{ secrets.GITHUB_TOKEN }}
# Using fixed Poetry version until
# https://github.com/python-poetry/poetry/issues/7611 and
# https://github.com/python-poetry/poetry/pull/7694 are fixed
- run: python -m pip install --upgrade wheel "poetry==1.3.2" poethepoet
- run: python -m pip install --upgrade wheel poetry poethepoet
- run: poetry install --no-root --all-extras
- run: poe bridge-lint
if: ${{ matrix.clippyLinter }}
Expand Down Expand Up @@ -93,7 +82,8 @@ jobs:
env:
TEMPORAL_TEST_PROTO3: 1
run: |
poetry add "protobuf<4"
poetry add --python 3.9 "protobuf<4"
poetry install --no-root --all-extras
poe gen-protos
poe format
[[ -z $(git status --porcelain temporalio) ]] || (git diff temporalio; echo "Protos changed"; exit 1)
Expand Down Expand Up @@ -122,3 +112,4 @@ jobs:
python-repo-path: ${{github.event.pull_request.head.repo.full_name}}
version: ${{github.event.pull_request.head.ref}}
version-is-repo-ref: true
features-repo-ref: python-version-upgrade
2 changes: 1 addition & 1 deletion .github/workflows/run-bench.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
workspaces: temporalio/bridge -> target
- uses: actions/setup-python@v5
with:
python-version: "3.12"
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
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
![Temporal Python SDK](https://assets.temporal.io/w/py-banner.svg)

[![Python 3.8+](https://img.shields.io/pypi/pyversions/temporalio.svg?style=for-the-badge)](https://pypi.org/project/temporalio)
[![Python 3.9+](https://img.shields.io/pypi/pyversions/temporalio.svg?style=for-the-badge)](https://pypi.org/project/temporalio)
[![PyPI](https://img.shields.io/pypi/v/temporalio.svg?style=for-the-badge)](https://pypi.org/project/temporalio)
[![MIT](https://img.shields.io/pypi/l/temporalio.svg?style=for-the-badge)](LICENSE)

Expand Down Expand Up @@ -1367,7 +1367,7 @@ The Python SDK is built to work with Python 3.8 and newer. It is built using

To build the SDK from source for use as a dependency, the following prerequisites are required:

* [Python](https://www.python.org/) >= 3.8
* [Python](https://www.python.org/) >= 3.9
* Make sure the latest version of `pip` is in use
* [Rust](https://www.rust-lang.org/)
* [Protobuf Compiler](https://protobuf.dev/)
Expand Down Expand Up @@ -1512,9 +1512,9 @@ 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 `poetry add "protobuf<4"`. 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.
protobuf code, you must be on Python <= 3.10, and then run `poetry add "protobuf<4"` +
`poetry install --no-root --all-extras`. 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.

Do not commit `poetry.lock` or `pyproject.toml` changes. To go back from this downgrade, restore both of those files
and run `poetry install --no-root --all-extras`. Make sure you `poe format` the results.
Expand Down
Loading

0 comments on commit 7af48a7

Please sign in to comment.