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

uv pip compile causes "direct URL requirements without package names are not supported" error #3818

Closed
groodt opened this issue May 24, 2024 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@groodt
Copy link

groodt commented May 24, 2024

It appears that there is something strange happening when uv pip compile is creating a lockfile for direct url references when environment variable interpolation is occurring.

requirements.in

requests @ ${GITHUB_URL}/psf/requests

Create lockfile

GITHUB_URL=git+https://github.com python -m uv pip compile requirements.in --ou
tput-file requirements.txt

Inspect generated requirements.txt

# This file was autogenerated by uv via the following command:
#    uv pip compile requirements.in --output-file requirements.txt
certifi==2024.2.2
    # via requests
charset-normalizer==3.3.2
    # via requests
idna==3.7
    # via requests
${GITHUB_URL}/psf/requests@88dce9d854797c05d0ff296b70e0430535ef8aaf
    # via -r requirements.in
urllib3==2.2.1
    # via requests

Run lockfile generation again and an error occurs

GITHUB_URL=git+https://github.com python -m uv pip compile requirements.in --ou
tput-file requirements.txt
error: direct URL requirements without package names are not supported: `git+https://github.com/psf/requests@88dce9d854797c05d0ff296b70e0430535ef8aaf`
@konstin konstin added the bug Something isn't working label May 24, 2024
@charliermarsh charliermarsh self-assigned this May 24, 2024
@charliermarsh
Copy link
Member

Thanks, will fix.

@charliermarsh
Copy link
Member

I’ll try to get this out today, I think it’s a regression from a recent change.

charliermarsh added a commit that referenced this issue May 24, 2024
## Summary

Related to #3818. We should
_always_ include the package name if we know it's not a file path, even
if it starts with an environment variable.
@charliermarsh
Copy link
Member

This should be fixed in v0.2.3 (out now).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants