Skip to content

Commit 760c06c

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. - 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 by correcting the regex.
1 parent ee497e7 commit 760c06c

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

noxfile.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,27 @@ def prerelease_deps(session, protobuf_implementation):
465465
)
466466
session.install(*system_deps_all)
467467

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+)", constraints_text, flags=re.MULTILINE
484+
)
485+
]
486+
487+
session.install(*constraints_deps)
488+
468489
prerel_deps = [
469490
"protobuf",
470491
# dependency of grpc

0 commit comments

Comments
 (0)