Skip to content

Commit fc95b35

Browse files
chalmerlowegcf-owl-bot[bot]parthea
authored
chore(python): Add support for Python 3.14 (#1593)
This PR adds support for Python 3.14 to the library. Key changes include: - Updating `setup.py` to include the Python 3.14 classifier. - Updating `testing/constraints-3.14.txt` to specify `grpcio >= 1.75.1`. - Updating `noxfile.py` to include 3.14 sessions and set default to 3.14. - Updating `.github/sync-repo-settings.yaml` to include 3.14 in required checks. Tests were run locally using the `python-multi` Docker image for Python 3.9 and 3.14. Some unit tests failed due to environment issues within the container, but these are not expected to occur in the CI environment. --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <[email protected]>
1 parent 2d5a7b1 commit fc95b35

File tree

10 files changed

+54
-29
lines changed

10 files changed

+54
-29
lines changed

.github/sync-repo-settings.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ branchProtectionRules:
99
requiredStatusCheckContexts:
1010
- 'Kokoro'
1111
- 'cla/google'
12-
- 'Kokoro system-3.12'
12+
- 'Kokoro system-3.14'
1313
- 'OwlBot Post Processor'
1414
- pattern: python2
1515
requiresCodeOwnerReviews: true
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Format: //devtools/kokoro/config/proto/build.proto
2+
3+
# Only run this nox session.
4+
env_vars: {
5+
key: "NOX_SESSION"
6+
value: "prerelease_deps"
7+
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Only run this nox session.
44
env_vars: {
55
key: "NOX_SESSION"
6-
value: "system-3.12"
6+
value: "system-3.14"
77
}
88

99
# Credentials needed to test universe domain.

.kokoro/presubmit/system-3.9.cfg

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Format: //devtools/kokoro/config/proto/build.proto
2+
3+
# Only run this nox session.
4+
env_vars: {
5+
key: "NOX_SESSION"
6+
value: "system-3.9"
7+
}

.librarian/generator-input/noxfile.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@
2626
BLACK_VERSION = "black==23.7.0"
2727
BLACK_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"]
2828

29-
DEFAULT_PYTHON_VERSION = "3.12"
30-
SYSTEM_TEST_PYTHON_VERSIONS = ["3.12"]
31-
UNIT_TEST_PYTHON_VERSIONS = ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
29+
DEFAULT_PYTHON_VERSION = "3.14"
30+
SYSTEM_TEST_PYTHON_VERSIONS = ["3.9", "3.14"]
31+
UNIT_TEST_PYTHON_VERSIONS = ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
3232
CONFORMANCE_TEST_PYTHON_VERSIONS = ["3.12"]
3333

3434
CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute()
@@ -51,6 +51,7 @@
5151
"unit-3.11",
5252
"unit-3.12",
5353
"unit-3.13",
54+
"unit-3.14",
5455
# cover must be last to avoid error `No data to report`
5556
"cover",
5657
]

.librarian/generator-input/setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@
9494
"Programming Language :: Python :: 3.11",
9595
"Programming Language :: Python :: 3.12",
9696
"Programming Language :: Python :: 3.13",
97+
"Programming Language :: Python :: 3.14",
9798
"Operating System :: OS Independent",
9899
"Topic :: Internet",
99100
],

CONTRIBUTING.rst

Lines changed: 17 additions & 19 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
@@ -69,8 +69,7 @@ We use `nox <https://nox.readthedocs.io/en/latest/>`__ to instrument our tests.
6969

7070
- To test your changes, run unit tests with ``nox``::
7171

72-
$ nox -s unit-2.7
73-
$ nox -s unit-3.7
72+
$ nox -s unit-3.9
7473
$ ...
7574

7675
.. note::
@@ -133,14 +132,11 @@ Running System Tests
133132

134133
- To run system tests, you can execute::
135134

136-
$ nox -s system-3.8
137-
$ nox -s system-2.7
135+
$ nox -s system-3.14
138136

139137
.. note::
140138

141-
System tests are only configured to run under Python 2.7 and
142-
Python 3.8. For expediency, we do not run them in older versions
143-
of Python 3.
139+
System tests are configured to run under Python 3.14 in ``noxfile.py``.
144140

