Skip to content

fix(db-dtypes): Drop support for Python <= 3.9#16966

Open
chalmerlowe wants to merge 6 commits intomainfrom
feat/drop-python-3.7-3.9-db-dtypes
Open

fix(db-dtypes): Drop support for Python <= 3.9#16966
chalmerlowe wants to merge 6 commits intomainfrom
feat/drop-python-3.7-3.9-db-dtypes

Conversation

@chalmerlowe
Copy link
Copy Markdown
Contributor

This PR updates `db-dtypes` 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 metadata and python_requires to >=3.10.
  • Nox: Updated noxfile.py sessions and deleted constraints-3.9.txt.
  • Documentation: Updated README.rst and CONTRIBUTING.rst (and synced to docs/README.rst!).
  • Removed extract_runtime_version and its helper file from db_dtypes
  • Updated the tests to mock sys.version_info correctly.

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

@chalmerlowe chalmerlowe changed the title fix(bigframes): Drop support for Python <= 3.9 fix(db-dtypes): Drop support for Python <= 3.9 May 6, 2026
@chalmerlowe chalmerlowe requested a review from a team May 6, 2026 16:40
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, CI configurations, and package metadata to reflect a new minimum requirement of Python 3.10. The runtime version check has been simplified by removing the _versions_helpers module and using sys.version_info directly. Feedback suggests moving the sys import to the top level for idiomatic consistency and ensuring that versioning follows standard policies when dropping support.

I am having trouble creating individual review comments. Click here to see my feedback.

packages/db-dtypes/db_dtypes/init.py (33)

medium

It is more idiomatic to import sys at the top level of the module rather than inside a function, especially for a lightweight standard library module. This also avoids re-importing it every time _check_python_version is called.

import sys

packages/db-dtypes/db_dtypes/init.py (343-345)

medium

The local import of sys can be removed if it is moved to the top level. Additionally, when updating the minimum supported Python version in runtime checks (e.g., sys.version_info), ensure that the project's metadata in setup.py or pyproject.toml is updated to reflect the same minimum version. If this change drops support for a Python version, prefer a minor version bump over a patch version bump.

    if sys.version_info < (3, 10):
References
  1. When updating the minimum supported Python version in runtime checks, ensure that the project's metadata in 'setup.py' or 'pyproject.toml' is also updated.
  2. When a release introduces breaking changes such as dropping support for specific Python versions, prefer a minor version bump over a patch version bump.

@chalmerlowe chalmerlowe marked this pull request as ready for review May 6, 2026 17:02
@chalmerlowe chalmerlowe requested review from a team as code owners May 6, 2026 17:02
@chalmerlowe chalmerlowe requested review from chelsea-lin and removed request for a team May 6, 2026 17:02
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