Skip to content

Commit 6838b24

Browse files
authored
feat: Add Python 3.14 support (#327)
This PR adds support for Python 3.14 to the library. Key changes include: * Adding Python 3.14 to the test matrix in `.github/workflows/unittest.yml`, etc. * Updating `setup.py` to include the Python 3.14 classifier * Adding `testing/constraints-3.14.txt`. * Updating `noxfile.py` to include 3.14 sessions. * Updates `CONTRIBUTING.rst` to list Python 3.14 as a supported version. Towards internal issue: b/375664027
1 parent 0534ce2 commit 6838b24

File tree

6 files changed

+18
-9
lines changed

6 files changed

+18
-9
lines changed

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
- name: Setup Python
1313
uses: actions/setup-python@v5
1414
with:
15-
python-version: "3.8"
15+
python-version: "3.14"
1616
- name: Install nox
1717
run: |
1818
python -m pip install --upgrade setuptools pip wheel

.github/workflows/unittest.yml

Lines changed: 2 additions & 2 deletions
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
@@ -45,7 +45,7 @@ jobs:
4545
- name: Setup Python
4646
uses: actions/setup-python@v5
4747
with:
48-
python-version: "3.8"
48+
python-version: "3.14"
4949
- name: Install coverage
5050
run: |
5151
python -m pip install --upgrade setuptools pip wheel

CONTRIBUTING.rst

Lines changed: 3 additions & 1 deletion
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
@@ -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: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
ISORT_VERSION = "isort==5.11.0"
3333
LINT_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"]
3434

35-
DEFAULT_PYTHON_VERSION = "3.8"
35+
DEFAULT_PYTHON_VERSION = "3.14"
3636

3737
UNIT_TEST_PYTHON_VERSIONS: List[str] = [
3838
"3.7",
@@ -42,6 +42,7 @@
4242
"3.11",
4343
"3.12",
4444
"3.13",
45+
"3.14",
4546
]
4647
UNIT_TEST_STANDARD_DEPENDENCIES = [
4748
"mock",
@@ -56,7 +57,7 @@
5657
UNIT_TEST_EXTRAS: List[str] = []
5758
UNIT_TEST_EXTRAS_BY_PYTHON: Dict[str, List[str]] = {}
5859

59-
SYSTEM_TEST_PYTHON_VERSIONS: List[str] = ["3.8"]
60+
SYSTEM_TEST_PYTHON_VERSIONS: List[str] = ["3.12"]
6061
SYSTEM_TEST_STANDARD_DEPENDENCIES: List[str] = [
6162
"mock",
6263
"pytest",
@@ -135,7 +136,7 @@ def format(session):
135136
@nox.session(python=DEFAULT_PYTHON_VERSION)
136137
def lint_setup_py(session):
137138
"""Verify that setup.py is valid (including RST check)."""
138-
session.install("docutils", "pygments")
139+
session.install("docutils", "pygments", "setuptools")
139140
session.run("python", "setup.py", "check", "--restructuredtext", "--strict")
140141

141142

@@ -175,7 +176,12 @@ def install_unittest_dependencies(session, *constraints):
175176
def unit(session, protobuf_implementation):
176177
# Install all test dependencies, then install this package in-place.
177178

178-
if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12", "3.13"):
179+
if protobuf_implementation == "cpp" and session.python in (
180+
"3.11",
181+
"3.12",
182+
"3.13",
183+
"3.14",
184+
):
179185
session.skip("cpp implementation is not supported in python 3.11+")
180186

181187
constraints_path = str(
@@ -375,7 +381,7 @@ def docfx(session):
375381
)
376382

377383

378-
@nox.session(python="3.13")
384+
@nox.session(python="3.14")
379385
@nox.parametrize(
380386
"protobuf_implementation",
381387
["python", "upb", "cpp"],

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@
8181
"Programming Language :: Python :: 3.11",
8282
"Programming Language :: Python :: 3.12",
8383
"Programming Language :: Python :: 3.13",
84+
"Programming Language :: Python :: 3.14",
8485
"Operating System :: OS Independent",
8586
"Topic :: Internet",
8687
],

testing/constraints-3.14.txt

Whitespace-only changes.

0 commit comments

Comments
 (0)