Skip to content

Commit bd8559a

Browse files
committed
add python 3.14
1 parent 70974c2 commit bd8559a

File tree

10 files changed

+103
-51
lines changed

10 files changed

+103
-51
lines changed

.github/workflows/tests.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ env:
1919
OLDEST_PYTHON: 3.7
2020
LATEST_STABLE_PYTHON: 3.13
2121
PRE_RELEASE_PYTHON: 3.14
22-
ALL_PYTHON: "['3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13']"
22+
ALL_PYTHON: "['3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13', '3.14']"
2323

2424
permissions:
2525
contents: read
@@ -83,6 +83,7 @@ jobs:
8383
with:
8484
python-version: "${{ matrix.python }}"
8585
cache: 'pip'
86+
allow-prereleases: true
8687
- name: Install nox.
8788
run: python -m pip install nox
8889
- name: Check type annotations.
@@ -200,6 +201,7 @@ jobs:
200201
with:
201202
python-version: "${{ matrix.python }}"
202203
cache: 'pip'
204+
allow-prereleases: true
203205
- name: Install system dependencies.
204206
run: |
205207
sudo apt-get update
@@ -305,6 +307,7 @@ jobs:
305307
with:
306308
python-version: "${{ matrix.python }}"
307309
cache: 'pip'
310+
allow-prereleases: true
308311
- name: Install pandoc
309312
run: |
310313
sudo apt-get update
@@ -320,7 +323,6 @@ jobs:
320323
matrix:
321324
python: ${{ fromJSON(needs.all_python_setup.outputs.all_python) }}
322325
variant: ['', _alternative_templates]
323-
324326
# TODO(https://github.com/googleapis/gapic-generator-python/issues/2303): use `ubuntu-latest` once this bug is fixed.
325327
# Use ubuntu-22.04 until Python 3.7 is removed from the test matrix
326328
runs-on: ubuntu-22.04
@@ -331,6 +333,7 @@ jobs:
331333
with:
332334
python-version: "${{ matrix.python }}"
333335
cache: 'pip'
336+
allow-prereleases: true
334337
- name: Install pandoc
335338
run: |
336339
sudo apt-get update

gapic/templates/noxfile.py.j2

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,11 @@ ALL_PYTHON = [
2929
"3.11",
3030
"3.12",
3131
"3.13",
32+
"3.14",
3233
]
3334

34-
DEFAULT_PYTHON_VERSION = ALL_PYTHON[-1]
35+
DEFAULT_PYTHON_VERSION = ALL_PYTHON[-2]
36+
PRE_RELEASE_PYTHON = ALL_PYTHON[-1]
3537

3638
CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute()
3739

@@ -51,7 +53,7 @@ UNIT_TEST_DEPENDENCIES: List[str] = []
5153
UNIT_TEST_EXTRAS: List[str] = []
5254
UNIT_TEST_EXTRAS_BY_PYTHON: Dict[str, List[str]] = {}
5355

54-
SYSTEM_TEST_PYTHON_VERSIONS: List[str] = ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
56+
SYSTEM_TEST_PYTHON_VERSIONS: List[str] = ALL_PYTHON
5557
SYSTEM_TEST_STANDARD_DEPENDENCIES = [
5658
"mock",
5759
"pytest",
@@ -223,15 +225,17 @@ def install_unittest_dependencies(session, *constraints):
223225
def unit(session, protobuf_implementation):
224226
# Install all test dependencies, then install this package in-place.
225227

226-
if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12", "3.13"):
228+
# TODO(https://github.com/googleapis/gapic-generator-python/issues/2388):
229+
# Remove this check once support for Protobuf 3.x is dropped.
230+
if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12", "3.13", "3.14"):
227231
session.skip("cpp implementation is not supported in python 3.11+")
228232

229233
constraints_path = str(
230234
CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt"
231235
)
232236
install_unittest_dependencies(session, "-c", constraints_path)
233237

234-
# TODO(https://github.com/googleapis/synthtool/issues/1976):
238+
# TODO(https://github.com/googleapis/gapic-generator-python/issues/2388):
235239
# Remove the 'cpp' implementation once support for Protobuf 3.x is dropped.
236240
# The 'cpp' implementation requires Protobuf<4.
237241
if protobuf_implementation == "cpp":
@@ -425,7 +429,7 @@ def docfx(session):
425429
)
426430

427431

428-
@nox.session(python=DEFAULT_PYTHON_VERSION)
432+
@nox.session(python=PRE_RELEASE_PYTHON)
429433
@nox.parametrize(
430434
"protobuf_implementation",
431435
["python", "upb", "cpp"],
@@ -438,7 +442,9 @@ def prerelease_deps(session, protobuf_implementation):
438442
`pip install --pre <package>`.
439443
"""
440444

441-
if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12", "3.13"):
445+
# TODO(https://github.com/googleapis/gapic-generator-python/issues/2388):
446+
# Remove this check once support for Protobuf 3.x is dropped.
447+
if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12", "3.13", "3.14"):
442448
session.skip("cpp implementation is not supported in python 3.11+")
443449

444450
# Install all dependencies

noxfile.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,10 @@
4444
"3.11",
4545
"3.12",
4646
"3.13",
47+
"3.14",
4748
)
4849

49-
NEWEST_PYTHON = ALL_PYTHON[-1]
50+
NEWEST_PYTHON = ALL_PYTHON[-2]
5051

5152

5253
@nox.session(python=ALL_PYTHON)

tests/integration/goldens/asset/noxfile.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,11 @@
3636
"3.11",
3737
"3.12",
3838
"3.13",
39+
"3.14",
3940
]
4041

41-
DEFAULT_PYTHON_VERSION = ALL_PYTHON[-1]
42+
DEFAULT_PYTHON_VERSION = ALL_PYTHON[-2]
43+
PRE_RELEASE_PYTHON = ALL_PYTHON[-1]
4244

4345
CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute()
4446

@@ -58,7 +60,7 @@
5860
UNIT_TEST_EXTRAS: List[str] = []
5961
UNIT_TEST_EXTRAS_BY_PYTHON: Dict[str, List[str]] = {}
6062

61-
SYSTEM_TEST_PYTHON_VERSIONS: List[str] = ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
63+
SYSTEM_TEST_PYTHON_VERSIONS: List[str] = ALL_PYTHON
6264
SYSTEM_TEST_STANDARD_DEPENDENCIES = [
6365
"mock",
6466
"pytest",
@@ -222,15 +224,17 @@ def install_unittest_dependencies(session, *constraints):
222224
def unit(session, protobuf_implementation):
223225
# Install all test dependencies, then install this package in-place.
224226

225-
if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12", "3.13"):
227+
# TODO(https://github.com/googleapis/gapic-generator-python/issues/2388):
228+
# Remove this check once support for Protobuf 3.x is dropped.
229+
if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12", "3.13", "3.14"):
226230
session.skip("cpp implementation is not supported in python 3.11+")
227231

228232
constraints_path = str(
229233
CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt"
230234
)
231235
install_unittest_dependencies(session, "-c", constraints_path)
232236

233-
# TODO(https://github.com/googleapis/synthtool/issues/1976):
237+
# TODO(https://github.com/googleapis/gapic-generator-python/issues/2388):
234238
# Remove the 'cpp' implementation once support for Protobuf 3.x is dropped.
235239
# The 'cpp' implementation requires Protobuf<4.
236240
if protobuf_implementation == "cpp":
@@ -419,7 +423,7 @@ def docfx(session):
419423
)
420424

421425

422-
@nox.session(python=DEFAULT_PYTHON_VERSION)
426+
@nox.session(python=PRE_RELEASE_PYTHON)
423427
@nox.parametrize(
424428
"protobuf_implementation",
425429
["python", "upb", "cpp"],
@@ -432,7 +436,9 @@ def prerelease_deps(session, protobuf_implementation):
432436
`pip install --pre <package>`.
433437
"""
434438

435-
if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12", "3.13"):
439+
# TODO(https://github.com/googleapis/gapic-generator-python/issues/2388):
440+
# Remove this check once support for Protobuf 3.x is dropped.
441+
if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12", "3.13", "3.14"):
436442
session.skip("cpp implementation is not supported in python 3.11+")
437443

438444
# Install all dependencies

tests/integration/goldens/credentials/noxfile.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,11 @@
3636
"3.11",
3737
"3.12",
3838
"3.13",
39+
"3.14",
3940
]
4041

