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 install -r … fails with comment in -e ./local_package # via other_package #3011

Closed
PeterW-LWL opened this issue Apr 12, 2024 · 1 comment · Fixed by #3018
Closed

uv install -r … fails with comment in -e ./local_package # via other_package #3011

PeterW-LWL opened this issue Apr 12, 2024 · 1 comment · Fixed by #3018
Assignees
Labels
bug Something isn't working

Comments

@PeterW-LWL
Copy link

The Problem

Running uv pip install -r requirements.txt -v failes with error code 2 and the following output:

INFO Found a virtualenv through VIRTUAL_ENV at: [workspace]/.venv
DEBUG Cached interpreter info for Python 3.12.2, skipping probing: .venv/bin/python
DEBUG Using Python 3.12.2 environment at .venv/bin/python
DEBUG Trying to lock if free: .venv/.lock
DEBUG Using registry request timeout of 300s
DEBUG Building (editable) file://[workspace]/lwl_inclusive_plugins
DEBUG Solving with target Python version 3.12.2
DEBUG Adding direct dependency: setuptools>=40.8.0
DEBUG Building (editable) file://[workspace]/local_package_2%20%20%20%20%20%20#%20via%20local_package_1
error: Failed to build editables
  Caused by: Source distribution not found at: [workspace]/local_package_2

The requirements.txt looks like this:

# This file was autogenerated by uv via the following command:
#    uv pip compile --annotation-style=line --output-file=requirements.txt requirements.in
-e ./local_package_1
-e ./local_package_2      # via local_package_1

The possible solution

Removing the comment in the last line of the requirements.txt fixes the problem.

# This file was autogenerated by uv via the following command:
#    uv pip compile --annotation-style=line --output-file=requirements.txt requirements.in
-e ./local_package_1
-e ./local_package_2

The uv pip compile command will regenerate this comment (as there is a dependency from local_package_1 to local_package_2.

uv pip install -r … should ignore the comment not just for normal lines like

django==5.0.3             # via django-cms

but also for lines starting the -e

Global information

Platform

  • macOS 13.4.1
  • Chip Apple M2 Pro (arm64)
> uv --version
uv 0.1.31 (7bcca28b1 2024-04-09)
@PeterW-LWL PeterW-LWL changed the title uv install -r req….txt fails with comment in -e .local_package # via other_package uv install -r … fails with comment in -e ./local_package # via other_package Apr 12, 2024
@charliermarsh
Copy link
Member

Oh interesting, will take a look...

@charliermarsh charliermarsh self-assigned this Apr 12, 2024
@charliermarsh charliermarsh added the bug Something isn't working label Apr 12, 2024
charliermarsh added a commit that referenced this issue Apr 12, 2024
## Summary

I'm surprised we haven't hit this before, but apparently we don't allow
comments after `--index-url`, `-e` entries, etc., in the
requirements.txt parser.

Closes #3011.

## Test Plan

`cargo test`
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

Successfully merging a pull request may close this issue.

2 participants