Skip to content

Commit

Permalink
Reverts
Browse files Browse the repository at this point in the history
  • Loading branch information
charliermarsh committed Nov 21, 2024
1 parent a265770 commit 6115076
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 547 deletions.
44 changes: 26 additions & 18 deletions crates/uv-resolver/src/candidate_selector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,24 +138,32 @@ impl CandidateSelector {
) -> Option<Candidate> {
// In the branches, we "sort" the preferences by marker-matching through an iterator that
// first has the matching half and then the mismatching half.
let preferences_match = preferences.get(package_name).filter(|(marker, _index, _version)| {
// `.unwrap_or(true)` because the universal marker is considered matching.
marker
.map(|marker| env.included_by_marker(marker))
.unwrap_or(true)
});
let preferences_mismatch = preferences.get(package_name).filter(|(marker,_index, _version)| {
marker
.map(|marker| !env.included_by_marker(marker))
.unwrap_or(false)
});
let preferences = preferences_match.chain(preferences_mismatch).filter_map(|(marker, source, version)| {
if source == index {
Some((marker, version))
} else {
None
}
});
let preferences_match =
preferences
.get(package_name)
.filter(|(marker, _index, _version)| {
// `.unwrap_or(true)` because the universal marker is considered matching.
marker
.map(|marker| env.included_by_marker(marker))
.unwrap_or(true)
});
let preferences_mismatch =
preferences
.get(package_name)
.filter(|(marker, _index, _version)| {
marker
.map(|marker| !env.included_by_marker(marker))
.unwrap_or(false)
});
let preferences = preferences_match.chain(preferences_mismatch).filter_map(
|(marker, source, version)| {
if source == index {
Some((marker, version))
} else {
None
}
},
);
self.get_preferred_from_iter(
preferences,
package_name,
Expand Down
8 changes: 0 additions & 8 deletions crates/uv-resolver/src/resolver/environment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -333,14 +333,6 @@ impl ResolverEnvironment {
}
}

/// Returns `true` if this resolver environment has conflicts.
pub(crate) fn has_conflicts(&self) -> bool {
match self.kind {
Kind::Specific { .. } => false,
Kind::Universal { ref exclude, .. } => !exclude.is_empty(),
}
}

/// Returns a requires-python version range derived from the marker
/// expression describing this resolver environment.
///
Expand Down
6 changes: 0 additions & 6 deletions crates/uv-resolver/src/resolver/fork_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,4 @@ impl<T> ForkMap<T> {
.map(|entry| &entry.value)
.collect()
}
//
// /// Returns the single value associated with a package, if the value is compatible with all
// /// forks.
// pub fn entries(&self, package_name: &PackageName) -> &[Entry<T>] {
// self.0.get(package_name).map(Vec::as_slice).unwrap_or_default()
// }
}
16 changes: 0 additions & 16 deletions crates/uv-resolver/src/resolver/indexes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,22 +59,6 @@ impl Indexes {
self.0.contains_key(name)
}

// /// Returns the explicit index used for a package, if it's known to be used for all forks.
// pub(crate) fn contains_many(&self, name: &PackageName) -> bool {
// match self.0.entries(name) {
// [] => false,
// [index] => index. index.conflict.is_none(),
// _ => false,
//
// }
// let entry = self.0.get(name)?;
// if entry.conflict.is_none() {
// Some(&entry.index)
// } else {
// None
// }
// }

/// Return the explicit index used for a package in the given fork.
pub(crate) fn get(&self, name: &PackageName, env: &ResolverEnvironment) -> Vec<&IndexUrl> {
let entries = self.0.get(name, env);
Expand Down
Empty file removed foo/README.md
Empty file.
6 changes: 0 additions & 6 deletions foo/hello.py

This file was deleted.

36 changes: 0 additions & 36 deletions foo/pyproject.toml

This file was deleted.

Loading

0 comments on commit 6115076

Please sign in to comment.