Skip to content

fix(api-core): drop support for Python 3.9#16980

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

fix(api-core): drop support for Python 3.9#16980
chalmerlowe wants to merge 17 commits intomainfrom
feat/drop-python-3.7-3.9-google-api-core

Conversation

@chalmerlowe
Copy link
Copy Markdown
Contributor

This PR updates google-api-core to establish Python 3.10 as the minimum supported version, dropping support for Python 3.9 and below.

Changes

Configuration: Updated pyproject.toml and noxfile.py to require Python 3.10+ and remove references to Python 3.7, 3.8, and 3.9. Updated README.rst and CONTRIBUTING.rst to reflect the new support status.
Cleanup: Removed aiter and anext polyfills in test_bidi_async.py and removed Python < 3.10 polyfills in _python_version_support.py.
Constraints & Dependencies:

  • Created constraints-3.10.txt using the old 3.9 constraints as a baseline.
  • Bumped grpcio to 1.80.0 and requests to 2.33.0 to avoid issues with pkg_resources and six warnings on Python 3.10.
  • Bumped google-auth to 2.35.0 to satisfy async_rest requirements.
    Fixes internal issue: http://b/482126936 🦕

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 documentation, metadata, and CI configurations to set the minimum requirement to Python 3.10. The changes include removing compatibility shims for older Python versions and refactoring logic to utilize features like match statements. Feedback indicates a potential regression in noxfile.py where the new match statement for legacy_proto does not explicitly handle False values, which could lead to assertion failures during testing.

Comment thread packages/google-api-core/noxfile.py
@chalmerlowe chalmerlowe added this to the Drop support for 3.7-3.9 milestone May 7, 2026
Comment thread packages/google-api-core/noxfile.py Outdated
Comment thread packages/google-api-core/testing/constraints-async-rest-3.10.txt
Comment thread packages/google-api-core/tests/asyncio/test_bidi_async.py Outdated
Comment thread packages/google-api-core/pyproject.toml Outdated
@parthea parthea changed the title feat(api-core): drop support for Python 3.7, 3.8, and 3.9 fix(api-core): drop support for Python 3.7, 3.8, and 3.9 May 7, 2026
@parthea parthea changed the title fix(api-core): drop support for Python 3.7, 3.8, and 3.9 fix(api-core): drop support for Python 3.9 May 7, 2026
@parthea parthea marked this pull request as ready for review May 7, 2026 18:56
@parthea parthea requested a review from a team as a code owner May 7, 2026 18:56
@chalmerlowe chalmerlowe marked this pull request as draft May 8, 2026 15:47
@chalmerlowe chalmerlowe marked this pull request as ready for review May 8, 2026 16:28
# limitations under the License.

"""AsyncIO helpers for :mod:`grpc` supporting 3.7+.
"""AsyncIO helpers for :mod:`grpc` supporting 3.10+.
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.

nit: Do we need to include the version here?

Suggested change
"""AsyncIO helpers for :mod:`grpc` supporting 3.10+.
"""AsyncIO helpers for :mod:`grpc`.

protobuf==4.25.8
google-auth==2.35.0
requests==2.33.0
grpcio==1.80.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.

The constraints file should have the minimum support version of grpcio. 1.80.0 is the latest. PTAL . Applies to packages/google-api-core/testing/constraints-async-rest-3.10.txt also

https://pypi.org/project/grpcio/#history

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.

2 participants