Skip to content

fix(gazelle)!: use per-version stdlib lists for Python 3.13 and 3.14 - #3978

Merged
aignas merged 3 commits into
bazel-contrib:mainfrom
cj81499:fix-gazelle-stdlib
Aug 1, 2026
Merged

fix(gazelle)!: use per-version stdlib lists for Python 3.13 and 3.14#3978
aignas merged 3 commits into
bazel-contrib:mainfrom
cj81499:fix-gazelle-stdlib

Conversation

@cj81499

@cj81499 cj81499 commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

The gazelle Python extension picks its stdlib list by python_version. The select had no branch for 3.13 or 3.14, so those configurations fell through to the 3.11 list and gazelle misses everything that changed since 3.11 (3.14 added compression.zstd, 3.13 removed telnetlib).

Bump python_stdlib_list to stdlib-list 0.12.0, the first release shipping lists/3.14.txt, and add the two matching branches. Point //conditions:default at the newest list, so configurations with no matching branch stop landing on one four releases behind.

Fetch the archive from the PyPI sdist rather than a GitHub release asset. Unlike 0.11.0, 0.12.0 published no GitHub release assets. GitHub's auto-generated tag archives are not checksum-stable. PyPI never reuses an uploaded filename.

BREAKING CHANGE: Gazelle plugin now requires rules_python 1.5.0

Bazel resolves every select() key at analysis time, so is_python_3.14 must exist even for builds that never select it. rules_python generates that target from MINOR_MAPPING, which lists 3.14 starting in 1.5.0. Older versions fail analysis, and that broke the Gazelle: BCR jobs on the first push.

Two pins constrain resolution, and both move to 1.5.0: the plugin's own bazel_dep (was 0.18.0) and gazelle/examples/bzlmod_build_file_generation (was 1.4.0). The example's other_module keeps its placeholder pin, which the root module overrides.

Testing

I added no automated coverage and would appreciate maintainer input on how, if at all, to test this. I didn't see an obvious way given the existing test infra.

cj81499 added 3 commits July 30, 2026 18:22
The stdlib list embedded in the gazelle Python extension is selected by
python_version, but the select had no branch for 3.13 or 3.14, so those
configurations fell through to the 3.11 list. Gazelle is therefore unaware of
modules added/removed in Python 3.13/3.14 (eg: `compression.zstd` was added
in 3.14, `telnetlib` was removed in 3.13).

Bump `python_stdlib_list` to `stdlib-list` `0.12.0`, the first release shipping
`lists/3.13.txt` and `lists/3.14.txt`, and add the two matching branches.
Update the `//conditions:default` branch to points at the newest available list
rather than 3.11, so configurations with no matching branch get a current list
instead of one four releases behind.

Fetch the archive from the PyPI sdist rather than a GitHub release asset.
`0.12.0` published no release assets, so the old URL pattern 404s.
GitHub's auto-generated tag archives are not checksum-stable. PyPI
permanently reserves a filename once uploaded, and files.pythonhosted.org
is already a fetch source for this module.
d818bec fixed the gazelle stdlib list select to have branches for Python
3.13 and 3.14, but shipped no news entry. Per CONTRIBUTING.md, user-visible
fixes need one so the change shows up in CHANGELOG.md at release time.

Adds news/3978.fixed.md describing the misclassification of modules
added/removed since 3.11 and the new default-branch behavior. Omits the
internal `stdlib-list` version bump and sdist URL change, which aren't
user-visible.
d818bec added `is_python_3.14` as a select() key. Bazel resolves every
select() key at analysis time, so that target must exist even when 3.14
is not selected. It first exists in rules_python 1.5.0.

Older versions fail analysis:

    no such target '@@rules_python+//python/config_settings:is_python_3.14'

This broke the 9 "Gazelle: BCR" jobs. They drop the local rules_python
override, so the example's pin resolved to 1.4.1.

Bumps the two pins that were older: the plugin's own bazel_dep (0.18.0)
and the example's (1.4.0).

The 3-step process in CONTRIBUTING.md does not apply here. A select() key
cannot be feature-flagged. This matches how the Gazelle 0.30.0 minimum
was raised (see CHANGELOG.md).

BREAKING CHANGE: The gazelle plugin now requires rules_python 1.5.0 or higher.
@cj81499 cj81499 changed the title fix(gazelle): use per-version stdlib lists for Python 3.13 and 3.14 fix(gazelle)!: use per-version stdlib lists for Python 3.13 and 3.14 Jul 31, 2026
@cj81499
cj81499 marked this pull request as ready for review July 31, 2026 18:04
@aignas
aignas added this pull request to the merge queue Aug 1, 2026
Merged via the queue into bazel-contrib:main with commit fbb48ff Aug 1, 2026
10 checks passed
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.

4 participants