Skip to content

Conversation

@vchudnov-g
Copy link
Contributor

@vchudnov-g vchudnov-g commented Dec 4, 2025

Require Python 3.9+
Require protobuf 4.25.8+
Corollary for test coverage:

  • Update google-auth ≥ 2.35.0, < 3.0.0
  • Update requests ≥ 2.20.0, < 3.0.0
  • Update googleapis-common-protos ≥ 1.56.3, < 2.0.0

Simplify code accordingly.

Fixes #835

This also required removing 3.7 and 3.8 as required checks in the repo config, under branch protection rules.

@product-auto-label product-auto-label bot added size: m Pull request size is medium. samples Issues that are directly related to samples. labels Dec 4, 2025
@gemini-code-assist
Copy link

Summary of Changes

Hello @vchudnov-g, 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 streamlines the project's development and testing environment by officially ending support for Python 3.7 and 3.8. It updates various configuration files and removes legacy CI setups, aligning the project with Python 3.9 as the new minimum required version, ensuring compatibility with modern Python features and dependencies.

Highlights

  • Python Version Support: This pull request officially drops support for Python 3.7 and 3.8, aligning the project with newer Python versions.
  • Configuration Updates: Project configuration files, including pyproject.toml and setup.cfg, have been updated to reflect Python 3.9 as the new minimum required version.
  • CI/Testing Streamlining: Continuous Integration (CI) configurations and testing constraints specific to Python 3.7 and 3.8 have been removed, and Nox test sessions updated, to streamline the testing pipeline.
Ignored Files
  • Ignored by pattern: .github/workflows/** (1)
    • .github/workflows/unittest.yml
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

@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 correctly removes support for Python 3.7 and 3.8 by updating configuration files, dependencies, and CI scripts. The changes are clean and directly address the goal of the PR. I have one suggestion in tests/asyncio/test_operation_async.py to improve the correctness of a test that was modified.

@vchudnov-g
Copy link
Contributor Author

/gemini review

Copy link

@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 correctly removes support for Python 3.7 and 3.8. The changes are consistent across the codebase, including updating CI configurations, Python version specifiers in pyproject.toml and noxfile.py, and removing dependencies that were only necessary for the older Python versions. The modifications are well-executed and align with the PR's goal. As a follow-up, you could also remove the importlib_metadata dependency from pyproject.toml (lines 53-55), as it's a backport for Python versions older than 3.8 and is no longer needed.

@product-auto-label product-auto-label bot added size: l Pull request size is large. and removed size: m Pull request size is medium. labels Dec 5, 2025
@vchudnov-g vchudnov-g force-pushed the py-drop-3 branch 2 times, most recently from af514f3 to fb410f4 Compare December 5, 2025 23:35
@vchudnov-g vchudnov-g changed the title chore: remove support for Python 3.7 and 3.8 chore: require Python ≥ 3.9, protobuf ≥ 4.25.8 Dec 6, 2025
@vchudnov-g
Copy link
Contributor Author

Marking this ready for review. Do not merge until we have an analogous PR ready for gapic-generator-python.

Still trying to figure out why the test coverage went down in areas that should not have been affected. I welcome any ideas.

@vchudnov-g vchudnov-g added the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Dec 6, 2025
@vchudnov-g vchudnov-g marked this pull request as ready for review December 6, 2025 00:07
@vchudnov-g vchudnov-g requested review from a team as code owners December 6, 2025 00:07
# https://stackoverflow.com/a/60605919/101923
#
# Literal[_DEFAULT_VALUE] is an alternative, but only added in Python 3.8.
# https://docs.python.org/3/library/typing.html#typing.Literal
Copy link
Contributor

Choose a reason for hiding this comment

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

it looks like this comment is saying an improvement is available to us now that we're dropping 3.7. Is that something we'd want to consider, or should we stick with the existing implementation?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I looked at this and it didn't seem like a cleaner alternative. I'm not sure what I had in mind when I first wrote this comment, but I think the current implementation is clean.

# Remove once https://github.com/grpc/grpc/issues/35086 is fixed (and version newer than 1.60.0 is published)
"ignore:There is no current event loop:DeprecationWarning",
# Remove after support for Python 3.7 is dropped
"ignore:After January 1, 2024, new releases of this library will drop support for Python 3.7:DeprecationWarning",
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe we should keep in a generic version of this warning, since we expect to start seeing it for other versions at some point in the future

Copy link
Contributor Author

Choose a reason for hiding this comment

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

All the warnings issued by _python_version_support.py are of type FutureWarning, which are captured by the rule above.

This particular configuration line was brought in from pytest.ini during the migration to TOML (#736) before we had the current Python version warnings

Copy link
Contributor Author

@vchudnov-g vchudnov-g left a comment

Choose a reason for hiding this comment

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

Fixed the coverage issue; it was due to the 3.9 tests coverage file. Thanks, @daniel-sanche !

PTAL

# https://stackoverflow.com/a/60605919/101923
#
# Literal[_DEFAULT_VALUE] is an alternative, but only added in Python 3.8.
# https://docs.python.org/3/library/typing.html#typing.Literal
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I looked at this and it didn't seem like a cleaner alternative. I'm not sure what I had in mind when I first wrote this comment, but I think the current implementation is clean.

# Remove once https://github.com/grpc/grpc/issues/35086 is fixed (and version newer than 1.60.0 is published)
"ignore:There is no current event loop:DeprecationWarning",
# Remove after support for Python 3.7 is dropped
"ignore:After January 1, 2024, new releases of this library will drop support for Python 3.7:DeprecationWarning",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

All the warnings issued by _python_version_support.py are of type FutureWarning, which are captured by the rule above.

This particular configuration line was brought in from pytest.ini during the migration to TOML (#736) before we had the current Python version warnings

Copy link
Contributor

@daniel-sanche daniel-sanche left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do not merge Indicates a pull request not ready for merge, due to either quality or timing. samples Issues that are directly related to samples. size: l Pull request size is large.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Need to drop code paths specific to Python 3.7, 3.8, 3.9 once we stop supporting those versions

4 participants