Skip to content

fix: Require Python 3.9#16102

Draft
parthea wants to merge 6 commits intomainfrom
require-python-39
Draft

fix: Require Python 3.9#16102
parthea wants to merge 6 commits intomainfrom
require-python-39

Conversation

@parthea
Copy link
Contributor

@parthea parthea commented Mar 13, 2026

No description provided.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request systematically updates the Python version requirements across multiple packages within the repository. The core objective is to deprecate support for Python 3.7 and 3.8, establishing Python 3.9 as the new minimum supported version. This change is reflected in various configuration files, build scripts, and documentation, ensuring consistency with current Python ecosystem standards and end-of-life policies. The update also includes a simplification of testing configurations by removing specific protobuf implementation tests that are no longer relevant or supported.

Highlights

  • Python Version Update: The minimum required Python version for several packages has been updated from Python 3.7 or 3.8 to Python 3.9, aligning with Python's end-of-life cycles.
  • Testing Configuration Simplification: Noxfile configurations across various packages were updated to remove Python 3.7 and 3.8 from unit and system test versions. Additionally, the 'cpp' protobuf implementation was removed from testing parameters, simplifying test matrices.
  • Documentation and Metadata Updates: Project documentation (CONTRIBUTING.rst, README.rst) and setup.py files were updated to reflect the new Python 3.9 requirement, including changes to classifiers and python_requires metadata.
  • Dependency Constraints Management: Constraints files for Python 3.7 and 3.8 were removed, and the constraints-3.9.txt files were updated or created to reflect the new minimum dependency versions for Python 3.9.
