Skip to content

Commit 951dd32

Browse files
chore(python): Add support for Python 3.14 (#415)
* chore(python): Add support for Python 3.14 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * Apply suggestion from @chalmerlowe * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat(ci): Add Python 3.14 support to core files --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent cb74baf commit 951dd32

File tree

6 files changed

+27
-6
lines changed

6 files changed

+27
-6
lines changed

.github/workflows/unittest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: ubuntu-22.04
1212
strategy:
1313
matrix:
14-
python: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
14+
python: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13', '3.14']
1515
steps:
1616
- name: Checkout
1717
uses: actions/checkout@v4

CONTRIBUTING.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ In order to add a feature:
2222
documentation.
2323

2424
- The feature must work fully on the following CPython versions:
25-
3.7, 3.8, 3.9, 3.10, 3.11, 3.12 and 3.13 on both UNIX and Windows.
25+
3.7, 3.8, 3.9, 3.10, 3.11, 3.12, 3.13 and 3.14 on both UNIX and Windows.
2626

2727
- The feature must not add unnecessary dependencies (where
2828
"unnecessary" is of course subjective, but new dependencies should
@@ -72,7 +72,7 @@ We use `nox <https://nox.readthedocs.io/en/latest/>`__ to instrument our tests.
7272

7373
- To run a single unit test::
7474

75-
$ nox -s unit-3.13 -- -k <name of test>
75+
$ nox -s unit-3.14 -- -k <name of test>
7676

7777

7878
.. note::
@@ -228,6 +228,7 @@ We support:
228228
- `Python 3.11`_
229229
- `Python 3.12`_
230230
- `Python 3.13`_
231+
- `Python 3.14`_
231232

232233
.. _Python 3.7: https://docs.python.org/3.7/
233234
.. _Python 3.8: https://docs.python.org/3.8/
@@ -236,6 +237,7 @@ We support:
236237
.. _Python 3.11: https://docs.python.org/3.11/
237238
.. _Python 3.12: https://docs.python.org/3.12/
238239
.. _Python 3.13: https://docs.python.org/3.13/
240+
.. _Python 3.14: https://docs.python.org/3.14/
239241

240242

241243
Supported versions can be found in our ``noxfile.py`` `config`_.

noxfile.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
"3.11",
4646
"3.12",
4747
"3.13",
48+
"3.14",
4849
]
4950
UNIT_TEST_STANDARD_DEPENDENCIES = [
5051
"mock",
@@ -179,7 +180,12 @@ def install_unittest_dependencies(session, *constraints):
179180
def unit(session, protobuf_implementation):
180181
# Install all test dependencies, then install this package in-place.
181182

182-
if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12", "3.13"):
183+
if protobuf_implementation == "cpp" and session.python in (
184+
"3.11",
185+
"3.12",
186+
"3.13",
187+
"3.14",
188+
):
183189
session.skip("cpp implementation is not supported in python 3.11+")
184190

185191
constraints_path = str(
@@ -387,7 +393,12 @@ def docfx(session):
387393
def prerelease_deps(session, protobuf_implementation):
388394
"""Run all tests with prerelease versions of dependencies installed."""
389395

390-
if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12", "3.13"):
396+
if protobuf_implementation == "cpp" and session.python in (
397+
"3.11",
398+
"3.12",
399+
"3.13",
400+
"3.14",
401+
):
391402
session.skip("cpp implementation is not supported in python 3.11+")
392403

393404
# Install all dependencies

owlbot.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
microgenerator=True,
1111
cov_level=99,
1212
unit_test_external_dependencies=["click"],
13-
unit_test_python_versions=["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"],
13+
unit_test_python_versions=["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"],
1414
default_python_version="3.10",
1515
)
1616
s.move(templated_files, excludes=[
@@ -40,4 +40,11 @@
4040
'"--cov=google_auth_oauthlib",',
4141
)
4242

43+
# Skip Cpp Unittest in 3.11, 3.12, 3.13, and 3.14
44+
s.replace(
45+
"noxfile.py",
46+
'''session.python in \("3.11", "3.12", "3.13"\)''',
47+
'''session.python in ("3.11", "3.12", "3.13", "3.14")'''
48+
)
49+
4350
s.shell.run(["nox", "-s", "blacken"], hide_output=False)

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
"Programming Language :: Python :: 3.11",
6464
"Programming Language :: Python :: 3.12",
6565
"Programming Language :: Python :: 3.13",
66+
"Programming Language :: Python :: 3.14",
6667
"Development Status :: 5 - Production/Stable",
6768
"Intended Audience :: Developers",
6869
"License :: OSI Approved :: Apache Software License",

testing/constraints-3.14.txt

Whitespace-only changes.

0 commit comments

Comments
 (0)