Skip to content

Commit e83dbf1

Browse files
feat: Add Python 3.14 support and fix nox session
This commit adds support for Python 3.14 to the library and fixes a `ValueError` in the `prerelease_deps` nox session. 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. - 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 d710446 commit e83dbf1

File tree

1 file changed

+2
-32
lines changed

1 file changed

+2
-32
lines changed

noxfile.py

Lines changed: 2 additions & 32 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,26 +455,6 @@ def prerelease_deps(session, protobuf_implementation):
465455
)
466456
session.install(*system_deps_all)
467457

468-
# Because we test minimum dependency versions on the minimum Python
469-
# version, the first version we test with in the unit tests sessions has a
470-
# constraints file containing all dependencies and extras.
471-
with open(
472-
CURRENT_DIRECTORY
473-
/ "testing"
474-
/ f"constraints-{UNIT_TEST_PYTHON_VERSIONS[0]}.txt",
475-
encoding="utf-8",
476-
) as constraints_file:
477-
constraints_text = constraints_file.read()
478-
479-
# Ignore leading whitespace and comment lines.
480-
constraints_deps = [
481-
match.group(1)
482-
for match in re.finditer(
483-
r"^\s*(\S+)(?===\S+)", constraints_text, flags=re.MULTILINE
484-
)
485-
]
486-
487-
session.install(*constraints_deps)
488458

489459
prerel_deps = [
490460
"protobuf",

0 commit comments

Comments
 (0)