feat!: remove Python 2.7 from tested versions by glasnt · Pull Request #13675 · GoogleCloudPlatform/python-docs-samples · GitHub
Skip to content

feat!: remove Python 2.7 from tested versions#13675

Merged
glasnt merged 3 commits into
mainfrom
disable-python27
Jan 5, 2026
Merged

feat!: remove Python 2.7 from tested versions#13675
glasnt merged 3 commits into
mainfrom
disable-python27

Conversation

@glasnt

@glasnt glasnt commented Dec 18, 2025

Copy link
Copy Markdown
Contributor

With #13596, we both added Python 3.14, but also removed python 2.7 from the base testing image.

The way testing is currently setup, while most tests (apart from App Engine Standard) are configured to skip Python 2.7, nox only handles this skip within the versioned environment.

For example, previously these checks would show:

cp /workspace/noxfile-template.py noxfile.py
cd path/to/sample
nox -s py-2.7
nox > Running session py-2.7
nox > Creating virtual environment (virtualenv) using python2.7 in .nox/py-2-7
nox > Session py-2.7 skipped: SKIPPED: 2.7 tests are disabled for this sample..

Since the merge of 13596, these now appear as:

cd path/to/sample
nox -s py-2.7
nox > Running session py-2.7
nox > Session py-2.7 failed: Python interpreter 2.7 not found.

With the deprecation of Python 2.7 for App Engine Standard first-generation just over 6 weeks away, we should be able to remove this version from our Nox and Kokoro configurations, thus preventing this failing error.

Additionally, since the copy of noxfile-template in App Engine Standard was primarily there because of Python 2.7, this forked version has been deleted.

⚠️ As a temporary workaround, the "Kokoro CI - Python 2.7 (App Engine Standard Only)" test has been removed as being "Required" to allow a PR to be merged.

  • Confirm cl/846023750 resolved
  • Please merge this PR for me once it is approved

This file should be no longer required since the only difference was 2.7
@glasnt glasnt requested review from a team as code owners December 18, 2025 02:29
@product-auto-label product-auto-label Bot added samples Issues that are directly related to samples. api: appengine Issues related to the App Engine Admin API API. labels Dec 18, 2025
@gemini-code-assist

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

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.

Code Review

This pull request correctly removes Python 2.7 from the tested versions to align with its deprecation and removal from the testing environment. The changes, which include updating ALL_VERSIONS in noxfile-template.py and deleting the specialized appengine/standard/noxfile-template.py, are logical and directly address the issue of failing builds. The implementation is sound and I have no concerns.

@glasnt glasnt added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jan 5, 2026
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jan 5, 2026
@glasnt

glasnt commented Jan 5, 2026

Copy link
Copy Markdown
Contributor Author

Since cl/852425680 has been merged, a kokoro:force-run did not re-run the failing Python 2.7 check. Other checks were re-run successfully.

I'm not yet sure if/how to remove this deprecated check from PRs, apart from removing it as a required check before the PR can pass. PRs created before the CL was merged will also have this failing check that is not re-run on kokoro:force-run.

@glasnt glasnt merged commit 749fdc3 into main Jan 5, 2026
14 of 15 checks passed
@glasnt glasnt deleted the disable-python27 branch January 5, 2026 21:31
@glasnt

glasnt commented Jan 5, 2026

Copy link
Copy Markdown
Contributor Author

glasnt added a commit that referenced this pull request Jan 27, 2026
* feat!: remove Python 2.7 from ALL_VERSIONS

* remove app engine forked noxfile-template

This file should be no longer required since the only difference was 2.7

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

Labels

api: appengine Issues related to the App Engine Admin API API. samples Issues that are directly related to samples.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants