Skip to content

fix(exclude_platform): exclude PEP 600 manylinux tags#2151

Open
LouisLau-art wants to merge 1 commit intopypa:mainfrom
LouisLau-art:fix/exclude-platform-pep600-manylinux-tags-830
Open

fix(exclude_platform): exclude PEP 600 manylinux tags#2151
LouisLau-art wants to merge 1 commit intopypa:mainfrom
LouisLau-art:fix/exclude-platform-pep600-manylinux-tags-830

Conversation

@LouisLau-art
Copy link

Fixes #830.

  • Extend the linux platform patterns to match PEP 600 manylinux tags (manylinux_).
  • Add a regression test to ensure manylinux_2_17_* wheels are excluded when linux is configured.

Test:

  • .venv/bin/python -m pytest src/bandersnatch/tests/plugins/test_filename.py

@codecov
Copy link

codecov bot commented Feb 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.84%. Comparing base (4d020e8) to head (ce73c0d).
⚠️ Report is 478 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 when linux is 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>)
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
"-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

Copilot uses AI. Check for mistakes.
Comment on lines 18 to +20
def setUp(self) -> None:
filename_name.ExcludePlatformFilter._patterns = []
filename_name.ExcludePlatformFilter._packagetypes = []
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
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.

Add platform tags specified in PEP 599/600 to exclude_platform

1 participant

Comments