Skip to content

Commit

Permalink
Hook up remaining things and remove debug prints
Browse files Browse the repository at this point in the history
  • Loading branch information
Hofer-Julian committed Dec 10, 2024
1 parent 85ce0f6 commit 5eeda8a
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 31 deletions.
3 changes: 3 additions & 0 deletions crates/pixi_record/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
}
Expand Down
15 changes: 0 additions & 15 deletions crates/pixi_record/src/pinned_source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,21 +203,6 @@ impl From<PinnedUrlSpec> for UrlOrPath {
#[derive(Debug, Error)]
pub enum ParseError {}

impl TryFrom<UrlOrPath> for PinnedSourceSpec {
type Error = ParseError;

fn try_from(value: UrlOrPath) -> Result<Self, Self::Error> {
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}'")]
Expand Down
18 changes: 15 additions & 3 deletions crates/pixi_record/src/source_record.rs
Original file line number Diff line number Diff line change
@@ -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)]
Expand Down Expand Up @@ -59,7 +59,19 @@ impl TryFrom<CondaSourceData> for SourceRecord {
fn try_from(value: CondaSourceData) -> Result<Self, Self::Error> {
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,
Expand Down
12 changes: 0 additions & 12 deletions src/cli/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion src/environment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 5eeda8a

Please sign in to comment.