Skip to content

fix(finders): filter find_wheel glob to .whl files only#1088

Merged
mergify[bot] merged 1 commit intopython-wheel-build:mainfrom
jlarkin09:AIPCC-14568
Apr 23, 2026
Merged

fix(finders): filter find_wheel glob to .whl files only#1088
mergify[bot] merged 1 commit intopython-wheel-build:mainfrom
jlarkin09:AIPCC-14568

Conversation

@jlarkin09
Copy link
Copy Markdown
Contributor

Filter find_wheel() glob from * to *.whl so only actual wheel files are considered, and add tests verifying non-wheel files are ignored.

Closes: #1067

@jlarkin09 jlarkin09 requested a review from a team as a code owner April 23, 2026 14:00
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 23, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 3464ee65-8636-441a-b0a8-82a381a95c58

📥 Commits

Reviewing files that changed from the base of the PR and between 0664900 and 8def63a.

📒 Files selected for processing (2)
  • src/fromager/finders.py
  • tests/test_finders.py
✅ Files skipped from review due to trivial changes (1)
  • src/fromager/finders.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • tests/test_finders.py

📝 Walkthrough

Walkthrough

The find_wheel() function in src/fromager/finders.py was changed to restrict its directory scan to *.whl files instead of iterating over all directory entries, preventing non-wheel artifacts from being considered matches. Two unit tests were added in tests/test_finders.py: one ensuring a valid .whl is selected when non-wheel files are present, and one ensuring None is returned when only non-wheel files exist.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: filtering find_wheel glob from * to *.whl files only.
Description check ✅ Passed The description clearly relates to the changeset, explaining the glob filter change and referencing the linked issue.
Linked Issues check ✅ Passed The PR implements the primary fix from #1067 by filtering the glob to *.whl files and adds comprehensive tests verifying non-wheel files are ignored.
Out of Scope Changes check ✅ Passed All changes are directly scoped to the linked issue: glob filter in finders.py and two new test cases verifying the fix.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@mergify mergify Bot added the ci label Apr 23, 2026
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/fromager/finders.py`:
- Around line 141-143: The loop in src/fromager/finders.py that iterates over
downloads_dir.glob("*.whl") should skip non-file entries to avoid returning
directories named "*.whl"; update the loop in which "for filename in
downloads_dir.glob('*.whl')" is used to check filename.is_file() before doing
the startswith(base) match and only return filename when filename.is_file() and
str(filename.name).lower().startswith(base.lower()); this ensures only actual
wheel files are selected.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 6a554d1d-0c11-41d1-8720-6fdbe4dd0b47

📥 Commits

Reviewing files that changed from the base of the PR and between ae65fdb and 0664900.

📒 Files selected for processing (2)
  • src/fromager/finders.py
  • tests/test_finders.py

Comment thread src/fromager/finders.py
@LalatenduMohanty
Copy link
Copy Markdown
Member

@mergify rebase

find_wheel() used glob("*") which could match non-wheel files like
.tar.gz or .metadata, causing InvalidWheelFilename crashes downstream
in extract_info_from_wheel_file. Narrow the glob to "*.whl" so only
wheel files are considered.

Closes: python-wheel-build#1067
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Justin Larkin <jlarkin@redhat.com>
Made-with: Cursor
@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented Apr 23, 2026

Deprecation notice: This pull request comes from a fork and was rebased using bot_account impersonation. This capability will be removed on July 1, 2026. After this date, the rebase action will no longer be able to rebase fork pull requests with this configuration. Please switch to the update action/command to ensure compatibility going forward.

@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented Apr 23, 2026

rebase

✅ Branch has been successfully rebased

Copy link
Copy Markdown
Contributor

@rd4398 rd4398 left a comment

Choose a reason for hiding this comment

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

LGTM!

@mergify mergify Bot merged commit 05c65ab into python-wheel-build:main Apr 23, 2026
39 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

finders.find_wheel can return non-wheel files, causing InvalidWheelFilename crash

3 participants