Skip to content

build: Skip pythons excluded by Requires-Python instead of retrying - #2639

Merged
joshuarli merged 1 commit into
mainfrom
build/honor-requires-python
Oct 20, 2026
Merged

joshuarli merged 1 commit into
mainfrom
build/honor-requires-python

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

Most of the recent hour-long build failures on release PRs aren't pip flakes. When a release's Requires-Python excludes one of our build interpreters, pip download on that interpreter correctly reports "No matching distribution". build.py reads that as "PyPI hasn't propagated yet" and retries the sdist download for an hour. Then someone adds python_versions by hand. That happened for sentry-scm 1.9.0/1.10.0/1.11.0 and pytest-sentry 0.6.0. The same thing hits wheel-only releases (sentry-infra-tools 1.35.1/1.36.0): when the first wheel lookup races the upload, the code falls through to an sdist retry loop for an sdist that will never exist.

Now build.py reads the release from PyPI's JSON API before building, and only that lookup waits for propagation. It then:

  • skips interpreters that Requires-Python excludes (pip would never install the package there anyway)
  • fails right away if Requires-Python excludes every build interpreter
  • for releases with no sdist, retries the wheel download, and only when PyPI lists a wheel whose tags match. Otherwise it fails right away.

validate.py reads Requires-Python from the wheel's METADATA and skips the same interpreters, so these releases no longer need a manual python_versions.

Note: sentry-devenv 1.30.0 (#2637) was published with Requires-Python: ==3.13.16, which matches none of our interpreters (3.13 is 3.13.12 here). With this change, that PR fails in seconds instead of an hour, but the real fix belongs in devenv's metadata.

via @joshuarli.

--

View Junior Session [Sentry]

@joshuarli
joshuarli merged commit 2492233 into main Oct 20, 2026
20 checks passed
@joshuarli
joshuarli deleted the build/honor-requires-python branch October 20, 2026 21:30
vaind added a commit to getsentry/scm-platform that referenced this pull request Oct 26, 2026
getsentry/pypi#2639 made its build skip Python versions excluded by a
package's Requires-Python, so the python_versions line no longer has to
be added by hand. The 2.0.0 PR merged without it and its build skipped
3.11 and 3.12 on its own.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
vaind added a commit to getsentry/scm-platform that referenced this pull request Oct 26, 2026
## Problem

The README's release steps date from before #163–#165. They tell you to
pick a bump type, say the version comes from `pyproject.toml`, and name
`getsentry/action-prepare-release`. Following them skips craft's `auto`
versioning, so a breaking PR could ship as a minor release.

## Approach

Update the "Releasing a New Version" steps to match the current
workflow:
- run with the default `auto`, and how PR titles map to
major/minor/patch, with the explicit bump types kept as overrides;
- what the workflow produces: the `release/<version>` branch, the
`CHANGELOG.md` section, and the publish issue to check;
- what happens after **accepted**: CI gate, PyPI/internal index/GitHub
release, release branch merged into `main`;
- PR titles must follow conventional commits, with `!` for breaking
changes.

The manual `getsentry/pypi` step, adding `python_versions = >=3.13` to
its PR, is removed. Since getsentry/pypi#2639, that repository's build
skips Python versions excluded by a package's `Requires-Python`. The
2.0.0 PR (getsentry/pypi#2669) merged without the line, and its build
skipped 3.11 and 3.12 on its own.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
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.

1 participant