Changelog
  • packages/bigquery-magics/CONTRIBUTING.rst
    • Removed 'Samples and code snippets' section.
  • packages/bigquery-magics/mypy.ini
    • Updated 'python_version' from '3.8' to '3.14'.
  • packages/bigquery-magics/noxfile.py
    • Removed Python 3.8 from 'UNIT_TEST_PYTHON_VERSIONS'.
    • Removed 'ALL_PYTHON' variable and its extension with '3.7'.
    • Simplified 'unit' session by removing 'protobuf_implementation' parametrization and related conditional skips and environment variables.
    • Simplified 'prerelease_deps' session by removing 'protobuf_implementation' parametrization and related conditional skips and environment variables.
  • packages/bigquery-magics/setup.py
    • Removed 'Programming Language :: Python :: 3.8' classifier.
    • Updated 'python_requires' from '>=3.8' to '>=3.9'.
  • packages/bigquery-magics/testing/constraints-3.8.txt
    • Removed file.
  • packages/bigquery-magics/testing/constraints-3.9.txt
    • Added 'packaging=20.0.0' to constraints.
  • packages/db-dtypes/CONTRIBUTING.rst
    • Updated supported CPython versions list, removing Python 3.8.
    • Removed 'Samples and code snippets' section.
    • Updated explicit support statement from Python 3.7 to Python 3.9.
  • packages/db-dtypes/noxfile.py
    • Removed Python 3.8 from 'UNIT_TEST_PYTHON_VERSIONS'.
    • Removed 'ALL_PYTHON' variable and its extension with '3.7'.
    • Removed TODO comment related to 'owlbot-python' docker image and Python 3.8.
    • Updated 'unit' session to use 'UNIT_TEST_PYTHON_VERSIONS' and removed Python 3.7 skip.
  • packages/db-dtypes/setup.py
    • Removed 'Programming Language :: Python :: 3.8' classifier.
    • Updated 'python_requires' from '>=3.8' to '>=3.9'.
  • packages/db-dtypes/testing/constraints-3.8.txt
    • Removed file.
  • packages/db-dtypes/testing/constraints-3.9.txt
    • Added content for constraints.
  • packages/google-auth-httplib2/noxfile.py
    • Removed Python 3.7 and 3.8 from 'UNIT_TEST_PYTHON_VERSIONS'.
  • packages/google-auth-httplib2/setup.py
    • Updated 'python_requires' from '>=3.7' to '>=3.9'.
    • Removed 'Programming Language :: Python :: 3.7' and '3.8' classifiers.
  • packages/google-auth-httplib2/testing/constraints-3.7.txt
    • Removed file.
  • packages/google-auth-httplib2/testing/constraints-3.9.txt
    • Added content for constraints.
  • packages/google-auth-oauthlib/CONTRIBUTING.rst
    • Updated supported CPython versions list, removing Python 3.7 and 3.8.
    • Updated system test command example from 'system-3.8' to 'system-3.12'.
    • Updated note about system tests running under Python 3.8 to Python 3.12.
    • Removed 'Samples and code snippets' section.
    • Updated explicit support statement from Python 3.7 to Python 3.9.
  • packages/google-auth-oauthlib/README.rst
    • Updated supported Python versions from '>= 3.7' to '>= 3.9'.
    • Updated unsupported Python versions from '< 3.7' to '<= 3.8'.
    • Removed specific notes about last compatible versions for Python 2.7, 3.5, and 3.6.
  • packages/google-auth-oauthlib/noxfile.py
    • Removed TODO comment about Python 3.7/3.8 testing.
    • Removed Python 3.7 and 3.8 from 'UNIT_TEST_PYTHON_VERSIONS'.
    • Simplified 'unit' session by removing 'protobuf_implementation' parametrization and related conditional skips and environment variables.
  • packages/google-auth-oauthlib/setup.py
    • Updated 'python_requires' from '>=3.7' to '>=3.9'.
    • Removed 'Programming Language :: Python :: 3.7' and '3.8' classifiers.
  • packages/google-auth-oauthlib/testing/constraints-3.7.txt
    • Removed file.
  • packages/google-auth/CONTRIBUTING.rst
    • Updated supported CPython versions list, removing Python 3.8.
  • packages/google-auth/README.rst
    • Updated supported Python versions from '>= 3.8' to '>= 3.9'.
    • Updated note about unsupported Python versions, removing Python 3.8 and adjusting Python 3.9 note.
    • Added a note about the last supported version for Python 3.8.
  • packages/google-auth/noxfile.py
    • Removed Python 3.8 from 'UNIT_TEST_PYTHON_VERSIONS'.
    • Removed 'ALL_PYTHON' variable and its extension with '3.7'.
    • Updated 'unit' session to use 'UNIT_TEST_PYTHON_VERSIONS' and removed Python 3.7 skip.
  • packages/google-auth/setup.py
    • Updated 'python_requires' from '>=3.8' to '>=3.9'.
    • Removed 'Programming Language :: Python :: 3.8' classifier.
  • packages/google-auth/testing/constraints-3.8.txt
    • Removed file.
  • packages/google-auth/testing/constraints-3.9.txt
    • Removed 'setuptools==40.3.0' from constraints.
    • Added content for constraints.
  • packages/google-cloud-access-context-manager/README.rst
    • Updated supported Python versions from '>= 3.7' to '>= 3.9'.
    • Updated unsupported Python versions from '<= 3.6' to '<= 3.8'.
  • packages/google-cloud-access-context-manager/docs/README.rst
    • Updated supported Python versions from '>= 3.7' to '>= 3.9'.
    • Updated unsupported Python versions from '<= 3.6' to '<= 3.8'.
  • packages/google-cloud-access-context-manager/noxfile.py
    • Removed Python 3.7 and 3.8 from 'UNIT_TEST_PYTHON_VERSIONS'.
    • Removed Python 3.8 from 'SYSTEM_TEST_PYTHON_VERSIONS'.
    • Simplified 'unit' session by removing 'protobuf_implementation="cpp"' and related conditional skips.
    • Simplified 'prerelease_deps' session by removing 'protobuf_implementation="cpp"'.
  • packages/google-cloud-access-context-manager/setup.py
    • Updated 'protobuf' dependency from '>=3.20.2,<7.0.0' to '>=4.25.8,<8.0.0'.
    • Removed 'Programming Language :: Python :: 3.7' and '3.8' classifiers.
    • Updated 'python_requires' from '>=3.7' to '>=3.9'.
  • packages/google-cloud-access-context-manager/testing/constraints-3.7.txt
    • Removed file.
  • packages/google-cloud-access-context-manager/testing/constraints-3.9.txt
    • Updated 'protobuf' version to '4.25.8' in constraints.
    • Added content for constraints.
  • packages/google-cloud-audit-log/README.rst
    • Updated supported Python versions from '>= 3.7' to '>= 3.9'.
    • Updated unsupported Python versions from '<= 3.6' to '<= 3.8'.
  • packages/google-cloud-audit-log/docs/README.rst
    • Updated supported Python versions from '>= 3.7' to '>= 3.9'.
    • Updated unsupported Python versions from '<= 3.6' to '<= 3.8'.
  • packages/google-cloud-audit-log/noxfile.py
    • Removed Python 3.7 and 3.8 from 'UNIT_TEST_PYTHON_VERSIONS'.
    • Removed Python 3.8 from 'SYSTEM_TEST_PYTHON_VERSIONS'.
    • Simplified 'unit' session by removing 'protobuf_implementation="cpp"' and related conditional skips.
    • Simplified 'prerelease_deps' session by removing 'protobuf_implementation="cpp"'.
  • packages/google-cloud-audit-log/setup.py
    • Updated 'protobuf' dependency from '>=3.20.2,<7.0.0' to '>=4.25.8,<8.0.0'.
    • Removed 'Programming Language :: Python :: 3.7' and '3.8' classifiers.
    • Updated 'python_requires' from '>=3.7' to '>=3.9'.
  • packages/google-cloud-audit-log/testing/constraints-3.7.txt
    • Removed file.
  • packages/google-cloud-audit-log/testing/constraints-3.8.txt
    • Removed file.
  • packages/google-cloud-audit-log/testing/constraints-3.9.txt
    • Added content for constraints.
    • Updated 'protobuf' version to '4.25.8' in constraints.
  • packages/google-cloud-core/CONTRIBUTING.rst
    • Updated supported CPython versions list, removing Python 3.8.
    • Updated system test command example from 'system-3.8' to 'system-3.12'.
    • Updated note about system tests running under Python 3.8 to Python 3.12.
    • Removed 'Samples and code snippets' section.
    • Updated explicit support statement from Python 3.8 to Python 3.9.
  • packages/google-cloud-core/README.rst
    • Updated supported Python versions from '>= 3.7' to '>= 3.9'.
    • Updated unsupported Python versions from specific notes about Python 2.7/3.6 to '<= 3.8'.
  • packages/google-cloud-core/noxfile.py
    • Removed Python 3.7 and 3.8 from 'UNIT_TEST_PYTHON_VERSIONS'.
    • Simplified 'prerelease_deps' session by removing 'protobuf_implementation="cpp"'.
    • Simplified 'core_deps_from_source' session by removing 'protobuf_implementation="cpp"'.
  • packages/google-cloud-core/setup.py
    • Removed 'importlib-metadata' dependency for Python versions less than 3.8.
    • Removed 'Programming Language :: Python :: 3.7' and '3.8' classifiers.
    • Updated 'python_requires' from '>=3.7' to '>=3.9'.
  • packages/google-cloud-core/testing/constraints-3.7.txt
    • Removed file.
  • packages/google-cloud-core/testing/constraints-3.9.txt
    • Added content for constraints.
  • packages/google-cloud-dns/CONTRIBUTING.rst
    • Updated supported CPython versions list, removing Python 3.7 and 3.8.
    • Removed 'Samples and code snippets' section.
    • Updated explicit support statement from Python 3.7 to Python 3.9.
  • packages/google-cloud-dns/README.rst
    • Updated supported Python versions from '>= 3.7' to '>= 3.9'.
    • Updated unsupported Python versions from '<= 3.6' to '<= 3.8'.
  • packages/google-cloud-dns/noxfile.py
    • Removed Python 3.7 and 3.8 from 'ALL_PYTHON'.
    • Removed 'types-protobuf' from mypy session dependencies.
    • Simplified 'unit' session by removing 'protobuf_implementation' parametrization and related conditional skips and environment variables.
    • Simplified 'prerelease_deps' session by removing 'protobuf_implementation' parametrization and related conditional skips and environment variables.
    • Simplified 'core_deps_from_source' session by removing 'protobuf_implementation' parametrization and related conditional skips and environment variables.
  • packages/google-cloud-dns/setup.py
    • Removed 'Programming Language :: Python :: 3.7' and '3.8' classifiers.
    • Updated 'python_requires' from '>=3.7' to '>=3.9'.
  • packages/google-cloud-dns/testing/constraints-3.7.txt
    • Removed file.
  • packages/google-cloud-dns/testing/constraints-3.9.txt
    • Added content for constraints.
  • packages/google-cloud-documentai-toolbox/CONTRIBUTING.rst
    • Updated supported CPython versions list, removing Python 3.8.
    • Removed 'Samples and code snippets' section.
    • Updated explicit support statement from Python 3.8 to Python 3.9.
  • packages/google-cloud-documentai-toolbox/README.rst
    • Updated supported Python versions from '>= 3.8' to '>= 3.9'.
    • Updated unsupported Python versions from '<= 3.7' to '<= 3.8' and removed specific notes about Python 3.7.
  • packages/google-cloud-documentai-toolbox/noxfile.py
    • Removed Python 3.8 from 'UNIT_TEST_PYTHON_VERSIONS'.
    • Removed 'ALL_PYTHON' variable and its extension with '3.7'.
    • Simplified 'unit' session by removing 'protobuf_implementation="cpp"' and related conditional skips.
    • Simplified 'prerelease_deps' session by removing 'protobuf_implementation="cpp"'.
  • packages/google-cloud-documentai-toolbox/setup.py
    • Updated 'python_requires' from '>=3.8' to '>=3.9'.
    • Removed 'Programming Language :: Python :: 3.8' classifier.
  • packages/google-cloud-documentai-toolbox/testing/constraints-3.8.txt
    • Removed file.
  • packages/google-cloud-documentai-toolbox/testing/constraints-3.9.txt
    • Added content for constraints and updated header comments.
  • packages/google-cloud-ndb/CONTRIBUTING.rst
    • Updated supported CPython versions list, removing Python 3.7 and 3.8.
    • Updated unit test command example from 'unit-3.10' and 'unit-3.7' to 'unit-3.14'.
  • packages/google-cloud-ndb/README.md
    • Updated supported Python versions from '>= 3.7' to '>= 3.9'.
    • Updated unsupported Python versions from '<= 3.6' to '<= 3.8'.
  • packages/google-cloud-ndb/noxfile.py
    • Updated 'ALL_INTERPRETERS' to remove Python 3.7 and 3.8.
    • Removed 'EMULTATOR_INTERPRETERS' variable.
    • Simplified 'prerelease_deps' session by removing 'protobuf_implementation="cpp"'.
  • packages/google-cloud-ndb/setup.py
    • Updated 'protobuf' dependency from '>=3.20.2,<7.0.0' to '>=4.25.8,<8.0.0'.
    • Removed 'Programming Language :: Python :: 3.7' and '3.8' classifiers.
    • Updated 'python_requires' from '>=3.7' to '>=3.9'.
  • packages/google-cloud-ndb/testing/constraints-3.7.txt
    • Removed file.
  • packages/google-cloud-ndb/testing/constraints-3.9.txt
    • Updated 'protobuf' version to '4.25.8' in constraints.
    • Added content for constraints.
  • packages/google-cloud-runtimeconfig/CONTRIBUTING.rst
    • Updated supported CPython versions list, removing Python 3.7 and 3.8.
    • Updated system test command example from 'system-3.8' to 'system-3.12'.
    • Updated note about system tests running under Python 3.8 to Python 3.12.
    • Removed 'Samples and code snippets' section.
    • Updated explicit support statement from Python 3.7 to Python 3.9.
  • packages/google-cloud-runtimeconfig/README.rst
    • Updated supported Python versions from '>= 3.7' to '>= 3.9'.
    • Updated unsupported Python versions from '<= 3.6' to '<= 3.8'.
  • packages/google-cloud-runtimeconfig/noxfile.py
    • Removed Python 3.7 and 3.8 from 'UNIT_TEST_PYTHON_VERSIONS'.
    • Simplified 'unit' session by removing 'protobuf_implementation' parametrization and related conditional skips and environment variables.
    • Simplified 'prerelease_deps' session by removing 'protobuf_implementation' parametrization and related conditional skips and environment variables.
    • Simplified 'core_deps_from_source' session by removing 'protobuf_implementation' parametrization and related conditional skips and environment variables.
  • packages/google-cloud-runtimeconfig/setup.py
    • Removed 'Programming Language :: Python :: 3.7' and '3.8' classifiers.
    • Updated 'python_requires' from '>=3.7' to '>=3.9'.
  • packages/google-cloud-runtimeconfig/testing/constraints-3.7.txt
    • Removed file.
  • packages/google-cloud-runtimeconfig/testing/constraints-3.9.txt
    • Added content for constraints.
  • packages/google-cloud-testutils/noxfile.py
    • Updated 'ALL_PYTHON' to remove Python 3.7 and 3.8.
    • Updated 'system' session to use 'constraints-3.9.txt' instead of 'constraints-3.7.txt'.
    • Updated 'update_lower_bounds' session to use 'constraints-3.9.txt' instead of 'constraints-3.7.txt'.
  • packages/google-cloud-testutils/setup.py
    • Removed 'importlib_metadata' dependency for Python versions less than 3.8.
    • Updated 'python_requires' from '>=3.7' to '>=3.9'.
    • Removed 'Programming Language :: Python :: 3.7' and '3.8' classifiers.
  • packages/google-cloud-testutils/testing/constraints-3.7.txt
    • Removed file.
  • packages/google-cloud-testutils/testing/constraints-3.9.txt
    • Added content for constraints.
  • packages/google-cloud-testutils/tests/unit/resources/bad_package/setup.py
    • Updated 'python_requires' from '>=3.7' to '>=3.9'.
  • packages/google-cloud-testutils/tests/unit/resources/good_package/setup.py
    • Updated 'python_requires' from '>=3.7' to '>=3.9'.
  • packages/google-resumable-media/README.rst
    • Updated supported Python versions from '>= 3.7' to '>= 3.9'.
    • Updated unsupported Python versions from specific notes about Python 2.7/3.5/3.6 to '<= 3.8'.
  • packages/google-resumable-media/noxfile.py
    • Updated 'UNIT_TEST_PYTHON_VERSIONS' to remove Python 3.7 and 3.8.
  • packages/google-resumable-media/setup.py
    • Updated 'python_requires' from '>= 3.7' to '>= 3.9'.
    • Removed 'Programming Language :: Python :: 3.7' and '3.8' classifiers.
  • packages/google-resumable-media/testing/constraints-3.7.txt
    • Removed file.
  • packages/google-resumable-media/testing/constraints-3.9.txt
    • Added content for constraints.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
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 updates multiple packages to require Python 3.9 as the minimum version, dropping support for Python 3.7 and 3.8. The changes are extensive, touching configuration files (setup.py, noxfile.py), documentation (README.rst, CONTRIBUTING.rst), and testing infrastructure (constraints-*.txt). The updates are largely consistent and correct across all affected packages. I've pointed out a couple of minor issues in the new testing constraints files for your consideration.

#
# e.g., if setup.py has "foo >= 1.14.0, < 2.0.0dev",
# Then this file should have foo==1.14.0

Copy link
Contributor

Choose a reason for hiding this comment

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

medium

This blank line is unnecessary and can be removed for cleanliness.

# Then this file should have foo==1.14.0
click==7.0.0
google-auth==0.4.0
importlib_metadata==1.0.0
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

importlib_metadata is part of the standard library in Python 3.8+ (as importlib.metadata). Since the minimum Python version for this package is now 3.9, this dependency is no longer needed and should be removed from this constraints file. It has already been correctly removed from setup.py.

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