Skip to content

Conversation

mtsokol
Copy link

@mtsokol mtsokol commented Aug 4, 2025

Hi All,

Installing from .whl file with extras, where there's a whitespace between filename and extras section is broken:

bash-3.2$ pip install '/tmp/array_record/all_dist/array_record.whl [beam]'
ERROR: Invalid requirement: '/tmp/array_record/all_dist/array_record.whl [beam]': Expected package name at the start of dependency specifier
    /tmp/array_record/all_dist/array_record.whl [beam]
    ^
Hint: It looks like a path. File '/tmp/array_record/all_dist/array_record.whl [beam]' does not exist.

which is caused by untrimmed file extension: .whl instead of .whl.

This PR fixes it by striping path when separating from extras section, with a test that fails for the current main.

@notatallshaw
Copy link
Member

Hi @mtsokol thanks for your PR to pip, please be aware it may take a bit for a maintainer to review as we are all doing this on a volunteer basis.

Copy link
Member

@ichard26 ichard26 left a comment

Choose a reason for hiding this comment

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

This will also permit -e "file:///path/to/project [extra]" but that doesn't carry over to a regular install. (Editable requirements are parsed using a different code path.) I think this is fine though as folks should be using the Direct URL syntax if they're looking to request an extra, anyway.

@mtsokol
Copy link
Author

mtsokol commented Aug 15, 2025

@ichard26 Thanks! I included your suggestion.

@notatallshaw notatallshaw added this to the 25.3 milestone Aug 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants