From d23c976c80d387a9010ce9d62eba614efd75403d Mon Sep 17 00:00:00 2001 From: Kirpal Grewal Date: Sun, 4 Aug 2024 16:10:14 +0100 Subject: [PATCH 1/3] error if editable on non dir --- src/utils/uv/requirements.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/utils/uv/requirements.rs b/src/utils/uv/requirements.rs index ad458a053..a2718dc1a 100644 --- a/src/utils/uv/requirements.rs +++ b/src/utils/uv/requirements.rs @@ -120,8 +120,6 @@ pub fn as_uv_req( .unwrap_or_else(String::new); let verbatim = VerbatimUrl::from_path(canonicalized.clone())?.with_given(given); - // TODO: we should maybe also give an error when editable is used for something - // that is not a directory. if canonicalized.is_dir() { RequirementSource::Directory { install_path: canonicalized, @@ -129,6 +127,12 @@ pub fn as_uv_req( editable: editable.unwrap_or_default(), url: verbatim, } + } else if *editable == Some(true) { + { + return Err(AsPep508Error::EditableIsNotDir { + path: canonicalized, + }); + } } else { RequirementSource::Path { install_path: canonicalized, From 63a5cb211202c784f935a10cf7892f60df141741 Mon Sep 17 00:00:00 2001 From: Kirpal Grewal Date: Sun, 4 Aug 2024 16:16:43 +0100 Subject: [PATCH 2/3] remove unused default_retry_policy() --- src/utils/reqwest.rs | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/utils/reqwest.rs b/src/utils/reqwest.rs index 3ad4ef856..eba2a7eb9 100644 --- a/src/utils/reqwest.rs +++ b/src/utils/reqwest.rs @@ -3,7 +3,6 @@ use std::{path::PathBuf, sync::Arc, time::Duration}; use rattler_networking::{ authentication_storage::{self, backends::file::FileStorageError}, mirror_middleware::Mirror, - retry_policies::ExponentialBackoff, AuthenticationMiddleware, AuthenticationStorage, MirrorMiddleware, OciMiddleware, }; @@ -13,12 +12,6 @@ use std::collections::HashMap; use pixi_config::Config; -/// The default retry policy employed by pixi. -/// TODO: At some point we might want to make this configurable. -pub fn default_retry_policy() -> ExponentialBackoff { - ExponentialBackoff::builder().build_with_max_retries(3) -} - fn auth_middleware(config: &Config) -> Result { if let Some(auth_file) = config.authentication_override_file() { tracing::info!("Loading authentication from file: {:?}", auth_file); From cfc1541340a93d4931c7646af2ced97a5c355e36 Mon Sep 17 00:00:00 2001 From: Kirpal Grewal Date: Sun, 4 Aug 2024 16:18:07 +0100 Subject: [PATCH 3/3] move to workspace dep --- crates/pixi_manifest/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/pixi_manifest/Cargo.toml b/crates/pixi_manifest/Cargo.toml index 040917549..74ab81407 100644 --- a/crates/pixi_manifest/Cargo.toml +++ b/crates/pixi_manifest/Cargo.toml @@ -38,7 +38,7 @@ rattler_solve = { workspace = true, features = ["serde"] } rattler_virtual_packages = { workspace = true } # TODO: Remove these dependencies -console = "0.15.8" +console = { workspace = true } miette = { workspace = true } [dev-dependencies]