Skip to content

Commit 94fc6e3

Browse files
committed
tests: add Python 3.15 pre-release testing
1 parent 0258405 commit 94fc6e3

11 files changed

Lines changed: 58 additions & 41 deletions

File tree

.github/workflows/gapic-generator-tests.yml

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ env:
1818
SHOWCASE_VERSION: 0.35.0
1919
PROTOC_VERSION: 3.20.2
2020
LATEST_STABLE_PYTHON: 3.14
21-
ALL_PYTHON: "['3.10', '3.11', '3.12', '3.13', '3.14']"
21+
PREVIEW_PYTHON: 3.15
22+
ALL_PYTHON: "['3.10', '3.11', '3.12', '3.13', '3.14', '3.15']"
23+
TRIMMED_PYTHON: "['3.10', '3.14', '3.15']"
2224

2325
jobs:
2426
check_changes:
@@ -47,6 +49,8 @@ jobs:
4749
outputs:
4850
all_python: ${{ env.ALL_PYTHON }}
4951
latest_stable_python: ${{ env.LATEST_STABLE_PYTHON }}
52+
preview_python: ${{ env.PREVIEW_PYTHON }}
53+
trimmed_python: $${{ env.TRIMMED_PYTHON }}
5054
steps:
5155
- run: echo "Initializing config for gapic-generator"
5256

@@ -65,6 +69,16 @@ jobs:
6569
uses: actions/setup-python@v6
6670
with:
6771
python-version: "${{ matrix.python }}"
72+
allow-prereleases: true
73+
# Caches compiled wheels locally to prevent building heavy libraries
74+
# like grpcio from scratch on every run (critical for Python 3.15+
75+
cache: 'pip'
76+
cache-dependency-path: '**/requirements*.txt'
77+
# Workaround: Allows libcst to compile on Python 3.15+ while PyO3 catches up
78+
# Can be removed once libcst releases a version with native Python 3.15 wheels
79+
# Follow https://github.com/Instagram/LibCST/issues/1445
80+
env:
81+
PYO3_USE_ABI3_FORWARD_COMPATIBILITY: "1"
6882
- name: Install System Deps & Protoc
6983
run: |
7084
sudo apt-get update && sudo apt-get install -y curl pandoc unzip
@@ -132,10 +146,20 @@ jobs:
132146
runs-on: ubuntu-latest
133147
steps:
134148
- uses: actions/checkout@v6
135-
- name: Set up Python
149+
- name: Set up Python ${{ needs.python_config.outputs.preview_python }}
136150
uses: actions/setup-python@v6
137151
with:
138-
python-version: ${{ needs.python_config.outputs.latest_stable_python }}
152+
python-version: ${{ needs.python_config.outputs.preview_python }}
153+
allow-prereleases: true
154+
# Caches compiled wheels locally to prevent building heavy libraries
155+
# like grpcio from scratch on every run (critical for Python 3.15+
156+
cache: 'pip'
157+
cache-dependency-path: '**/requirements*.txt'
158+
# Workaround: Allows libcst to compile on Python 3.15+ while PyO3 catches up
159+
# Can be removed once libcst releases a version with native Python 3.15 wheels
160+
# Follow https://github.com/Instagram/LibCST/issues/1445
161+
env:
162+
PYO3_USE_ABI3_FORWARD_COMPATIBILITY: "1"
139163
- name: Install System Deps
140164
run: sudo apt-get update && sudo apt-get install -y pandoc
141165
- name: Run Goldens (Prerelease)
@@ -150,14 +174,24 @@ jobs:
150174
needs: python_config
151175
strategy:
152176
matrix:
153-
python: ["3.10", "3.14"]
177+
python: ${{ fromJSON(needs.python_config.outputs.trimmed_python) }}
154178
runs-on: ubuntu-latest
155179
steps:
156180
- uses: actions/checkout@v6
157181
- name: Set up Python
158182
uses: actions/setup-python@v6
159183
with:
160184
python-version: ${{ matrix.python }}
185+
allow-prereleases: true
186+
# Caches compiled wheels locally to prevent building heavy libraries
187+
# like grpcio from scratch on every run (critical for Python 3.15+
188+
cache: 'pip'
189+
cache-dependency-path: '**/requirements*.txt'
190+
# Workaround: Allows libcst to compile on Python 3.15+ while PyO3 catches up
191+
# Can be removed once libcst releases a version with native Python 3.15 wheels
192+
# Follow https://github.com/Instagram/LibCST/issues/1445
193+
env:
194+
PYO3_USE_ABI3_FORWARD_COMPATIBILITY: "1"
161195
# This fixes the Pandoc error
162196
- name: Install System Deps & Protoc
163197
run: |

packages/gapic-generator/gapic/templates/noxfile.py.j2

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,12 @@ ALL_PYTHON = [
3030
"3.12",
3131
"3.13",
3232
"3.14",
33+
"3.15",
3334
]
3435

3536
DEFAULT_PYTHON_VERSION = "3.14"
3637

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"
38+
PREVIEW_PYTHON_VERSION = "3.15"
4139

4240
CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute()
4341

packages/gapic-generator/noxfile.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,10 @@
5050
"3.12",
5151
"3.13",
5252
"3.14",
53+
"3.15",
5354
)
5455

55-
NEWEST_PYTHON = ALL_PYTHON[-1]
56+
NEWEST_PYTHON = ALL_PYTHON[-2]
5657

5758

5859
@nox.session(python=ALL_PYTHON)

packages/gapic-generator/tests/integration/goldens/asset/noxfile.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,12 @@
3737
"3.12",
3838
"3.13",
3939
"3.14",
40+
"3.15",
4041
]
4142

4243
DEFAULT_PYTHON_VERSION = "3.14"
4344

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"
45+
PREVIEW_PYTHON_VERSION = "3.15"
4846

4947
CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute()
5048

packages/gapic-generator/tests/integration/goldens/credentials/noxfile.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,12 @@
3737
"3.12",
3838
"3.13",
3939
"3.14",
40+
"3.15",
4041
]
4142

4243
DEFAULT_PYTHON_VERSION = "3.14"
4344

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"
45+
PREVIEW_PYTHON_VERSION = "3.15"
4846

4947
CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute()
5048

packages/gapic-generator/tests/integration/goldens/eventarc/noxfile.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,12 @@
3737
"3.12",
3838
"3.13",
3939
"3.14",
40+
"3.15",
4041
]
4142

4243
DEFAULT_PYTHON_VERSION = "3.14"
4344

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"
45+
PREVIEW_PYTHON_VERSION = "3.15"
4846

4947
CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute()
5048

packages/gapic-generator/tests/integration/goldens/logging/noxfile.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,12 @@
3737
"3.12",
3838
"3.13",
3939
"3.14",
40+
"3.15",
4041
]
4142

4243
DEFAULT_PYTHON_VERSION = "3.14"
4344

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"
45+
PREVIEW_PYTHON_VERSION = "3.15"
4846

4947
CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute()
5048

packages/gapic-generator/tests/integration/goldens/logging_internal/noxfile.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,12 @@
3737
"3.12",
3838
"3.13",
3939
"3.14",
40+
"3.15",
4041
]
4142

4243
DEFAULT_PYTHON_VERSION = "3.14"
4344

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"
45+
PREVIEW_PYTHON_VERSION = "3.15"
4846

4947
CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute()
5048

packages/gapic-generator/tests/integration/goldens/redis/noxfile.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,12 @@
3737
"3.12",
3838
"3.13",
3939
"3.14",
40+
"3.15",
4041
]
4142

4243
DEFAULT_PYTHON_VERSION = "3.14"
4344

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"
45+
PREVIEW_PYTHON_VERSION = "3.15"
4846

4947
CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute()
5048

packages/gapic-generator/tests/integration/goldens/redis_selective/noxfile.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,12 @@
3737
"3.12",
3838
"3.13",
3939
"3.14",
40+
"3.15",
4041
]
4142

4243
DEFAULT_PYTHON_VERSION = "3.14"
4344

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"
45+
PREVIEW_PYTHON_VERSION = "3.15"
4846

4947
CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute()
5048

0 commit comments

Comments
 (0)