Skip to content

Commit

Permalink
extend python support to 3.13.Orc2
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 655242178
  • Loading branch information
protobuf-github-bot authored and copybara-github committed Sep 16, 2024
1 parent c666aef commit b96342d
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 11 deletions.
15 changes: 10 additions & 5 deletions .github/workflows/test_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
fail-fast: false # Don't cancel all jobs if one fails.
matrix:
type: [ Pure, C++]
version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13.0rc2"]
include:
- type: Pure
targets: //python/... //python:python_version_test
Expand All @@ -48,6 +48,9 @@ jobs:
- version: "3.10"
continuous-only: true
- version: "3.11"
- version: "3.12"
- version: "3.13.0rc2"
continuous-only: true

name: ${{ matrix.continuous-only && inputs.continuous-prefix || '' }} Linux ${{ matrix.type }} ${{ matrix.version }}
runs-on: ubuntu-latest
Expand All @@ -61,7 +64,7 @@ jobs:
if: ${{ !matrix.continuous-only || inputs.continuous-run }}
uses: protocolbuffers/protobuf-ci/bazel-docker@v3
with:
image: ${{ matrix.image || format('us-docker.pkg.dev/protobuf-build/containers/test/linux/python:6.4.0-{0}-27cf7b86212020d7e552bc13b1e084abb971da75', matrix.version) }}
image: ${{ matrix.image || format('us-docker.pkg.dev/protobuf-build/containers/test/linux/python:6.4.0-{0}-2920199ab0090ed427413a8e422e62695c8392a8', matrix.version) }}
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
bazel-cache: python_linux/${{ matrix.type }}_${{ matrix.version }}
bazel: test ${{ matrix.targets }} ${{ matrix.flags }} --test_env=KOKORO_PYTHON_VERSION
Expand All @@ -73,14 +76,15 @@ jobs:
fail-fast: false # Don't cancel all jobs if one fails.
matrix:
type: [ Pure, C++]
# TODO Consider expanding this set of versions.
version: [ "3.12" ]
version: [ "3.12", "3.13" ]
include:
- type: Pure
targets: //python/... //python:python_version_test
- type: C++
targets: //python/... //python:python_version_test
flags: --define=use_fast_cpp_protos=true
- version: "3.13"
continuous-only: true

name: MacOS ${{ matrix.type }} ${{ matrix.version }}
runs-on: macos-12
Expand All @@ -91,11 +95,12 @@ jobs:
ref: ${{ inputs.safe-checkout }}

- name: Pin Python version
uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0
uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f #v5.1.1
with:
python-version: ${{ matrix.version }}
cache: pip
cache-dependency-path: 'python/requirements.txt'
allow-prereleases: true

- name: Validate version
run: python3 --version | grep ${{ matrix.version }} || (echo "Invalid Python version - $(python3 --version)" && exit 1)
Expand Down
20 changes: 15 additions & 5 deletions .github/workflows/test_upb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,11 @@ jobs:
uses: protocolbuffers/protobuf-ci/checkout@v3
with:
ref: ${{ inputs.safe-checkout }}
- uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0
- uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f #v5.1.1
with:
cache: pip
cache-dependency-path: 'python/requirements.txt'
allow-prereleases: true
- name: Run tests
uses: protocolbuffers/protobuf-ci/bazel@v3
with:
Expand All @@ -114,10 +115,11 @@ jobs:
uses: protocolbuffers/protobuf-ci/checkout@v3
with:
ref: ${{ inputs.safe-checkout }}
- uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0
- uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f #v5.1.1
with:
cache: pip
cache-dependency-path: 'python/requirements.txt'
allow-prereleases: true
- name: Run tests
uses: protocolbuffers/protobuf-ci/bazel@v3
with:
Expand Down Expand Up @@ -189,22 +191,28 @@ jobs:
- { os: macos-12, python-version: "3.8", architecture: x64, type: 'binary' }
- { os: ubuntu-latest, python-version: "3.12", architecture: x64, type: 'binary' }
- { os: macos-13, python-version: "3.12", architecture: x64, type: 'binary' }
- { os: ubuntu-latest, python-version: "3.13.0-rc.2", architecture: x64, type: 'binary', continuous-only: true }
- { os: macos-13, python-version: "3.13.0-rc.2", architecture: x64, type: 'binary', continuous-only: true }
- { os: ubuntu-latest, python-version: "3.8", architecture: x64, type: 'source', continuous-only: true }
- { os: macos-12, python-version: "3.8", architecture: x64, type: 'source', continuous-only: true }
- { os: ubuntu-latest, python-version: "3.12", architecture: x64, type: 'source', continuous-only: true }
- { os: macos-13, python-version: "3.12", architecture: x64, type: 'source', continuous-only: true }
- { os: ubuntu-latest, python-version: "3.13.0-rc.2", architecture: x64, type: 'source', continuous-only: true }
- { os: macos-13, python-version: "3.13.0-rc.2", architecture: x64, type: 'source', continuous-only: true }

