Skip to content

Commit c26e587

Browse files
feat: Add Python 3.14 support (#333)
* feat(ci): Add Python 3.14 support to owlbot.py * 🦉 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 * Apply suggestion from @chalmerlowe 3.7 is not supported in this repo. * Apply suggestion from @chalmerlowe * Apply suggestion from @chalmerlowe 3.7 is not supported in this repo. * fix(ci): Remove unit (3.7) from required checks * fix(coverage): Remove obsolete Python < 3.8 import logic * fix(coverage): Add no cover pragma for api_key import * fix(ci): Correct lint errors and coverage pragma case --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 78ce8a6 commit c26e587

File tree

9 files changed

+17
-18
lines changed

9 files changed

+17
-18
lines changed

.github/sync-repo-settings.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,13 @@ branchProtectionRules:
1111
# No Kokoro: the following are Github actions
1212
- 'mypy'
1313
- 'lint'
14-
- 'unit (3.7)'
1514
- 'unit (3.8)'
1615
- 'unit (3.9)'
1716
- 'unit (3.10)'
1817
- 'unit (3.11)'
1918
- 'unit (3.12)'
19+
- 'unit (3.13)'
20+
- 'unit (3.14)'
2021
- 'cover'
2122
- 'docs'
2223
- 'docfx'

.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.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: 5 additions & 5 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.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::
@@ -221,29 +221,29 @@ Supported Python Versions
221221

222222
We support:
223223

224-
- `Python 3.7`_
225224
- `Python 3.8`_
226225
- `Python 3.9`_
227226
- `Python 3.10`_
228227
- `Python 3.11`_
229228
- `Python 3.12`_
230229
- `Python 3.13`_
230+
- `Python 3.14`_
231231

232-
.. _Python 3.7: https://docs.python.org/3.7/
233232
.. _Python 3.8: https://docs.python.org/3.8/
234233
.. _Python 3.9: https://docs.python.org/3.9/
235234
.. _Python 3.10: https://docs.python.org/3.10/
236235
.. _Python 3.11: https://docs.python.org/3.11/
237236
.. _Python 3.12: https://docs.python.org/3.12/
238237
.. _Python 3.13: https://docs.python.org/3.13/
238+
.. _Python 3.14: https://docs.python.org/3.14/
239239

240240

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

243243
.. _config: https://github.com/googleapis/python-cloud-core/blob/main/noxfile.py
244244

245245

246-
We also explicitly decided to support Python 3 beginning with version 3.7.
246+
We also explicitly decided to support Python 3 beginning with version 3.8.
247247
Reasons for this include:
248248

249249
- Encouraging use of newest versions of Python 3

google/cloud/client/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,9 @@
3434
import google.auth.api_key
3535

3636
HAS_GOOGLE_AUTH_API_KEY = True
37-
except ImportError:
38-
HAS_GOOGLE_AUTH_API_KEY = False
37+
except ImportError: # pragma: NO COVER
38+
HAS_GOOGLE_AUTH_API_KEY = False # pragma: NO COVER
39+
# TODO: Investigate adding a test for google.auth.api_key ImportError (https://github.com/googleapis/python-cloud-core/issues/334)
3940

4041

4142
_GOOGLE_AUTH_CREDENTIALS_HELP = (

google/cloud/obsolete/__init__.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,10 @@
1414

1515
"""Helpers for deprecated code and modules."""
1616

17-
import sys
17+
import importlib.metadata as metadata
1818
import warnings
1919

2020

21-
if sys.version_info < (3, 8):
22-
import importlib_metadata as metadata
23-
else:
24-
import importlib.metadata as metadata
25-
26-
2721
def complain(distribution_name):
2822
"""Issue a warning if `distribution_name` is installed.
2923

noxfile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def default(session):
9696
)
9797

9898

99-
@nox.session(python=["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"])
99+
@nox.session(python=["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"])
100100
def unit(session):
101101
"""Default unit test session."""
102102
default(session)

owlbot.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
templated_files = common.py_library(
2727
microgenerator=True,
2828
cov_level=100,
29+
unit_test_python_versions=["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"],
2930
)
3031
s.move(
3132
templated_files,

setup.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@
3434
]
3535
extras = {
3636
"grpc": [
37-
"grpcio >= 1.38.0, < 2.0.0",
37+
"grpcio >= 1.38.0, < 2.0.0; python_version < '3.14'",
38+
"grpcio >= 1.75.1, < 2.0.0; python_version >= '3.14'",
3839
"grpcio-status >= 1.38.0, < 2.0.0",
3940
],
4041
}
@@ -82,6 +83,7 @@
8283
"Programming Language :: Python :: 3.11",
8384
"Programming Language :: Python :: 3.12",
8485
"Programming Language :: Python :: 3.13",
86+
"Programming Language :: Python :: 3.14",
8587
"Operating System :: OS Independent",
8688
"Topic :: Internet",
8789
],

testing/constraints-3.14.txt

Whitespace-only changes.

0 commit comments

Comments
 (0)