diff --git a/crates/rattler_conda_types/src/channel/mod.rs b/crates/rattler_conda_types/src/channel/mod.rs index aaf46d844..7b198f56a 100644 --- a/crates/rattler_conda_types/src/channel/mod.rs +++ b/crates/rattler_conda_types/src/channel/mod.rs @@ -251,9 +251,11 @@ impl Channel { } /// Constructs a new [`Channel`] from a `Url` and associated platforms. - pub fn from_url(url: Url) -> Self { + pub fn from_url(url: impl Into) -> Self { // Get the path part of the URL but trim the directory suffix - let path = url.path().trim_end_matches('/'); + let url: ChannelUrl = url.into(); + + let path = url.url().path().trim_end_matches('/'); // Case 1: No path give, channel name is "" @@ -262,13 +264,13 @@ impl Channel { // Case 4: custom_channels matches // Case 5: channel_alias match - if url.has_host() { + if url.url().has_host() { // Case 7: Fallback let name = path.trim_start_matches('/'); Self { platforms: None, name: (!name.is_empty()).then_some(name).map(str::to_owned), - base_url: url.into(), + base_url: url, } } else { // Case 6: non-otherwise-specified file://-type urls @@ -278,7 +280,7 @@ impl Channel { Self { platforms: None, name: (!name.is_empty()).then_some(name).map(str::to_owned), - base_url: url.into(), + base_url: url, } } } diff --git a/py-rattler/Cargo.lock b/py-rattler/Cargo.lock index 2c9c92a0e..89833410a 100644 --- a/py-rattler/Cargo.lock +++ b/py-rattler/Cargo.lock @@ -2674,7 +2674,7 @@ dependencies = [ [[package]] name = "rattler" -version = "0.28.0" +version = "0.28.1" dependencies = [ "anyhow", "console", @@ -2712,7 +2712,7 @@ dependencies = [ [[package]] name = "rattler_cache" -version = "0.2.8" +version = "0.2.9" dependencies = [ "anyhow", "dashmap", @@ -2738,7 +2738,7 @@ dependencies = [ [[package]] name = "rattler_conda_types" -version = "0.29.0" +version = "0.29.1" dependencies = [ "chrono", "dirs", @@ -2787,7 +2787,7 @@ dependencies = [ [[package]] name = "rattler_index" -version = "0.19.34" +version = "0.19.35" dependencies = [ "fs-err 3.0.0", "rattler_conda_types", @@ -2800,7 +2800,7 @@ dependencies = [ [[package]] name = "rattler_lock" -version = "0.22.29" +version = "0.22.30" dependencies = [ "chrono", "file_url", @@ -2855,7 +2855,7 @@ dependencies = [ [[package]] name = "rattler_package_streaming" -version = "0.22.11" +version = "0.22.12" dependencies = [ "bzip2", "chrono", @@ -2890,7 +2890,7 @@ dependencies = [ [[package]] name = "rattler_repodata_gateway" -version = "0.21.20" +version = "0.21.21" dependencies = [ "anyhow", "async-compression", @@ -2943,7 +2943,7 @@ dependencies = [ [[package]] name = "rattler_shell" -version = "0.22.5" +version = "0.22.6" dependencies = [ "enum_dispatch", "fs-err 3.0.0", @@ -2959,7 +2959,7 @@ dependencies = [ [[package]] name = "rattler_solve" -version = "1.2.1" +version = "1.2.2" dependencies = [ "chrono", "futures", @@ -2975,7 +2975,7 @@ dependencies = [ [[package]] name = "rattler_virtual_packages" -version = "1.1.8" +version = "1.1.9" dependencies = [ "archspec", "libloading",