mirror of
https://github.com/astral-sh/uv.git
synced 2025-08-04 19:08:04 +00:00
Implement --find-links
as flat indexes (directories in pip-compile) (#912)
Add directory `--find-links` support for local paths to pip-compile. It seems that pip joins all sources and then picks the best package. We explicitly give find links packages precedence if the same exists on an index and locally by prefilling the `VersionMap`, otherwise they are added as another index and the existing rules of precedence apply. Internally, the feature is called _flat index_, which is more meaningful than _find links_: We're not looking for links, we're picking up local directories, and (TBD) support another index format that's just a flat list of files instead of a nested index. `RegistryBuiltDist` and `RegistrySourceDist` now use `WheelFilename` and `SourceDistFilename` respectively. The `File` inside `RegistryBuiltDist` and `RegistrySourceDist` gained the ability to represent both a url and a path so that `--find-links` with a url and with a path works the same, both being locked as `<package_name>@<version>` instead of `<package_name> @ <url>`. (This is more of a detail, this PR in general still work if we strip that and have directory find links represented as `<package_name> @ file:///path/to/file.ext`) `PrioritizedDistribution` and `FlatIndex` have been moved to locations where we can use them in the upstack PR. I added a `scripts/wheels` directory with stripped down wheels to use for testing. We're lacking tests for correct tag priority precedence with flat indexes, i only confirmed this manually since it is not covered in the pip-compile or pip-sync output. Closes #876
This commit is contained in:
parent
5ffbfadf66
commit
e9b6b6fa36
42 changed files with 1069 additions and 483 deletions
BIN
scripts/wheels/maturin-1.4.0-py3-none-any.whl
Normal file
BIN
scripts/wheels/maturin-1.4.0-py3-none-any.whl
Normal file
Binary file not shown.
BIN
scripts/wheels/maturin-2.0.0-py3-none-linux_x86_64.whl
Normal file
BIN
scripts/wheels/maturin-2.0.0-py3-none-linux_x86_64.whl
Normal file
Binary file not shown.
BIN
scripts/wheels/tqdm-1000.0.0-py3-none-any.whl
Normal file
BIN
scripts/wheels/tqdm-1000.0.0-py3-none-any.whl
Normal file
Binary file not shown.
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue