Require Python >=3.8 and add 3.11 to test matrix

Dropping 3.7 support was already announced in https://protobuf.dev/news/2023-07-06/ and meant to be dropped in
https://github.com/protocolbuffers/protobuf/pull/13219 but tests / setup.py were missed.

PiperOrigin-RevId: 567691335
pull/14176/head
Sandy Zhang 1 year ago committed by Copybara-Service
parent 0f7a0b6c98
commit c50e89217d
  1. 6
      .github/workflows/test_python.yml
  2. 4
      python/setup.py

@ -17,7 +17,7 @@ jobs:
fail-fast: false # Don't cancel all jobs if one fails.
matrix:
type: [ Pure, C++]
version: [ "3.7", "3.8", "3.9", "3.10" ]
version: ["3.8", "3.9", "3.10", "3.11" ]
include:
- type: Pure
targets: //python/... //upb/python/... //python:python_version_test
@ -42,7 +42,7 @@ jobs:
- name: Run tests
uses: protocolbuffers/protobuf-ci/bazel-docker@v2
with:
image: ${{ matrix.image || format('us-docker.pkg.dev/protobuf-build/containers/test/linux/python:{0}-66964dc8b07b6d1fc73a5cc14e59e84c1c534cea', matrix.version) }}
image: ${{ matrix.image || format('us-docker.pkg.dev/protobuf-build/containers/test/linux/python:{0}-63dd26c0c7a808d92673a3e52e848189d4ab0f17', 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
@ -54,7 +54,7 @@ jobs:
matrix:
type: [ Pure, C++]
# TODO Consider expanding this set of versions.
version: [ "3.10" ]
version: [ "3.11" ]
include:
- type: Pure
targets: //python/... //upb/python/... //python:python_version_test

@ -425,13 +425,13 @@ if __name__ == '__main__':
classifiers=[
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.7',
# LINT.IfChange
# Remove importlib fallback path when we drop Python 3.8 support.
'Programming Language :: Python :: 3.8',
# LINT.ThenChange(//depot/google3/google/protobuf/internal/test_util.py)
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
],
namespace_packages=['google'],
packages=find_packages(
@ -449,5 +449,5 @@ if __name__ == '__main__':
},
install_requires=install_requires,
ext_modules=ext_module_list,
python_requires='>=3.7',
python_requires='>=3.8',
)

Loading…
Cancel
Save