uv
uv copied to clipboard
`find-links` should be automatically added to `pyproject.toml` after `uv add -f`
After installed a package with --find-links, the next installation will fail because uv is unable to find package without find-links.
Reproduction:
uname -a
# Linux GOOSE 5.15.153.1-microsoft-standard-WSL2 #1 SMP Fri Mar 29 23:14:13 UTC 2024 x86_64 GNU/Linux
uv --version
# uv 0.4.28 (debe67ffd 2024-10-28)
uv init find-links-test && cd find-links-test
# see https://www.dgl.ai/pages/start.html
# the highest version of `dgl` on PyPI is 2.2.1, and the find-link
# below provides version 2.4.0.
uv add dgl -f https://data.dgl.ai/wheels/torch-2.4/cu124/repo.html
# `find-links` are not recorded
cat pyproject.toml
# [project]
# name = "find-links-test"
# version = "0.1.0"
# description = "Add your description here"
# readme = "README.md"
# requires-python = ">=3.11"
# dependencies = [
# "dgl>=2.4.0",
# ]
uv add datasets
# × No solution found when resolving dependencies for split (python_full_version == '3.11.*'):
# ╰─▶ Because only dgl<=2.2.1 is available and your project depends on dgl>=2.4.0, we can conclude that your project's requirements are unsatisfiable.
# help: If you want to add the package regardless of the failed resolution, provide the `--frozen` flag to skip locking and syncing.
# manually adding it to pyproject.toml
cat <<EOF >>pyproject.toml
[tool.uv]
find-links = ["https://data.dgl.ai/wheels/torch-2.4/cu124/repo.html"]
EOF
uv add datasets
# Installed 15 packages in 35ms