41-
DEFAULT_PYTHON_VERSION = ALL_PYTHON[-1]
42+
DEFAULT_PYTHON_VERSION = ALL_PYTHON[-2]
43+
PRE_RELEASE_PYTHON = ALL_PYTHON[-1]
4244

4345
CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute()
4446

@@ -58,7 +60,7 @@
5860
UNIT_TEST_EXTRAS: List[str] = []
5961
UNIT_TEST_EXTRAS_BY_PYTHON: Dict[str, List[str]] = {}
6062

61-
SYSTEM_TEST_PYTHON_VERSIONS: List[str] = ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
63+
SYSTEM_TEST_PYTHON_VERSIONS: List[str] = ALL_PYTHON
6264
SYSTEM_TEST_STANDARD_DEPENDENCIES = [
6365
"mock",
6466
"pytest",
@@ -222,15 +224,17 @@ def install_unittest_dependencies(session, *constraints):
222224
def unit(session, protobuf_implementation):
223225
# Install all test dependencies, then install this package in-place.
224226

225-
if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12", "3.13"):
227+
# TODOhttps://github.com/googleapis/gapic-generator-python/issues/2388):
228+
# Remove this check once support for Protobuf 3.x is dropped.
229+
if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12", "3.13", "3.14"):
226230
session.skip("cpp implementation is not supported in python 3.11+")
227231

228232
constraints_path = str(
229233
CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt"
230234
)
231235
install_unittest_dependencies(session, "-c", constraints_path)
232236

233-
# TODO(https://github.com/googleapis/synthtool/issues/1976):
237+
# TODO(https://github.com/googleapis/gapic-generator-python/issues/2388):
234238
# Remove the 'cpp' implementation once support for Protobuf 3.x is dropped.
235239
# The 'cpp' implementation requires Protobuf<4.
236240
if protobuf_implementation == "cpp":
@@ -419,7 +423,7 @@ def docfx(session):
419423
)
420424

421425

422-
@nox.session(python=DEFAULT_PYTHON_VERSION)
426+
@nox.session(python=PRE_RELEASE_PYTHON)
423427
@nox.parametrize(
424428
"protobuf_implementation",
425429
["python", "upb", "cpp"],
@@ -432,7 +436,9 @@ def prerelease_deps(session, protobuf_implementation):
432436
`pip install --pre <package>`.
433437
"""
434438

435-
if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12", "3.13"):
439+
# TODO(https://github.com/googleapis/gapic-generator-python/issues/2388):
440+
# Remove this check once support for Protobuf 3.x is dropped.
441+
if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12", "3.13", "3.14"):
436442
session.skip("cpp implementation is not supported in python 3.11+")
437443

438444
# Install all dependencies

tests/integration/goldens/eventarc/noxfile.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,11 @@
3636
"3.11",
3737
"3.12",
3838
"3.13",
39+
"3.14",
3940
]
4041

41-
DEFAULT_PYTHON_VERSION = ALL_PYTHON[-1]
42+
DEFAULT_PYTHON_VERSION = ALL_PYTHON[-2]
43+
PRE_RELEASE_PYTHON = ALL_PYTHON[-1]
4244

4345
CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute()
4446

@@ -58,7 +60,7 @@
5860
UNIT_TEST_EXTRAS: List[str] = []
5961
UNIT_TEST_EXTRAS_BY_PYTHON: Dict[str, List[str]] = {}
6062

61-
SYSTEM_TEST_PYTHON_VERSIONS: List[str] = ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
63+
SYSTEM_TEST_PYTHON_VERSIONS: List[str] = ALL_PYTHON
6264
SYSTEM_TEST_STANDARD_DEPENDENCIES = [
6365
"mock",
6466
"pytest",
@@ -222,15 +224,17 @@ def install_unittest_dependencies(session, *constraints):
222224
def unit(session, protobuf_implementation):
223225
# Install all test dependencies, then install this package in-place.
224226

225-
if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12", "3.13"):
227+
# TODO(https://github.com/googleapis/gapic-generator-python/issues/2388):
228+
# Remove this check once support for Protobuf 3.x is dropped.
229+
if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12", "3.13", "3.14"):
226230
session.skip("cpp implementation is not supported in python 3.11+")
227231

228232
constraints_path = str(
229233
CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt"
230234
)
231235
install_unittest_dependencies(session, "-c", constraints_path)
232236

233-
# TODO(https://github.com/googleapis/synthtool/issues/1976):
237+
# TODO(https://github.com/googleapis/gapic-generator-python/issues/2388):
234238
# Remove the 'cpp' implementation once support for Protobuf 3.x is dropped.
235239
# The 'cpp' implementation requires Protobuf<4.
236240
if protobuf_implementation == "cpp":
@@ -419,7 +423,7 @@ def docfx(session):
419423
)
420424

421425

422-
@nox.session(python=DEFAULT_PYTHON_VERSION)
426+
@nox.session(python=PRE_RELEASE_PYTHON)
423427
@nox.parametrize(
424428
"protobuf_implementation",
425429
["python", "upb", "cpp"],
@@ -432,7 +436,9 @@ def prerelease_deps(session, protobuf_implementation):
432436
`pip install --pre <package>`.
433437
"""
434438

435-
if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12", "3.13"):
439+
# TODO(https://github.com/googleapis/gapic-generator-python/issues/2388):
440+
# Remove this check once support for Protobuf 3.x is dropped.
441+
if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12", "3.13", "3.14"):
436442
session.skip("cpp implementation is not supported in python 3.11+")
437443

438444
# Install all dependencies

tests/integration/goldens/logging/noxfile.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,11 @@
3636
"3.11",
3737
"3.12",
3838
"3.13",
39+
"3.14",
3940
]
4041

