Commit 950812d
authored
PyPI staging: exclude pre-release 3.15 wheels and strip the 3.15 classifier (#8245)
## What
Two related changes to the PyPI staging path so pre-release Python 3.15
does not break / leak into PyPI uploads:
1. **Exclude cp315 / cp315t wheels from staging**
(`release/pypi/upload_pypi_to_staging.sh`) -- 3.15 is pre-release, so
its wheel files should not be promoted to PyPI at all.
2. **Strip the `Programming Language :: Python :: 3.15` classifier**
from every staged wheel's METADATA
(`release/pypi/prep_binary_for_pypi.py`) -- non-3.15 wheels can still
*declare* the 3.15 classifier, which PyPI rejects.
## Why
- PyPI validates trove classifiers against a fixed list and **rejects
unknown ones**; `Programming Language :: Python :: 3.15` is not
recognized yet (pre-release), so any wheel declaring it fails to upload
with an "invalid classifier" error.
- Independently, the actual 3.15 wheel binaries shouldn't be published
to PyPI while the version is pre-release.
Both are easy to revert once 3.15 ships (drop the classifier from
`CLASSIFIERS_TO_REMOVE` and remove the `-cp315` exclusion).
## How
**`upload_pypi_to_staging.sh`** -- add `grep -v -- "-cp315"` to the
package-selection pipeline. Both regular (`cp315`) and free-threaded
(`cp315t`) 3.15 wheels carry the `-cp315` interpreter tag, so one
exclusion drops both; `cp310`..`cp314` (incl. `cp314t`) are untouched.
**`prep_binary_for_pypi.py`** -- new
`remove_disallowed_classifiers(metadata_file)` + `CLASSIFIERS_TO_REMOVE`
set. Called from `process_wheel` after the version-suffix rewrite and
**before** the `.dist-info` rename (while `metadata_file` still
resolves); auditwheel regenerates `RECORD` on context exit. Matches the
**full** classifier value, so `:: 3`, `:: 3.1`, `:: 3.13`, `:: 3.14` and
non-Python classifiers are left intact.
## Test plan
- `bash -n upload_pypi_to_staging.sh`, `python3 -m py_compile` + `black
--check` on the prep script -- all clean.
- Filter check: a wheel list of `cp310 / cp314 / cp314t / cp315 /
cp315t` passes through the exclusion leaving `cp310, cp314, cp314t` and
dropping both `cp315` lines.
- Classifier check on a sample METADATA: only `:: 3.15` is dropped; `::
3`, `:: 3.1`, `:: 3.13`, `:: 3.14` and other (`License ::`) classifiers
preserved.
## Note
Both changes affect the staging path that repackages suffixed wheels
(`VERSION_SUFFIX` set). Wheels moved through without repackaging (no
version suffix) are not touched, matching existing behavior.1 parent 9b13f83 commit 950812d
2 files changed
Lines changed: 44 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
20 | 54 | | |
21 | 55 | | |
22 | 56 | | |
| |||
106 | 140 | | |
107 | 141 | | |
108 | 142 | | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
109 | 148 | | |
110 | 149 | | |
111 | 150 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
27 | 31 | | |
28 | 32 | | |
29 | 33 | | |
30 | 34 | | |
| 35 | + | |
31 | 36 | | |
32 | 37 | | |
33 | 38 | | |
| |||
0 commit comments