fix(sdk-extras): exclude pre-releases, so the gate checks the version readers get - #115
Merged
Merged
Conversation
… readers get Bugbot Medium on the staging promotion PR #114. `parse_version` reduces a tag to a tuple of leading digits, so `0.19.0a1` became (0, 19, 0) and outranked `0.18.1` at (0, 18, 1). `resolve_version` then answered "which version does this documented specifier select?" with a PRE-RELEASE — and pip does not install those without `--pre`, which none of the documented `pip install "tracebloc[...]"` commands pass. So the gate would check the extras of a version no reader can obtain, and pass or fail the docs against a package nobody installs. Both directions are wrong: a missing extra in a stable release goes unnoticed, and an extra that exists only in an alpha reads as present. Latent today -- all 11 published releases are stable -- like most of this class. It arms itself the day an alpha is published. Hand-rolled PEP 440 detection because the script is STDLIB-ONLY by construction: sdk-extras-check.yml runs `python3 scripts/check-sdk-extras.py` with no setup-python and no pip install, so `packaging.version` is not importable and reaching for it would mean adding a dependency step to a docs check. `.postN` is deliberately excluded from the marker set -- post releases install by default. Stated rather than overclaimed: if a package had ONLY pre-releases the fallback picks an arbitrary one, because parse_version reduces 1.0.0a1 and 1.0.0b2 to the same tuple and ordering them needs real PEP 440 parsing. That branch is a guard against an empty max(), not a path anyone rides. Verified: 10 classification cases (a/b/rc/alpha/preview/dev true, post/plain false); the reported bug both ways -- with the filter 0.18.1, without it 0.19.0a1; and the real gate still runs clean against live PyPI.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bugbot Medium on the staging promotion PR #114.
The bug
parse_versionreduces a tag to a tuple of leading digits, so0.19.0a1becomes(0, 19, 0)and outranks0.18.1at(0, 18, 1).resolve_versionthen answers "which version does this documented specifier select?" with a pre-release — and pip does not install those without--pre, which none of the documentedpip install "tracebloc[...]"commands pass.The gate would check the extras of a version no reader can obtain. Wrong in both directions: a missing extra in a stable release goes unnoticed, and an extra that exists only in an alpha reads as present.
Latent today — all 11 published releases are stable. It arms itself the day an alpha is published.
Why hand-rolled and not
packagingsdk-extras-check.ymlrunspython3 scripts/check-sdk-extras.pywith no setup-python and no pip install — the script is stdlib-only by construction, sopackaging.versionis not importable and reaching for it would mean adding a dependency step to a docs check..postNis deliberately excluded from the marker set: post releases install by default.One limit, stated rather than hidden
If a package had only pre-releases, the fallback picks an arbitrary one —
parse_versionreduces1.0.0a1and1.0.0b2to the same tuple, and ordering them needs real PEP 440 parsing. That branch is a guard against an emptymax(), not a path anyone rides.Verified
a/b/rc/alpha/preview/dev→ pre-release;post/plain → not0.18.1, without it0.19.0a1Note
Low Risk
Docs CI tooling only; behavior change is narrowing version selection to stable releases with a documented fallback when no stable tags exist.
Overview
Fixes version resolution in the SDK extras docs gate so it matches what
pipinstalls without--pre.resolve_versionusedparse_version, which strips alpha/beta/rc suffixes—so a tag like0.19.0a1could rank above0.18.1and the check would validate extras on a release readers cannot install.The change adds stdlib-only
is_prerelease(regex aligned with common PEP 440 markers;.poststays eligible) and filters pre-releases out of the candidate list beforemax(), with a fallback to the full list only if every release is a pre-release. Theresolve_versiondocstring documents that edge case.Reviewed by Cursor Bugbot for commit aa60576. Bugbot is set up for automated code reviews on this repo. Configure here.