Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop Python 3.8, add 3.13 #694

Merged
merged 3 commits into from
Jan 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So just to confirm, the -cp38- part of the wheel name in PyPi means it is compatible with 3.8+, but in fact the wheel was built using 3.12 (and will now be built with 3.13 and will contain a -cp39- name fragment).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We tell cibuildwheel to build for these minimums: cp39-win_amd64, cp39-manylinux_x86_64, cp39-manylinux_aarch64, cp39-macosx_x86_64, and cp39-macosx_arm64. And we tell PyO3 to compile with ABI compat to abi3-py39. It is those two tools that make sure during the build-binary step to compile for 3.9 minimum. cibuildwheel sometimes runs inside a container, and it's a certain container they build within to get older libc compat and such (ref https://github.com/pypa/manylinux for Linux for instance). May have to reference those projects for more details or look at the logs of the builds at https://github.com/temporalio/sdk-python/actions/workflows/build-binaries.yml.


# 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"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worth a comment explaining the --python 3.9 here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I admit I do not remember exactly, but I think it was saying there wasn't compatibility with some of the other dependencies

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
Loading