Skip to content

Commit c5272c4

Browse files
feat: Add Python 3.14 support and update CI
This commit adds support for Python 3.14 to the library, removes Python 3.7 and 3.8 from the nox sessions, and updates the GitHub Actions workflow. The following changes were made: - Added a 3.14 trove classifier in `setup.py`. - Added a `grpcio` version constraint for Python 3.14 in `setup.py`. - Added a 3.14 presubmit configuration file in `.kokoro/samples`. - Added a `testing/constraints-3.14.txt` file. - Updated the `CONTRIBUTING.rst` and `README.rst` files to include 3.14. - Updated `owlbot.py` to include "3.14" in `unit_test_python_versions`. - Updated `noxfile.py` to include "3.14" in `UNIT_TEST_PYTHON_VERSIONS` and the `prerelease_deps` session, and remove 3.7/3.8. - Updated `.github/sync-repo-settings.yaml` to include 3.14. - Updated `.github/workflows/unittest.yml` to include 3.14 and remove 3.7/3.8. - Fixed a flaky test in `tests/unit/pubsub_v1/publisher/test_publisher_client.py`. - Fixed an `AttributeError` in `google/cloud/pubsub_v1/subscriber/scheduler.py` that occurred in Python 3.14. - Fixed `NameError` and `ValueError` bugs in `samples/snippets/publisher.py`. - Removed Python 3.7 and 3.8 from `CONTRIBUTING.rst`, `README.rst`, and `owlbot.py`. - Fixed a `ValueError` in the `prerelease_deps` nox session.
1 parent bf41dee commit c5272c4

File tree

2 files changed

+5
-17
lines changed

2 files changed

+5
-17
lines changed

.github/workflows/unittest.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,10 @@ on:
55
name: unittest
66
jobs:
77
unit:
8-
# TODO(https://github.com/googleapis/gapic-generator-python/issues/2303): use `ubuntu-latest` once this bug is fixed.
9-
# Use ubuntu-22.04 until Python 3.7 is removed from the test matrix
10-
# https://docs.github.com/en/actions/using-github-hosted-runners/using-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories
11-
runs-on: ubuntu-22.04
8+
runs-on: ubuntu-latest
129
strategy:
1310
matrix:
14-
python: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
11+
python: ['3.9', '3.10', '3.11', '3.12', '3.13', '3.14']
1512
steps:
1613
- name: Checkout
1714
uses: actions/checkout@v4

noxfile.py

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -233,12 +233,7 @@ def install_unittest_dependencies(session, *constraints):
233233
def unit(session, protobuf_implementation):
234234
# Install all test dependencies, then install this package in-place.
235235

236-
if protobuf_implementation == "cpp" and session.python in (
237-
"3.11",
238-
"3.12",
239-
"3.13",
240-
"3.14",
241-
):
236+
if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12", "3.13", "3.14"):
242237
session.skip("cpp implementation is not supported in python 3.11+")
243238

244239
constraints_path = str(
@@ -448,12 +443,7 @@ def docfx(session):
448443
def prerelease_deps(session, protobuf_implementation):
449444
"""Run all tests with prerelease versions of dependencies installed."""
450445

451-
if protobuf_implementation == "cpp" and session.python in (
452-
"3.11",
453-
"3.12",
454-
"3.13",
455-
"3.14",
456-
):
446+
if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12", "3.13", "3.14"):
457447
session.skip("cpp implementation is not supported in python 3.11+")
458448

459449
# Install all dependencies
@@ -465,6 +455,7 @@ def prerelease_deps(session, protobuf_implementation):
465455
)
466456
session.install(*system_deps_all)
467457

458+
468459
prerel_deps = [
469460
"protobuf",
470461
# dependency of grpc

0 commit comments

Comments
 (0)