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

feature request: emit index urls in uv export same way as uv pip compile --emit-index-url #10008

Open
Fogapod opened this issue Dec 18, 2024 · 1 comment

Comments

@Fogapod
Copy link

Fogapod commented Dec 18, 2024

I am exporting uv.lock to requirements.txt for bazel.
I have torch index overrides which aren't exported and produce impossible to insall requirements file:

[tool.uv.sources]
torch = [
    { index = "pytorch-cpu" },
]

[[tool.uv.index]]
name = "pytorch-cpu"
url = "https://download.pytorch.org/whl/cpu"
explicit = true

results in:

torch==2.5.1+cpu \
    --hash=sha256:4856f9d6925121d13c2df07aa7580b767f449dfe71ae5acde9c27535d5da4840 \
    --hash=sha256:a6b720410350765d3d77c01a5ce098a6c45af446284e45e87a98b8a16e7d564d

Looks like lock file contains index info so this should be possible:

[[package]]
name = "torch"
version = "2.5.1+cpu"
source = { registry = "https://download.pytorch.org/whl/cpu" }

This probably isn't as simple as writing all indexes to requirements file because ordering matters. Maybe there could be a way to manually give it indexes instead?

@ant0nsc
Copy link

ant0nsc commented Dec 20, 2024

+1 on this issue. We have the exactly same problem with multiple indexes that contain different flavours of torch. It would be great to be able to export a requirements file that contains the full URL where uv is taking the package from.
The format of a requirements.txt file does support supplying the full URL: https://pip.pypa.io/en/stable/reference/requirements-file-format/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants