Skip to content

feat(core): Drop support for Python 3.7, 3.8, and 3.9#16953

Open
chalmerlowe wants to merge 7 commits intomainfrom
feat/drop-python-3.7-3.9-google-cloud-core
Open

feat(core): Drop support for Python 3.7, 3.8, and 3.9#16953
chalmerlowe wants to merge 7 commits intomainfrom
feat/drop-python-3.7-3.9-google-cloud-core

Conversation

@chalmerlowe
Copy link
Copy Markdown
Contributor

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.

Verified successfully with 153 passing unit tests under Python 3.10!

Fixes internal issue: http://b/482126936 🦕

@chalmerlowe chalmerlowe requested a review from a team as a code owner May 5, 2026 20:12
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request drops support for Python 3.9, updating the minimum supported version to 3.10 across the package configuration and documentation. It also removes legacy Python 3.7 compatibility code and updates the minimum version for grpcio dependencies. Feedback includes ensuring that Python 3.13 and 3.14 are included in the unit test matrix and PyPI classifiers, as well as adding grpcio-status to the new constraints file to properly verify dependency lower bounds.

Comment on lines 28 to 30
"3.10",
"3.11",
"3.12",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The UNIT_TEST_PYTHON_VERSIONS list is missing Python 3.13 and 3.14. Since these versions are explicitly listed as supported in CONTRIBUTING.rst and 3.14 is designated as the DEFAULT_PYTHON_VERSION, they should be included in the unit test matrix to ensure compatibility is verified in CI. Please verify that these versions are not already present in the configuration list before applying this change.

Suggested change
"3.10",
"3.11",
"3.12",
"3.10",
"3.11",
"3.12",
"3.13",
"3.14",
References
  1. Verify that suggested additions to a configuration list (such as Python versions in a test matrix) are not already present in the file before recommending their inclusion to avoid false positive suggestions.
  2. Python 3.14 is a valid Python version and should be supported in configurations.

Comment on lines 78 to 80
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The PyPI classifiers are missing Python 3.13 and 3.14. To accurately reflect the supported versions mentioned in the documentation and other configuration files, please add these classifiers. This ensures the project's metadata in 'setup.py' is updated to reflect the supported Python versions consistently.

Suggested change
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
References
  1. When updating supported Python versions, ensure that the project's metadata in 'setup.py' or 'pyproject.toml' is also updated to reflect the same versions in Trove classifiers.

# Then this file should have foo==1.14.0
google-api-core==2.11.0
google-auth==2.14.1
grpcio==1.47.0
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The constraints file should include grpcio-status at its lower bound (1.47.0), as it is a dependency in the grpc extra and the file header specifies that all library dependencies and extras should be listed to ensure lower bounds are correctly tested. This ensures that testing minimum dependency versions does not inadvertently pull in newer transitive dependencies that could mask compatibility issues.

grpcio==1.47.0
grpcio-status==1.47.0
References
  1. When testing minimum dependency versions, use a minimal set of extras to avoid pulling in newer transitive dependencies that could mask compatibility issues.

@chalmerlowe chalmerlowe added this to the Drop support for 3.7-3.9 milestone May 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant