Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dedicated error message for direct filesystem paths in requirements #2369

Merged
merged 1 commit into from
Mar 11, 2024

Conversation

charliermarsh
Copy link
Member

Summary

This is analogous to #669, but for cases in which the package name is a filesystem path. In such cases, we'll fail when parsing the package name, since it doesn't start with a valid character, as opposed to failing when we go to parse the remaining version specifier.

Inspired by #2356.

};

// Ex) `/bin/ls`
if first_char == '\\' || first_char == '/' || first_char == '.' {
Copy link
Member

Choose a reason for hiding this comment

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

Does this support pip install path/to/my.whl? I suspect that this is a big fraction of the cases

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, that already works on main, because “path” is parsed as the package name, then we fail on the slash. The case covered in this PR is when there’s no leasing alpha character (like “./path”).

@charliermarsh charliermarsh merged commit ebca319 into main Mar 11, 2024
7 checks passed
@charliermarsh charliermarsh deleted the charlie/p branch March 11, 2024 22:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
error messages Messaging when something goes wrong
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants