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

Write relative paths with unnamed requirement syntax #3682

Merged
merged 2 commits into from
May 21, 2024
Merged

Conversation

charliermarsh
Copy link
Member

Summary

This PR falls back to writing an unnamed requirement if it appears to be a relative URL. pip is way more flexible when providing an unnamed requirement than when providing a PEP 508 requirement. For example, only this works:

black @ file:///Users/crmarsh/workspace/uv/scripts/packages/black_editable

Any other form will fail.

Meanwhile, all of these work:

file:///Users/crmarsh/workspace/uv/scripts/packages/black_editable
scripts/packages/black_editable
./scripts/packages/black_editable
file:./scripts/packages/black_editable
file:scripts/packages/black_editable

Closes #3180.

@charliermarsh charliermarsh added the compatibility Compatibility with a specification or another tool label May 21, 2024
@charliermarsh charliermarsh force-pushed the charlie/rel branch 2 times, most recently from 1f5c948 to 2c25240 Compare May 21, 2024 00:23
Copy link
Member

@zanieb zanieb left a comment

Choose a reason for hiding this comment

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

It makes me a little sad but yeah this is the pragmatic choice

@charliermarsh
Copy link
Member Author

Me too.

@charliermarsh
Copy link
Member Author

Windows failures... no...

@charliermarsh charliermarsh force-pushed the charlie/rel branch 2 times, most recently from b2fc69b to 96804f7 Compare May 21, 2024 01:09
@charliermarsh charliermarsh merged commit 49f0e84 into main May 21, 2024
44 checks passed
@charliermarsh charliermarsh deleted the charlie/rel branch May 21, 2024 01:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compatibility Compatibility with a specification or another tool
Projects
None yet
2 participants