feat: Add support for Python 3.14 (#14723) · googleapis/google-cloud-python@5802b55
@@ -35,9 +35,15 @@
3535"3.11",
3636"3.12",
3737"3.13",
38+"3.14",
3839]
394040-DEFAULT_PYTHON_VERSION = ALL_PYTHON[-1]
41+DEFAULT_PYTHON_VERSION = "3.14"
42+43+# TODO(https://github.com/googleapis/gapic-generator-python/issues/2450):
44+# Switch this to Python 3.15 alpha1
45+# https://peps.python.org/pep-0790/
46+PREVIEW_PYTHON_VERSION = "3.14"
41474248CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute()
4349@@ -57,7 +63,7 @@
5763UNIT_TEST_EXTRAS: List[str] = []
5864UNIT_TEST_EXTRAS_BY_PYTHON: Dict[str, List[str]] = {}
596560-SYSTEM_TEST_PYTHON_VERSIONS: List[str] = ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
66+SYSTEM_TEST_PYTHON_VERSIONS: List[str] = ALL_PYTHON
6167SYSTEM_TEST_STANDARD_DEPENDENCIES = [
6268"mock",
6369"pytest",
@@ -222,15 +228,22 @@ def install_unittest_dependencies(session, *constraints):
222228def unit(session, protobuf_implementation):
223229# Install all test dependencies, then install this package in-place.
224230225-if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12", "3.13"):
231+# TODO(https://github.com/googleapis/gapic-generator-python/issues/2388):
232+# Remove this check once support for Protobuf 3.x is dropped.
233+if protobuf_implementation == "cpp" and session.python in (
234+"3.11",
235+"3.12",
236+"3.13",
237+"3.14",
238+ ):
226239session.skip("cpp implementation is not supported in python 3.11+")
227240228241constraints_path = str(
229242CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt"
230243 )
231244install_unittest_dependencies(session, "-c", constraints_path)
232245233-# TODO(https://github.com/googleapis/synthtool/issues/1976):
246+# TODO(https://github.com/googleapis/gapic-generator-python/issues/2388):
234247# Remove the 'cpp' implementation once support for Protobuf 3.x is dropped.
235248# The 'cpp' implementation requires Protobuf<4.
236249if protobuf_implementation == "cpp":
@@ -420,7 +433,7 @@ def docfx(session):
420433 )
421434422435423-@nox.session(python=DEFAULT_PYTHON_VERSION)
436+@nox.session(python=PREVIEW_PYTHON_VERSION)
424437@nox.parametrize(
425438 "protobuf_implementation",
426439 ["python", "upb", "cpp"],
@@ -433,7 +446,14 @@ def prerelease_deps(session, protobuf_implementation):
433446 `pip install --pre <package>`.
434447 """
435448436-if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12", "3.13"):
449+# TODO(https://github.com/googleapis/gapic-generator-python/issues/2388):
450+# Remove this check once support for Protobuf 3.x is dropped.
451+if protobuf_implementation == "cpp" and session.python in (
452+"3.11",
453+"3.12",
454+"3.13",
455+"3.14",
456+ ):
437457session.skip("cpp implementation is not supported in python 3.11+")
438458439459# Install all dependencies