Skip to content

Commit

Permalink
extend python support to 3.13.Ob4
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 Jul 24, 2024
1 parent 75b66c2 commit 6b08510
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 10 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/test_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ jobs:
fail-fast: false # Don't cancel all jobs if one fails.
matrix:
type: [ Pure, C++]
# TODO: b/309627662 - Add coverage for Python 3.12.
version: ["3.8", "3.9", "3.10", "3.11"]
version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13.0b4"]
include:
- type: Pure
targets: //python/... //python:python_version_test
Expand All @@ -43,7 +42,7 @@ jobs:
- name: Run tests
uses: protocolbuffers/protobuf-ci/bazel-docker@v3
with:
image: ${{ matrix.image || format('us-docker.pkg.dev/protobuf-build/containers/test/linux/python:{0}-63dd26c0c7a808d92673a3e52e848189d4ab0f17', matrix.version) }}
image: ${{ matrix.image || format('us-docker.pkg.dev/protobuf-build/containers/test/linux/python:{0}-384d5abe83a791c6b1ce04f5d7bc0b1f84a30d38', 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 @@ -56,7 +55,7 @@ jobs:
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
Expand All @@ -73,11 +72,12 @@ jobs:
ref: ${{ inputs.safe-checkout }}

- name: Pin Python version
uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0
uses: actions/setup-python@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 @@ -71,10 +71,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@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 @@ -98,10 +99,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@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 @@ -175,22 +177,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-beta.4", architecture: x64, type: 'binary' }
- { os: macos-13, python-version: "3.13.0-beta.4", architecture: x64, type: 'binary' }
- { os: ubuntu-latest, python-version: "3.8", architecture: x64, type: 'source' }
- { os: macos-12, python-version: "3.8", architecture: x64, type: 'source' }
- { os: ubuntu-latest, python-version: "3.12", architecture: x64, type: 'source' }
- { os: macos-13, python-version: "3.12", architecture: x64, type: 'source' }
- { os: ubuntu-latest, python-version: "3.13.0-beta.4", architecture: x64, type: 'source' }
- { os: macos-13, python-version: "3.13.0-beta.4", architecture: x64, type: 'source' }

# Windows uses the full API up until Python 3.10.
- { os: windows-2019, python-version: "3.8", architecture: x86, type: 'binary' }
- { os: windows-2019, python-version: "3.9", architecture: x86, type: 'binary' }
- { os: windows-2019, python-version: "3.10", architecture: x86, type: 'binary' }
- { os: windows-2019, python-version: "3.11", architecture: x86, type: 'binary' }
- { os: windows-2019, python-version: "3.12", architecture: x86, type: 'binary' }
- { os: windows-2019, python-version: "3.13.0-beta.4", architecture: x86, type: 'binary' }
- { os: windows-2019, python-version: "3.8", architecture: x64, type: 'binary' }
- { os: windows-2019, python-version: "3.9", architecture: x64, type: 'binary' }
- { os: windows-2019, python-version: "3.10", architecture: x64, type: 'binary' }
- { os: windows-2019, python-version: "3.11", architecture: x64, type: 'binary' }
- { os: windows-2019, python-version: "3.12", architecture: x64, type: 'binary' }
- { os: windows-2019, python-version: "3.13.0-beta.4", architecture: x64, type: 'binary' }
runs-on: ${{ matrix.os }}
if: ${{ github.event_name != 'pull_request_target' }}
defaults:
Expand All @@ -207,10 +215,11 @@ jobs:
with:
name: requirements
path: requirements
- uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0
- uses: actions/setup-python@v5.1.1
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.architecture }}
allow-prereleases: true
- name: Setup Python venv
run: |
python -m pip install --upgrade pip
Expand Down Expand Up @@ -251,7 +260,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-beta.4"]
runs-on: ubuntu-latest
if: ${{ github.event_name != 'pull_request_target' }}
steps:
Expand All @@ -262,9 +271,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@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 @@ -314,6 +314,7 @@ py_wheel(
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13.Ob4",
],
distribution = "protobuf",
extra_distinfo_files = {
Expand Down Expand Up @@ -375,6 +376,7 @@ py_wheel(
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13.Ob4",
],
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 @@ -59,6 +59,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.Ob4',
'Topic :: Software Development :: Code Generators',
],
description=(
Expand Down

0 comments on commit 6b08510

Please sign in to comment.