uv/crates/uv-resolver/src
Chan Kang 7cd98d2499
Implement `--emit-index-annotation` to annotate source index for each package (#2926)
## Summary
resolves https://github.com/astral-sh/uv/issues/2852

## Test Plan
add a couple of tests:
- one covering the simplest case with all packages pulled from a single
index.
- another where packages are pull from two distinct indices.

tested manually as well:
```
$ (echo 'pandas'; echo 'torch') | UV_EXTRA_INDEX_URL='https://download.pytorch.org/whl/cpu' cargo run pip compile - --include-indices 
    Finished dev [unoptimized + debuginfo] target(s) in 0.60s
     Running `target/debug/uv pip compile - --include-indices`
Resolved 15 packages in 686ms
# This file was autogenerated by uv via the following command:
#    uv pip compile - --include-indices
filelock==3.9.0
    # via torch
    # from https://download.pytorch.org/whl/cpu
fsspec==2023.4.0
    # via torch
    # from https://download.pytorch.org/whl/cpu
jinja2==3.1.2
    # via torch
    # from https://download.pytorch.org/whl/cpu
markupsafe==2.1.3
    # via jinja2
    # from https://download.pytorch.org/whl/cpu
mpmath==1.3.0
    # via sympy
    # from https://download.pytorch.org/whl/cpu
networkx==3.2.1
    # via torch
    # from https://download.pytorch.org/whl/cpu
numpy==1.26.3
    # via pandas
    # from https://download.pytorch.org/whl/cpu
pandas==2.2.1
    # from https://pypi.org/simple
python-dateutil==2.9.0.post0
    # via pandas
    # from https://pypi.org/simple
pytz==2024.1
    # via pandas
    # from https://pypi.org/simple
six==1.16.0
    # via python-dateutil
    # from https://pypi.org/simple
sympy==1.12
    # via torch
    # from https://download.pytorch.org/whl/cpu
torch==2.2.2
    # from https://download.pytorch.org/whl/cpu
typing-extensions==4.8.0
    # via torch
    # from https://download.pytorch.org/whl/cpu
tzdata==2024.1
    # via pandas
    # from https://pypi.org/simple
```
2024-04-10 16:05:58 +00:00
..
pubgrub Enforce and backtrack on invalid versions in source metadata (#2954) 2024-04-10 05:13:33 +00:00
resolver Enforce and backtrack on invalid versions in source metadata (#2954) 2024-04-10 05:13:33 +00:00
bare.rs Add support for parsing unnamed URL requirements (#2567) 2024-03-21 03:28:58 +00:00
candidate_selector.rs Refactor candidate selector for batch prefetching (#2832) 2024-04-05 16:51:01 +02:00
dependency_mode.rs Rename to `uv` (#1302) 2024-02-15 11:19:46 -06:00
dependency_provider.rs Update pubgrub to use a dependency provider (#2648) 2024-03-25 15:51:31 +01:00
editables.rs Add support for Metadata 2.2 (#2293) 2024-03-08 16:02:32 +00:00
error.rs Surface invalid metadata as hints in error reports (#2850) 2024-04-09 23:12:10 -04:00
exclusions.rs Split configuration options out of `uv-types` (#2924) 2024-04-09 11:35:53 -05:00
lib.rs Backtrack on distributions with invalid metadata (#2834) 2024-04-05 18:00:48 -04:00
manifest.rs Split configuration options out of `uv-types` (#2924) 2024-04-09 11:35:53 -05:00
options.rs Rename to `uv` (#1302) 2024-02-15 11:19:46 -06:00
pins.rs Consider installed packages during resolution (#2596) 2024-03-28 13:49:17 -05:00
preferences.rs Replace PyPI-internal Hashes representation with flat vector (#2925) 2024-04-09 16:56:16 +00:00
prerelease_mode.rs Add convenience methods to `Manifest` to iterate over requirements (#2701) 2024-03-28 01:03:44 +00:00
python_requirement.rs Trim injected `python_version` marker to (major, minor) (#2395) 2024-03-13 00:11:50 +00:00
redirect.rs Remove redirects from the resolver (#2792) 2024-04-03 02:43:57 +00:00
resolution.rs Implement `--emit-index-annotation` to annotate source index for each package (#2926) 2024-04-10 16:05:58 +00:00
resolution_mode.rs Add convenience methods to `Manifest` to iterate over requirements (#2701) 2024-03-28 01:03:44 +00:00
version_map.rs Replace PyPI-internal Hashes representation with flat vector (#2925) 2024-04-09 16:56:16 +00:00
yanks.rs Use distinct `Constraints` and `Overrides` types more widely (#2741) 2024-03-31 13:46:37 -04:00