mirror of
https://github.com/astral-sh/uv.git
synced 2025-11-14 01:32:24 +00:00
Resolves https://github.com/astral-sh/uv/issues/16067 When we build the dependency graph we add an edge per `Requires-Dist`. If a package publishes multiple marker-guarded requirements (like pylint’s `dill>=…` for different Python versions), more than one marker can evaluate to true at runtime, which gives us several edges pointing to the same installed package node. To avoid printing the package multiple times, we gather all edges targeting that node, pass them through a `Cursor`, and aggregate their requirement details before we print the dependency line. That aggregation does two things: 1. If any edge carries a URL, we return that URL immediately. 2. Otherwise we merge all version specifiers into one canonical PEP 440 string. I've added an integration test, namely `cargo test -p uv --test it --features pypi -- no_duplicate_dependencies_with_markers` exercises the new snapshot that installs pylint (with the real dill duplication scenario present in the original issue) and asserts the tree output, both with and without `--show-version-specifiers`, now shows a single dill entry with the merged constraint. |
||
|---|---|---|
| .. | ||
| src | ||
| tests/it | ||
| Cargo.toml | ||