Repository navigation
Conversation
Problem: the shared nox config and the GitHub lint job still targeted Python 3.10, which reached end of life in Oct 2026. Most samples only tested 3.10 and 3.14, and linting used each sample's oldest tested version. So contributors working on 3.12 were asked for a 3.10 interpreter and saw py-3.12 skipped. Solution: - noxfile-template.py: ALL_VERSIONS is now 3.12-3.15 and the default tests 3.12 + 3.14. Lint always runs on 3.12. A new OPT_IN_VERSIONS / "opt_in_versions" setting keeps 3.15 off unless a sample asks for it, because existing configs only list the versions they skip. - noxfile_config.py: the default tests 3.12 + 3.14 and documents how to opt in to 3.13 and 3.15. - .github: the lint job and noxfile-lint.py use 3.12. Also fixes two flake8 issues and black formatting that were already in the file. Old version strings such as "3.8" in per-sample configs are now ignored. Per-sample configs still need updating to test 3.12; that's planned for a follow-up PR. Signed-off-by: Jennifer Davis <sigje@google.com>
There was a problem hiding this comment.
Code Review
This pull request updates the supported Python versions across the Nox configuration files, raising the minimum supported version to 3.12 and adding support for up to 3.15. It also introduces an opt-in mechanism for newly released Python versions and sets the linting version to 3.12. A review comment suggests improving the robustness of the version filtering logic in noxfile-template.py by using (TEST_CONFIG.get("opt_in_versions") or []) to prevent potential TypeError exceptions if the configuration explicitly overrides the key to None.
| v | ||
| for v in ALL_VERSIONS | ||
| if v not in IGNORED_VERSIONS | ||
| and (v not in OPT_IN_VERSIONS or v in TEST_CONFIG.get("opt_in_versions", [])) |
There was a problem hiding this comment.
To make the version filtering more robust and prevent potential TypeError exceptions, use TEST_CONFIG.get("opt_in_versions") or [] instead of TEST_CONFIG.get("opt_in_versions", []). If a user's custom noxfile_config.py explicitly overrides opt_in_versions to None or another falsy value, .get(..., []) would still return None, leading to a TypeError: argument of type 'NoneType' is not iterable during the membership check.
| and (v not in OPT_IN_VERSIONS or v in TEST_CONFIG.get("opt_in_versions", [])) | |
| and (v not in OPT_IN_VERSIONS or v in (TEST_CONFIG.get("opt_in_versions") or [])) |
Description
Makes Python 3.12 the minimum for the shared nox setup, and stops lint from asking contributors for a Python 3.10 interpreter. 3.10 reached end of life in Oct 2026.
Problem: most samples only tested 3.10 and 3.14, and lint ran on each sample's oldest tested version (3.10). Contributors on 3.12 hit missing-interpreter errors for 3.10 and saw
py-3.12skipped.Changes
noxfile-template.pyALL_VERSIONSis now3.12–3.15; 3.8–3.11 are removed.LINTING_VERSIONis fixed at3.12.OPT_IN_VERSIONS = ["3.15"]and an"opt_in_versions"config key. Existing configs only list the versions they skip, so without this every one of them would start testing 3.15 at once.noxfile_config.py(root default):ignored_versions = ["3.13"],opt_in_versions = [], plus comments on how to opt in to 3.13 and 3.15..github/workflows/lint.ymland.github/scripts/noxfile-lint.py: the lint job uses Python 3.12. Also fixes two flake8 issues and black formatting that were already in that file.Leftover version strings in per-sample configs, such as
"3.8", are now ignored.Follow-ups (not in this PR)
noxfile_config.pyfiles that copied the old default (ignore 3.8, 3.9, 3.11, 3.12, 3.13) now test only 3.14. A follow-up PR will update them to 3.12 + 3.14..kokoro/docker,.trampolinerc) and remove the old.kokoro/python3.8–3.11configs.Verification (local nox 2026.10.20, CPython 3.12.16 / 3.14.10)
noxfile_config.pyalloydb/notebooks)opt_in_versions: ["3.15"]nox -s lintoncloud_scheduler/created its env with python3.12 and passed.Checklist
Testing
Compliance & Style
Post-Approval Actions