Add Python 3.13 test coverage

#test-continuous

PiperOrigin-RevId: 690740783
pull/19011/head
Protobuf Team Bot 4 weeks ago committed by Copybara-Service
parent 89533c743f
commit 7060d3d723
  1. 14
      .github/scripts/validate_yaml.py
  2. 15
      .github/workflows/test_python.yml
  3. 16
      .github/workflows/test_upb.yml
  4. 2
      python/dist/BUILD.bazel
  5. 1
      python/dist/setup.py
  6. 1
      python/protobuf_distutils/setup.py
  7. 2
      python/requirements.txt

@ -58,16 +58,18 @@ for file in yaml_files:
elif 'with' in step and 'name' in step['with']:
name = step['with']['name']
else:
raise ValueError('Step in job %s does not have a name.' % job)
raise ValueError(
'Step in job %s from file %s does not have a name.' % (job, file)
)
if continuous_condition and 'continuous-run' not in step.get('if', ''):
raise ValueError(
'Step %s in job %s does not check the continuous-run condition'
% (name, job)
'Step %s in job %s from file %s does not check the continuous-run'
' condition' % (name, job, file)
)
if not continuous_condition and 'continuous-run' in step.get('if', ''):
raise ValueError(
'Step %s in job %s checks the continuous-run condition but '
'the job does not contain the continuous-prefix'
% (name, job)
'Step %s in job %s from file %s checks the continuous-run'
' condition but the job does not contain the continuous-prefix'
% (name, job, file)
)
print('PASSED: All steps in all jobs check the continuous-run condition.')

@ -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"]
include:
- type: Pure
targets: //python/... //python:python_version_test
@ -48,6 +48,10 @@ jobs:
- version: "3.10"
continuous-only: true
- version: "3.11"
continuous-only: true
- version: "3.12"
continuous-only: true
- version: "3.13"
name: ${{ matrix.continuous-only && inputs.continuous-prefix || '' }} Linux ${{ matrix.type }} ${{ matrix.version }}
runs-on: ubuntu-latest
@ -61,7 +65,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}-d9624f2aa83cba3eaf906f751d75b36aacb9aa82', 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
@ -73,14 +77,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-13
@ -91,7 +96,7 @@ 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

@ -87,7 +87,7 @@ jobs:
uses: protocolbuffers/protobuf-ci/checkout@v3
with:
ref: ${{ inputs.safe-checkout }}
- name: "Setup Python"
- name: Setup Python
uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0
with:
cache: pip
@ -115,7 +115,7 @@ jobs:
uses: protocolbuffers/protobuf-ci/checkout@v3
with:
ref: ${{ inputs.safe-checkout }}
- name: "Setup Python"
- name: Setup Python
uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0
with:
python-version: 3.12
@ -189,13 +189,15 @@ jobs:
# supported Python versions and assume this gives us sufficient test
# coverage.
- { os: ubuntu-latest, python-version: "3.8", architecture: x64, type: 'binary' }
- { os: macos-13, python-version: "3.8", architecture: x64, type: 'binary' }
- { 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.8", architecture: x64, type: 'source', continuous-only: true }
- { os: macos-13, 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", architecture: x64, type: 'source', continuous-only: true }
- { os: macos-13, python-version: "3.13", 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 }
@ -203,11 +205,13 @@ jobs:
- { 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", 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.12", architecture: x64, type: 'binary', continuous-only: true }
- { os: windows-2019, python-version: "3.13", architecture: x64, type: 'binary' }
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 }}
@ -279,7 +283,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.13"]
runs-on: ubuntu-latest
if: ${{ github.event_name != 'pull_request_target' }}
steps:
@ -290,7 +294,7 @@ jobs:
path: wheels
- name: Delete Binary Wheels
run: find wheels -type f | grep -v none-any | xargs rm
- name: "Setup Python"
- name: Setup Python
uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0
with:
python-version: ${{ matrix.python-version }}

@ -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",
],
distribution = "protobuf",
extra_distinfo_files = {
@ -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",
],
distribution = "protobuf",
extra_distinfo_files = {

@ -58,6 +58,7 @@ setup(
'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(),

@ -35,6 +35,7 @@ setup(
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Programming Language :: Python :: 3.13',
'Topic :: Software Development :: Code Generators',
],
description=(

@ -1,2 +1,2 @@
numpy<=1.26.1
numpy<=2.1.0
setuptools<=70.3.0

Loading…
Cancel
Save