Skip to content

chore(versions): update Python version support to 3.10+ in gapic-generator#16910

Draft
chalmerlowe wants to merge 21 commits intomainfrom
feat/gapic-version-fixes
Draft

chore(versions): update Python version support to 3.10+ in gapic-generator#16910
chalmerlowe wants to merge 21 commits intomainfrom
feat/gapic-version-fixes

Conversation

@chalmerlowe
Copy link
Copy Markdown
Contributor

@chalmerlowe chalmerlowe commented May 1, 2026

Note

This [gapic-generator] PR is presented for discussion. Based on preliminary feedback, we will proceed to update it from removing only 3.7 to also removing 3.8 and 3.9.
This PR blocks multiple other PRs which are presented for discussion and preliminary review. Those PRs leapfrog directly to 3.10 as an experiment. None of them will be merged until this PR fully removes 3.10.

Overview

This Pull Request updates the gapic-generator package and related CI configurations to reflect the deprecation of Python 3.7. It updates documentation, templates, and CI scripts to establish Python 3.8 as the new minimum supported version where applicable.

Changes

Documentation:

  • Updated installation and verification instructions in packages/gapic-generator/docs to reference Python 3.8 instead of 3.7.

Templates:

  • Updated init.py.j2 templates in gapic/ads-templates to require Python 3.8+ (updating sys.version_info checks and error messages).
  • Removed outdated comments regarding Python 3.7 features (like module-level getattr) to avoid confusion, as the baseline is now higher.
  • Updated mypy.ini.j2 to target Python 3.8.
  • Cleaned up dead code (e.g. commented-out Jinja snippets) in the templates.

CI Configurations:

  • Removed Python 3.7 from the unit test matrix in ci/run_single_test.sh.
  • Updated comments regarding supported Python versions in ci/run_conditional_tests.sh.

Post-Processing Configurations:

  • Removed dead code blocks skipping Python 3.7 in spanner-integration.yaml and bigtable-integration.yaml post-processing configs.
  • Updated Python version references in storage-integration.yaml README content.

Reasoning

Python 3.7 has reached End-of-Life (EOL) and is no longer supported. These changes ensure that our generator and the libraries it produces align with current support policies and reduce maintenance burden by removing dead code paths.

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 removes support for Python 3.7 across the repository, updating documentation, CI scripts, and generator templates to reflect a minimum requirement of Python 3.8. Feedback was provided to ensure consistency between CI scripts by including Python 3.13 in the list of supported versions within the comments of ci/run_conditional_tests.sh.

Comment thread ci/run_conditional_tests.sh Outdated
# `TEST_TYPE` should be one of ["docs", "docfx", "prerelease", "unit"]
# or match the name of the nox session that you want to run.
# `PY_VERSION` should be one of ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
# `PY_VERSION` should be one of ["3.8", "3.9", "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 list of supported Python versions in this comment is inconsistent with ci/run_single_test.sh, which includes 3.13. Since you are updating this line to reflect the new supported versions, please include 3.13 here as well to maintain consistency across CI scripts.

Suggested change
# `PY_VERSION` should be one of ["3.8", "3.9", "3.10", "3.11", "3.12"]
# PY_VERSION should be one of ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
References
  1. Changes to shared configurations or documentation of supported versions should be applied consistently across all relevant scripts to avoid confusion and maintenance issues.

Comment thread ci/run_conditional_tests.sh Outdated
.. code-block:: shell
$ virtualenv ~/.local/client-lib --python=`which python3.7`
$ virtualenv ~/.local/client-lib --python=`which python3.8`
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: We can use venv instead of virtualenv. We can also bump this to the latest version 3.14

@parthea parthea changed the title chore(versions): update Python version support to 3.8+ in gapic-generator chore(versions): update Python version support to 3.9+ in gapic-generator May 1, 2026
@parthea parthea marked this pull request as draft May 1, 2026 16:38
@parthea parthea changed the title chore(versions): update Python version support to 3.9+ in gapic-generator chore(versions): update Python version support to 3.10+ in gapic-generator May 1, 2026
@chalmerlowe chalmerlowe force-pushed the feat/gapic-version-fixes branch from a73f347 to 9a6dece Compare May 1, 2026 17:30
@chalmerlowe chalmerlowe force-pushed the feat/gapic-version-fixes branch from c78a787 to 9ae1839 Compare May 1, 2026 19:28
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