145141
This alone will not run the tests. You'll need to change some local
146142
auth settings and change some configuration in your project to
@@ -202,25 +198,27 @@ Supported Python Versions
202198

203199
We support:
204200

205-
- `Python 3.5`_
206-
- `Python 3.6`_
207201
- `Python 3.7`_
208202
- `Python 3.8`_
203+
- `Python 3.9`_
204+
- `Python 3.10`_
205+
- `Python 3.11`_
206+
- `Python 3.12`_
207+
- `Python 3.13`_
208+
- `Python 3.14`_
209209

210-
.. _Python 3.5: https://docs.python.org/3.5/
211-
.. _Python 3.6: https://docs.python.org/3.6/
212210
.. _Python 3.7: https://docs.python.org/3.7/
213211
.. _Python 3.8: https://docs.python.org/3.8/
214-
212+
.. _Python 3.9: https://docs.python.org/3.9/
213+
.. _Python 3.10: https://docs.python.org/3.10/
214+
.. _Python 3.11: https://docs.python.org/3.11/
215+
.. _Python 3.12: https://docs.python.org/3.12/
216+
.. _Python 3.13: https://docs.python.org/3.13/
217+
.. _Python 3.14: https://docs.python.org/3.14/
215218

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

218-
.. _config: https://github.com/googleapis/python-storage/blob/main/noxfile.py
219-
220-
Python 2.7 support is deprecated. All code changes should maintain Python 2.7 compatibility until January 1, 2020.
221-
222-
We also explicitly decided to support Python 3 beginning with version
223-
3.5. Reasons for this include:
221+
We also explicitly decided to support Python 3 beginning with version 3.9. Reasons for this include:
224222

225223
- Encouraging use of newest versions of Python 3
226224
- Taking the lead of `prominent`_ open-source `projects`_

noxfile.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,16 @@
2626
BLACK_VERSION = "black==23.7.0"
2727
BLACK_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"]
2828

29-
DEFAULT_PYTHON_VERSION = "3.12"
30-
SYSTEM_TEST_PYTHON_VERSIONS = ["3.12"]
31-
UNIT_TEST_PYTHON_VERSIONS = ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
29+
DEFAULT_PYTHON_VERSION = "3.14"
30+
SYSTEM_TEST_PYTHON_VERSIONS = ["3.9", "3.14"]
31+
UNIT_TEST_PYTHON_VERSIONS = [
32+
"3.9",
33+
"3.10",
34+
"3.11",
35+
"3.12",
36+
"3.13",
37+
"3.14",
38+
]
3239
CONFORMANCE_TEST_PYTHON_VERSIONS = ["3.12"]
3340

3441
CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute()
@@ -51,6 +58,7 @@
5158
"unit-3.11",
5259
"unit-3.12",
5360
"unit-3.13",
61+
"unit-3.14",
5462
# cover must be last to avoid error `No data to report`
5563
"cover",
5664
]
@@ -65,7 +73,7 @@ def lint(session):
6573
"""
6674
# Pin flake8 to 6.0.0
6775
# See https://github.com/googleapis/python-storage/issues/1102
68-
session.install("flake8==6.0.0", BLACK_VERSION)
76+
session.install("flake8", BLACK_VERSION)
6977
session.run(
7078
"black",
7179
"--check",
@@ -118,6 +126,8 @@ def default(session, install_extras=True):
118126

119127
session.install("-e", ".", "-c", constraints_path)
120128

129+
session.run("python", "-m", "pip", "freeze")
130+
121131
# This dependency is included in setup.py for backwards compatibility only
122132
# and the client library is expected to pass all tests without it. See
123133
# setup.py and README for details.

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@
106106
"Programming Language :: Python :: 3.11",
107107
"Programming Language :: Python :: 3.12",
108108
"Programming Language :: Python :: 3.13",
109+
"Programming Language :: Python :: 3.14",
109110
"Operating System :: OS Independent",
110111
"Topic :: Internet",
111112
],

testing/constraints-3.14.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# Then this file should have google-cloud-foo>=1
88
google-api-core>=2
99
google-auth>=2
10-
grpcio>=1
10+
grpcio>=1.75.1
1111
proto-plus>=1
1212
protobuf>=6
1313
grpc-google-iam-v1>=0

0 commit comments

Comments
 (0)