mirror of
https://github.com/astral-sh/uv.git
synced 2025-08-04 02:48:17 +00:00
Respect preferences for explicit index dependencies from requirements.txt
(#10690)
## Summary Closes: https://github.com/astral-sh/uv/issues/10383.
This commit is contained in:
parent
75a1a47859
commit
45455b33c0
2 changed files with 50 additions and 3 deletions
|
@ -188,10 +188,9 @@ impl CandidateSelector {
|
|||
.filter(|(marker, _index, _version)| !env.included_by_marker(marker.pep508()));
|
||||
let preferences = preferences_match.chain(preferences_mismatch).filter_map(
|
||||
|(marker, source, version)| {
|
||||
// If the package is mapped to an explicit index, only consider preferences that
|
||||
// match the index.
|
||||
// Ignore preferences that are associated with conflicting indexes.
|
||||
index
|
||||
.map_or(true, |index| source == Some(index))
|
||||
.is_none_or(|index| source.is_none_or(|source| source == index))
|
||||
.then_some((marker, version))
|
||||
},
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue