Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: expose AllowedYanks #2608

Merged
merged 1 commit into from
Mar 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions crates/uv-resolver/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ pub use resolver::{
WheelMetadataResult,
};
pub use version_map::VersionMap;
pub use yanks::AllowedYanks;

mod bare;
mod candidate_selector;
Expand Down
7 changes: 2 additions & 5 deletions crates/uv-resolver/src/yanks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use crate::Manifest;
pub struct AllowedYanks(FxHashMap<PackageName, FxHashSet<Version>>);

impl AllowedYanks {
pub(crate) fn from_manifest(manifest: &Manifest, markers: &MarkerEnvironment) -> Self {
pub fn from_manifest(manifest: &Manifest, markers: &MarkerEnvironment) -> Self {
let mut allowed_yanks = FxHashMap::<PackageName, FxHashSet<Version>>::default();
for requirement in manifest
.requirements
Expand Down Expand Up @@ -52,10 +52,7 @@ impl AllowedYanks {

/// Returns versions for the given package which are allowed even if marked as yanked by the
/// relevant index.
pub(crate) fn allowed_versions(
&self,
package_name: &PackageName,
) -> Option<&FxHashSet<Version>> {
pub fn allowed_versions(&self, package_name: &PackageName) -> Option<&FxHashSet<Version>> {
self.0.get(package_name)
}
}
Loading