Skip to content

Commit 78a48b0

Browse files
authored
fix(google-cloud-core): Drop support for Python 3.9 (googleapis#16953)
This PR updates \`google-cloud-core\` to establish Python 3.10 as the minimum supported version, dropping support for Python 3.7, 3.8, and 3.9. ### Changes * Configuration: Updated \`setup.py\` and \`noxfile.py\` to require Python 3.10+ and remove references to Python 3.9. * Documentation: Updated \`README.rst\` and \`CONTRIBUTING.rst\` to reflect supported Python versions. * Cleanup: Removed dead polyfill for \`importlib.metadata\` in \`google/cloud/obsolete/__init__.py\`. * Constraints: Transferred lower bounds to \`constraints-3.10.txt\` and dropped \`constraints-3.9.txt\`. * Fixes: Bumped \`grpcio\` to \`1.47.0\` to fix Python 3.10 build failures. Fixes internal issue: http://b/482126936 🦕
1 parent 5975c48 commit 78a48b0

9 files changed

Lines changed: 23 additions & 45 deletions

File tree

packages/google-cloud-core/CONTRIBUTING.rst

Lines changed: 1 addition & 14 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.9, 3.10, 3.11, 3.12, 3.13 and 3.14 on both UNIX and Windows.
25+
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
@@ -197,14 +197,12 @@ Supported Python Versions
197197

198198
We support:
199199

200-
- `Python 3.9`_
201200
- `Python 3.10`_
202201
- `Python 3.11`_
203202
- `Python 3.12`_
204203
- `Python 3.13`_
205204
- `Python 3.14`_
206205

207-
.. _Python 3.9: https://docs.python.org/3.9/
208206
.. _Python 3.10: https://docs.python.org/3.10/
209207
.. _Python 3.11: https://docs.python.org/3.11/
210208
.. _Python 3.12: https://docs.python.org/3.12/
@@ -217,17 +215,6 @@ Supported versions can be found in our ``noxfile.py`` `config`_.
217215
.. _config: https://github.com/googleapis/google-cloud-python/blob/main/noxfile.py
218216

219217

220-
We also explicitly decided to support Python 3 beginning with version 3.9.
221-
Reasons for this include:
222-
223-
- Encouraging use of newest versions of Python 3
224-
- Taking the lead of `prominent`_ open-source `projects`_
225-
- `Unicode literal support`_ which allows for a cleaner codebase that
226-
works in both Python 2 and Python 3
227-
228-
.. _prominent: https://docs.djangoproject.com/en/1.9/faq/install/#what-python-version-can-i-use-with-django
229-
.. _projects: http://flask.pocoo.org/docs/0.10/python3/
230-
.. _Unicode literal support: https://www.python.org/dev/peps/pep-0414/
231218

232219
**********
233220
Versioning

packages/google-cloud-core/README.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,8 @@ to `Python Development Environment Setup Guide`_ for Google Cloud Platform.
3232

3333
Supported Python Versions
3434
-------------------------
35-
Python >= 3.9
35+
Python >= 3.10
3636

3737
Unsupported Python Versions
3838
---------------------------
39-
40-
Python <= 3.8
39+
Python <= 3.9

packages/google-cloud-core/docs/README.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,8 @@ to `Python Development Environment Setup Guide`_ for Google Cloud Platform.
3232

3333
Supported Python Versions
3434
-------------------------
35-
Python >= 3.9
35+
Python >= 3.10
3636

3737
Unsupported Python Versions
3838
---------------------------
39-
40-
Python <= 3.8
39+
Python <= 3.9

packages/google-cloud-core/google/cloud/obsolete/__init__.py

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

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

17-
try:
18-
import importlib.metadata as metadata
19-
except ImportError:
20-
# For Python 3.7 compatibility
21-
import importlib_metadata as metadata # type: ignore[no-redef]
17+
import importlib.metadata as metadata
2218

2319
import warnings
2420

packages/google-cloud-core/noxfile.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626

2727
DEFAULT_PYTHON_VERSION = "3.14"
2828
UNIT_TEST_PYTHON_VERSIONS = [
29-
"3.9",
3029
"3.10",
3130
"3.11",
3231
"3.12",

packages/google-cloud-core/pytest.ini

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,9 @@ filterwarnings =
44
error
55
# Remove once https://github.com/protocolbuffers/protobuf/issues/12186 is fixed
66
ignore:.*custom tp_new.*in Python 3.14:DeprecationWarning
7-
# Remove after support for Python 3.7 is dropped
8-
ignore:After January 1, 2024, new releases of this library will drop support for Python 3.7:DeprecationWarning
97
# Remove once the minimum supported version of `google-api-core` is 2.15.0
108
ignore:.*pkg_resources.declare_namespace:DeprecationWarning
119
ignore:.*pkg_resources is deprecated as an API:DeprecationWarning
12-
# Remove after support for Python 3.8, 3.9 and/or 3.10+ is dropped
10+
# Remove after support for Python 3.10+ is dropped
1311
ignore:\s*You are using a (non-supported )?Python version \(?3\.(8|9|1[0-9]+):DeprecationWarning
1412
ignore:\s*You are using a (non-supported )?Python version \(?3\.(8|9|1[0-9]+):FutureWarning

packages/google-cloud-core/setup.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@
3333
]
3434
extras = {
3535
"grpc": [
36-
"grpcio >= 1.38.0, < 2.0.0; python_version < '3.14'",
36+
"grpcio >= 1.47.0, < 2.0.0; python_version < '3.14'",
3737
"grpcio >= 1.75.1, < 2.0.0; python_version >= '3.14'",
38-
"grpcio-status >= 1.38.0, < 2.0.0",
38+
"grpcio-status >= 1.47.0, < 2.0.0",
3939
],
4040
}
4141

@@ -75,7 +75,6 @@
7575
"License :: OSI Approved :: Apache Software License",
7676
"Programming Language :: Python",
7777
"Programming Language :: Python :: 3",
78-
"Programming Language :: Python :: 3.9",
7978
"Programming Language :: Python :: 3.10",
8079
"Programming Language :: Python :: 3.11",
8180
"Programming Language :: Python :: 3.12",
@@ -88,7 +87,7 @@
8887
packages=packages,
8988
install_requires=dependencies,
9089
extras_require=extras,
91-
python_requires=">=3.9",
90+
python_requires=">=3.10",
9291
include_package_data=True,
9392
zip_safe=False,
9493
)
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# This constraints file is used to check that lower bounds
2+
# are correct in setup.py
3+
# List *all* library dependencies and extras in this file.
4+
# Pin the version to the lower bound.
5+
#
6+
# e.g., if setup.py has "foo >= 1.14.0, < 2.0.0dev",
7+
# Then this file should have foo==1.14.0
8+
google-api-core==2.11.0
9+
google-auth==2.14.1
10+
grpcio==1.47.0
11+
grpcio-status==1.47.0
12+
# cryptography is a direct dependency of google-auth
13+
cryptography==38.0.3

packages/google-cloud-core/testing/constraints-3.9.txt

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)