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

Having tool.uv.sources to use a "find-links" directive instead of direct indexes or urls #12238

Closed
jackmedda opened this issue Mar 17, 2025 · 2 comments
Assignees
Labels
question Asking for clarification or support

Comments

@jackmedda
Copy link

jackmedda commented Mar 17, 2025

Question

I have been preparing a pyproject.toml that depends on DGL and I want the installation to be platform-specific (as DGL does not support Windows anymore and the last supported version is 2.2.1, while on Linux the installation depends on the corresponding PyTorch version).
Due to the installation process similar to PyTorch, I found out the documentation section on PyTorch integration and replicated the same configuration.

However, I noticed only later that DGL suggest using the pip --find-links (-f) parameter to find the correct installation, as uv output when I tried to use uv.tool.sources with uv.tool.index was

hint: An index URL (https://data.dgl.ai/wheels/torch-2.4/repo.html)
could not be queried due to a lack of valid authentication credentials
(403 Forbidden).

I don't necessarily need DGL to work on a CUDA-environment as it is not used for heavy operations or training, so the result envisioned by the following example should be enough.

[project]
name = "example"
dependencies = [
    "dgl>=2.2.0",
]

[tool.uv.sources]
dgl = [
  { find_links = "https://data.dgl.ai/wheels/repo.html", marker = "platform_system == 'Windows'" },
  { find_links = "https://data.dgl.ai/wheels/torch-2.4/repo.html", marker = "platform_system != 'Windows'" },
]

I didn't find any way in the documentation to achieve the same result, and using path or url does not help, as they expect a specific path to a source distribution file.
Instead, I would like uv to resolve automatically the dgl version as --find-links would do.
Could you help me?

Platform

Windows 11 x86_64

Version

uv 0.6.3

@jackmedda jackmedda added the question Asking for clarification or support label Mar 17, 2025
@charliermarsh
Copy link
Member

Yeah this doesn't exist yet. The way we plan to do it is: allow --find-links style entries in [[tool.uv.index]]. Then you'd reference it as any other index in tool.uv.sources.

@charliermarsh charliermarsh self-assigned this Mar 18, 2025
@jackmedda
Copy link
Author

Thanks for your reply. I'll opt for another solution and wait for this feature to be included.

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

No branches or pull requests

2 participants