41-
DEFAULT_PYTHON_VERSION = ALL_PYTHON[-1]
42+
DEFAULT_PYTHON_VERSION = ALL_PYTHON[-2]
43+
PRE_RELEASE_PYTHON = ALL_PYTHON[-1]
4244

4345
CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute()
4446

@@ -58,7 +60,7 @@
5860
UNIT_TEST_EXTRAS: List[str] = []
5961
UNIT_TEST_EXTRAS_BY_PYTHON: Dict[str, List[str]] = {}
6062

61-
SYSTEM_TEST_PYTHON_VERSIONS: List[str] = ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
63+
SYSTEM_TEST_PYTHON_VERSIONS: List[str] = ALL_PYTHON
6264
SYSTEM_TEST_STANDARD_DEPENDENCIES = [
6365
"mock",
6466
"pytest",
@@ -222,15 +224,17 @@ def install_unittest_dependencies(session, *constraints):
222224
def unit(session, protobuf_implementation):
223225
# Install all test dependencies, then install this package in-place.
224226

225-
if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12", "3.13"):
227+
# TODO(https://github.com/googleapis/gapic-generator-python/issues/2388):
228+
# Remove this check once support for Protobuf 3.x is dropped.
229+
if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12", "3.13", "3.14"):
226230
session.skip("cpp implementation is not supported in python 3.11+")
227231

228232
constraints_path = str(
229233
CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt"
230234
)
231235
install_unittest_dependencies(session, "-c", constraints_path)
232236

233-
# TODO(https://github.com/googleapis/synthtool/issues/1976):
237+
# TODO(https://github.com/googleapis/gapic-generator-python/issues/2388):
234238
# Remove the 'cpp' implementation once support for Protobuf 3.x is dropped.
235239
# The 'cpp' implementation requires Protobuf<4.
236240
if protobuf_implementation == "cpp":
@@ -419,7 +423,7 @@ def docfx(session):
419423
)
420424

421425

422-
@nox.session(python=DEFAULT_PYTHON_VERSION)
426+
@nox.session(python=PRE_RELEASE_PYTHON)
423427
@nox.parametrize(
424428
"protobuf_implementation",
425429
["python", "upb", "cpp"],
@@ -432,7 +436,9 @@ def prerelease_deps(session, protobuf_implementation):
432436
`pip install --pre <package>`.
433437
"""
434438

435-
if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12", "3.13"):
439+
# TODO(https://github.com/googleapis/gapic-generator-python/issues/2388):
440+
# Remove this check once support for Protobuf 3.x is dropped.
441+
if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12", "3.13", "3.14"):
436442
session.skip("cpp implementation is not supported in python 3.11+")
437443

438444
# Install all dependencies

0 commit comments

Comments
 (0)