# Windows uses the full API up until Python 3.10.
- { os: windows-2019, python-version: "3.8", architecture: x86, type: 'binary', continuous-only: true }
- { os: windows-2019, python-version: "3.9", architecture: x86, type: 'binary', continuous-only: true }
- { os: windows-2019, python-version: "3.10", architecture: x86, type: 'binary', continuous-only: true }
- { os: windows-2019, python-version: "3.11", architecture: x86, type: 'binary', continuous-only: true }
- { os: windows-2019, python-version: "3.12", architecture: x86, type: 'binary', continuous-only: true }
- { os: windows-2019, python-version: "3.13.0-rc.2", architecture: x86, type: 'binary', continuous-only: true }
- { os: windows-2019, python-version: "3.8", architecture: x64, type: 'binary' }
- { os: windows-2019, python-version: "3.9", architecture: x64, type: 'binary', continuous-only: true }
- { os: windows-2019, python-version: "3.10", architecture: x64, type: 'binary', continuous-only: true }
- { os: windows-2019, python-version: "3.11", architecture: x64, type: 'binary', continuous-only: true }
- { os: windows-2019, python-version: "3.12", architecture: x64, type: 'binary' }
- { os: windows-2019, python-version: "3.13.0-rc.2", architecture: x64, type: 'binary', continuous-only: true }
name: ${{ matrix.continuous-only && inputs.continuous-prefix || '' }} Test Wheels Python ${{ matrix.python-version }} ${{ matrix.os }} ${{ matrix.architecture }} ${{ matrix.type }}
needs: build_wheels
runs-on: ${{ matrix.os }}
Expand All @@ -225,11 +233,12 @@ jobs:
with:
name: requirements
path: requirements
- uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0
- uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f #v5.1.1
if: ${{ !matrix.continuous-only || inputs.continuous-run }}
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.architecture }}
allow-prereleases: true
- name: Setup Python venv
if: ${{ !matrix.continuous-only || inputs.continuous-run }}
run: |
Expand Down Expand Up @@ -275,7 +284,7 @@ jobs:
strategy:
fail-fast: false # Don't cancel all jobs if one fails.
matrix:
python-version: ["3.8", "3.12"]
python-version: ["3.8", "3.12", "3.13.0-rc.2"]
runs-on: ubuntu-latest
if: ${{ github.event_name != 'pull_request_target' }}
steps:
Expand All @@ -286,9 +295,10 @@ jobs:
path: wheels
- name: Delete Binary Wheels
run: find wheels -type f | grep -v none-any | xargs rm
- uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0
- uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f #v5.1.1
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- name: Setup Python venv
run: |
python -m pip install --upgrade pip
Expand Down
2 changes: 2 additions & 0 deletions python/dist/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ py_wheel(
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13.Orc2",
],
distribution = "protobuf",
extra_distinfo_files = {
Expand Down Expand Up @@ -376,6 +377,7 @@ py_wheel(
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13.Orc2",
],
distribution = "protobuf",
extra_distinfo_files = {
Expand Down
1 change: 1 addition & 0 deletions python/dist/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ def GetVersion():
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Programming Language :: Python :: 3.13',
],
namespace_packages=['google'],
packages=find_packages(),
Expand Down
1 change: 1 addition & 0 deletions python/protobuf_distutils/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Programming Language :: Python :: 3.13.Orc2',
'Topic :: Software Development :: Code Generators',
],
description=(
Expand Down
2 changes: 1 addition & 1 deletion python/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
numpy<=1.26.1
numpy<=2.1.0
setuptools<=70.3.0

0 comments on commit b96342d

Please sign in to comment.