fix(exclude_platform): exclude PEP 600 manylinux tags#2151
fix(exclude_platform): exclude PEP 600 manylinux tags#2151LouisLau-art wants to merge 1 commit intopypa:mainfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2151 +/- ##
==========================================
+ Coverage 79.69% 88.84% +9.14%
==========================================
Files 31 34 +3
Lines 4324 4015 -309
Branches 780 396 -384
==========================================
+ Hits 3446 3567 +121
+ Misses 721 312 -409
+ Partials 157 136 -21 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR updates the exclude_platform filter to better exclude Linux wheels by adding support for PEP 600-style manylinux tags, and adds a regression test to ensure the new tag format is filtered when linux is configured.
Changes:
- Extend Linux platform patterns to recognize PEP 600 manylinux tags.
- Reset
ExcludePlatformFilter’s cached class-level pattern state in test setup to avoid intra-module test pollution. - Add a regression test covering
manylinux_2_17_*exclusion whenlinuxis blocklisted.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/bandersnatch_filter_plugins/filename_name.py |
Adds a new Linux filename pattern intended to match PEP 600 manylinux tags. |
src/bandersnatch/tests/plugins/test_filename.py |
Resets cached plugin state per test and adds a regression test for PEP 600 manylinux exclusion. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "manylinux2014_ppc64", # PEP 599 | ||
| "manylinux2014_ppc64le", # PEP 599 | ||
| "manylinux2014_s390x", # PEP 599 | ||
| "-manylinux_", # PEP 600 (manylinux_<glibc-major>_<glibc-minor>_<arch>) |
There was a problem hiding this comment.
The new PEP 600 pattern is "-manylinux_", which only matches when the tag is preceded by a hyphen. Wheel platform tags can be a dot-separated list (e.g. ...-manylinux2014_x86_64.manylinux_2_17_x86_64.whl), where a PEP 600 tag may be preceded by . instead. Consider also matching .manylinux_ (or parsing the wheel filename and matching only against the platform tag field) so PEP 600 tags are reliably excluded regardless of position.
| "-manylinux_", # PEP 600 (manylinux_<glibc-major>_<glibc-minor>_<arch>) | |
| "-manylinux_", # PEP 600 (manylinux_<glibc-major>_<glibc-minor>_<arch>) in hyphen-separated tags | |
| ".manylinux_", # PEP 600 (manylinux_<glibc-major>_<glibc-minor>_<arch>) in dot-separated tags |
| def setUp(self) -> None: | ||
| filename_name.ExcludePlatformFilter._patterns = [] | ||
| filename_name.ExcludePlatformFilter._packagetypes = [] |
There was a problem hiding this comment.
ExcludePlatformFilter._patterns / _packagetypes are class-level caches. Resetting them in setUp() helps within this module, but the values will remain mutated after the last test and can leak into later test modules (causing initialize_plugin() to skip re-initialization). Consider also resetting these caches in tearDown() (or using addCleanup) to leave global state clean for the rest of the test suite.
Fixes #830.
Test: