diff --git a/crates/pixi_record/src/lib.rs b/crates/pixi_record/src/lib.rs index ad1d0d72a..3324eefb5 100644 --- a/crates/pixi_record/src/lib.rs +++ b/crates/pixi_record/src/lib.rs @@ -99,6 +99,9 @@ pub enum ParseLockFileError { #[error("invalid url for package {0}")] InvalidRecordUrl(UrlOrPath, #[source] file_url::FileURLParseError), + #[error("type of package {0} needs to be {1}")] + InvalidType(UrlOrPath, String), + #[error(transparent)] PinnedSourceSpecError(#[from] pinned_source::ParseError), } diff --git a/crates/pixi_record/src/pinned_source.rs b/crates/pixi_record/src/pinned_source.rs index 1d7c26169..3a575832d 100644 --- a/crates/pixi_record/src/pinned_source.rs +++ b/crates/pixi_record/src/pinned_source.rs @@ -203,21 +203,6 @@ impl From for UrlOrPath { #[derive(Debug, Error)] pub enum ParseError {} -impl TryFrom for PinnedSourceSpec { - type Error = ParseError; - - fn try_from(value: UrlOrPath) -> Result { - match value { - UrlOrPath::Url(_) => unimplemented!(), - UrlOrPath::Path(path) => Ok(PinnedPathSpec { - path, - editable: false, - } - .into()), - } - } -} - #[derive(Debug, Error)] pub enum SourceMismatchError { #[error("the locked path '{locked}' does not match the requested path '{requested}'")] diff --git a/crates/pixi_record/src/source_record.rs b/crates/pixi_record/src/source_record.rs index 5692a3fae..876c1ee67 100644 --- a/crates/pixi_record/src/source_record.rs +++ b/crates/pixi_record/src/source_record.rs @@ -1,9 +1,9 @@ use rattler_conda_types::{MatchSpec, Matches, NamelessMatchSpec, PackageRecord}; use rattler_digest::{Sha256, Sha256Hash}; -use rattler_lock::{CondaPackageData, CondaSourceData}; +use rattler_lock::{CondaPackageData, CondaSourceData, UrlOrPath}; use serde::{Deserialize, Serialize}; -use crate::{ParseLockFileError, PinnedSourceSpec}; +use crate::{ParseLockFileError, PinnedPathSpec, PinnedSourceSpec}; /// A record of a conda package that still requires building. #[derive(Debug, Clone)] @@ -59,7 +59,19 @@ impl TryFrom for SourceRecord { fn try_from(value: CondaSourceData) -> Result { Ok(Self { package_record: value.package_record, - source: value.location.try_into()?, + source: value + .location + .as_path() + .map(|path| { + PinnedPathSpec { + path: path.to_path_buf(), + editable: value.editable, + } + .into() + }) + .ok_or_else(|| { + ParseLockFileError::InvalidType(value.location, "Path".to_string()) + })?, input_hash: value.input.map(|hash| InputHash { hash: hash.hash, globs: hash.globs, diff --git a/src/cli/install.rs b/src/cli/install.rs index e6b8234a1..3fd2507a4 100644 --- a/src/cli/install.rs +++ b/src/cli/install.rs @@ -31,18 +31,6 @@ pub async fn execute(args: Args) -> miette::Result<()> { let project = Project::load_or_else_discover(args.project_config.manifest_path.as_deref())? .with_cli_config(args.config); - dbg!(&project.clone().manifest.package.unwrap()); - dbg!( - &project - .clone() - .manifest - .workspace - .default_feature() - .targets - .default() - .dependencies - ); - // Install either: // // 1. specific environments diff --git a/src/environment.rs b/src/environment.rs index 1689ddba8..9eee95d4e 100644 --- a/src/environment.rs +++ b/src/environment.rs @@ -762,7 +762,6 @@ pub async fn update_prefix_conda( let mut progress_reporter = None; let source_records_length = source_records.len(); - dbg!(&source_records); // Build conda packages out of the source records let mut processed_source_packages = stream::iter(source_records) .map(Ok)