Skip to content

Commit 3a854db

Browse files
authored
feat: Add support for Python 3.14 (#2451)
1 parent ccf132f commit 3a854db

File tree

21 files changed

+81
-29
lines changed

21 files changed

+81
-29
lines changed

.github/workflows/tests.yaml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,14 @@ env:
1717
SHOWCASE_VERSION: 0.35.0
1818
PROTOC_VERSION: 3.20.2
1919
OLDEST_PYTHON: 3.7
20-
LATEST_STABLE_PYTHON: 3.13
21-
PRE_RELEASE_PYTHON: 3.14
20+
LATEST_STABLE_PYTHON: 3.14
21+
# TODO(https://github.com/googleapis/gapic-generator-python/issues/2450):
22+
# Switch this to Python 3.15 alpha1 pre-release
23+
# https://peps.python.org/pep-0790/
24+
PREVIEW_PYTHON_VERSION: 3.14
25+
# TODO(https://github.com/googleapis/gapic-generator-python/issues/2450):
26+
# Add Python 3.15 alpha1 pre-release
27+
# https://peps.python.org/pep-0790/
2228
ALL_PYTHON: "['3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13', '3.14']"
2329

2430
permissions:
@@ -431,10 +437,10 @@ jobs:
431437
runs-on: ubuntu-latest
432438
steps:
433439
- uses: actions/checkout@v5
434-
- name: Set up Python ${{ env.PRE_RELEASE_PYTHON }}
440+
- name: Set up Python ${{ env.PREVIEW_PYTHON_VERSION }}
435441
uses: actions/setup-python@v6
436442
with:
437-
python-version: "${{ env.PRE_RELEASE_PYTHON }}"
443+
python-version: "${{ env.PREVIEW_PYTHON_VERSION }}"
438444
cache: 'pip'
439445
allow-prereleases: true
440446
- name: Install nox.

gapic/ads-templates/noxfile.py.j2

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ import os
77
import nox # type: ignore
88

99

10+
# TODO(https://github.com/googleapis/gapic-generator-python/issues/2450):
11+
# Add tests for Python 3.15 alpha1
12+
# https://peps.python.org/pep-0790/
1013
ALL_PYTHON = [
1114
"3.7",
1215
"3.8",
@@ -15,6 +18,7 @@ ALL_PYTHON = [
1518
"3.11",
1619
"3.12",
1720
"3.13",
21+
"3.14",
1822
]
1923

2024
@nox.session(python=ALL_PYTHON)

gapic/ads-templates/setup.py.j2

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ setuptools.setup(
7373
"Programming Language :: Python :: 3.11",
7474
"Programming Language :: Python :: 3.12",
7575
"Programming Language :: Python :: 3.13",
76+
"Programming Language :: Python :: 3.14",
7677
"Operating System :: OS Independent",
7778
"Topic :: Internet",
7879
],

gapic/templates/noxfile.py.j2

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,12 @@ ALL_PYTHON = [
3232
"3.14",
3333
]
3434

35-
DEFAULT_PYTHON_VERSION = ALL_PYTHON[-2]
36-
PRE_RELEASE_PYTHON = ALL_PYTHON[-1]
35+
DEFAULT_PYTHON_VERSION = "3.14"
36+
37+
# TODO(https://github.com/googleapis/gapic-generator-python/issues/2450):
38+
# Switch this to Python 3.15 alpha1
39+
# https://peps.python.org/pep-0790/
40+
PREVIEW_PYTHON_VERSION = "3.14"
3741

3842
CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute()
3943

@@ -429,7 +433,7 @@ def docfx(session):
429433
)
430434

431435

432-
@nox.session(python=PRE_RELEASE_PYTHON)
436+
@nox.session(python=PREVIEW_PYTHON_VERSION)
433437
@nox.parametrize(
434438
"protobuf_implementation",
435439
["python", "upb", "cpp"],

gapic/templates/setup.py.j2

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ setuptools.setup(
9696
"Programming Language :: Python :: 3.11",
9797
"Programming Language :: Python :: 3.12",
9898
"Programming Language :: Python :: 3.13",
99+
"Programming Language :: Python :: 3.14",
99100
"Operating System :: OS Independent",
100101
"Topic :: Internet",
101102
],

noxfile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"3.14",
4848
)
4949

50-
NEWEST_PYTHON = ALL_PYTHON[-2]
50+
NEWEST_PYTHON = ALL_PYTHON[-1]
5151

5252

5353
@nox.session(python=ALL_PYTHON)

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777
"Programming Language :: Python :: 3.11",
7878
"Programming Language :: Python :: 3.12",
7979
"Programming Language :: Python :: 3.13",
80+
"Programming Language :: Python :: 3.14",
8081
"Operating System :: OS Independent",
8182
"Topic :: Software Development :: Code Generators",
8283
"Topic :: Software Development :: Libraries :: Python Modules",

tests/integration/goldens/asset/noxfile.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,12 @@
3939
"3.14",
4040
]
4141

42-
DEFAULT_PYTHON_VERSION = ALL_PYTHON[-2]
43-
PRE_RELEASE_PYTHON = ALL_PYTHON[-1]
42+
DEFAULT_PYTHON_VERSION = "3.14"
43+
44+
# TODO(https://github.com/googleapis/gapic-generator-python/issues/2450):
45+
# Switch this to Python 3.15 alpha1
46+
# https://peps.python.org/pep-0790/
47+
PREVIEW_PYTHON_VERSION = "3.14"
4448

4549
CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute()
4650

@@ -423,7 +427,7 @@ def docfx(session):
423427
)
424428

425429

426-
@nox.session(python=PRE_RELEASE_PYTHON)
430+
@nox.session(python=PREVIEW_PYTHON_VERSION)
427431
@nox.parametrize(
428432
"protobuf_implementation",
429433
["python", "upb", "cpp"],

tests/integration/goldens/asset/setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@
9090
"Programming Language :: Python :: 3.11",
9191
"Programming Language :: Python :: 3.12",
9292
"Programming Language :: Python :: 3.13",
93+
"Programming Language :: Python :: 3.14",
9394
"Operating System :: OS Independent",
9495
"Topic :: Internet",
9596
],

tests/integration/goldens/credentials/noxfile.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,12 @@
3939
"3.14",
4040
]
4141

42-
DEFAULT_PYTHON_VERSION = ALL_PYTHON[-2]
43-
PRE_RELEASE_PYTHON = ALL_PYTHON[-1]
42+
DEFAULT_PYTHON_VERSION = "3.14"
43+
44+
# TODO(https://github.com/googleapis/gapic-generator-python/issues/2450):
45+
# Switch this to Python 3.15 alpha1
46+
# https://peps.python.org/pep-0790/
47+
PREVIEW_PYTHON_VERSION = "3.14"
4448

4549
CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute()
4650

@@ -423,7 +427,7 @@ def docfx(session):
423427
)
424428

425429

426-
@nox.session(python=PRE_RELEASE_PYTHON)
430+
@nox.session(python=PREVIEW_PYTHON_VERSION)
427431
@nox.parametrize(
428432
"protobuf_implementation",
429433
["python", "upb", "cpp"],

0 commit comments

Comments
 (0)