diff --git a/Cargo.lock b/Cargo.lock index 9e0ca9de0..8283a14f4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1377,8 +1377,6 @@ dependencies = [ [[package]] name = "file_url" version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2789b7b3e160530d89d1e126aff9811c3421bb77ebb9b62ffa3abbeba69f12d" dependencies = [ "itertools 0.13.0", "percent-encoding", @@ -3791,7 +3789,7 @@ version = "0.1.0" dependencies = [ "console", "lazy_static", - "rattler_cache", + "rattler_cache 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", "url", ] @@ -4331,8 +4329,6 @@ dependencies = [ [[package]] name = "rattler" version = "0.28.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "238dd1b6ca1f2e622e438092e6523a37c6b018e25b236406a6aa182d13885b39" dependencies = [ "anyhow", "clap", @@ -4349,7 +4345,7 @@ dependencies = [ "memmap2 0.9.5", "once_cell", "parking_lot 0.12.3", - "rattler_cache", + "rattler_cache 0.2.13", "rattler_conda_types", "rattler_digest", "rattler_networking", @@ -4359,7 +4355,7 @@ dependencies = [ "regex", "reqwest", "reqwest-middleware", - "simple_spawn_blocking", + "simple_spawn_blocking 1.0.0", "smallvec", "tempfile", "thiserror 1.0.69", @@ -4369,6 +4365,33 @@ dependencies = [ "uuid", ] +[[package]] +name = "rattler_cache" +version = "0.2.13" +dependencies = [ + "anyhow", + "dashmap", + "digest", + "dirs", + "fs-err 3.0.0", + "fs4", + "futures", + "fxhash", + "itertools 0.13.0", + "parking_lot 0.12.3", + "rattler_conda_types", + "rattler_digest", + "rattler_networking", + "rattler_package_streaming", + "reqwest", + "reqwest-middleware", + "simple_spawn_blocking 1.0.0", + "thiserror 1.0.69", + "tokio", + "tracing", + "url", +] + [[package]] name = "rattler_cache" version = "0.2.13" @@ -4391,7 +4414,7 @@ dependencies = [ "rattler_package_streaming", "reqwest", "reqwest-middleware", - "simple_spawn_blocking", + "simple_spawn_blocking 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "thiserror 1.0.69", "tokio", "tracing", @@ -4401,8 +4424,6 @@ dependencies = [ [[package]] name = "rattler_conda_types" version = "0.29.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa6e2010c1a639982d9c22766598159dbeda9b5701ab01a863c66e55520c1ba1" dependencies = [ "chrono", "dirs", @@ -4437,8 +4458,6 @@ dependencies = [ [[package]] name = "rattler_digest" version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6a97526971dd357657ea4c88f6d39b31b2875c87dfe9fd12aac305fec6c0f60" dependencies = [ "blake2", "digest", @@ -4454,8 +4473,6 @@ dependencies = [ [[package]] name = "rattler_lock" version = "0.22.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8bddb02b5eb7bbf245438f1b5eb7feb44c0186bf7d8750b51c4cdf046e0dcff" dependencies = [ "chrono", "file_url", @@ -4479,8 +4496,6 @@ dependencies = [ [[package]] name = "rattler_macros" version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19eadf6fea87bd67d9d4c372caa3c2bed33cd91cdc235ce86210d7bc513ae0a4" dependencies = [ "quote", "syn", @@ -4489,8 +4504,6 @@ dependencies = [ [[package]] name = "rattler_networking" version = "0.21.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40f5ad1da789b5bbe9585b4d255f2df82c676a951e2f002a76bf9fa7389c4962" dependencies = [ "anyhow", "async-trait", @@ -4518,8 +4531,6 @@ dependencies = [ [[package]] name = "rattler_package_streaming" version = "0.22.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b881c9f633407c171a62809e754315e09d273edcf4e9217d2cc4b102721e65c" dependencies = [ "bzip2", "chrono", @@ -4547,8 +4558,6 @@ dependencies = [ [[package]] name = "rattler_redaction" version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "575cd5c830c5c2d25412531c5a3d307a0ca66ddccc466baaa5219cfa9e90c60e" dependencies = [ "reqwest", "reqwest-middleware", @@ -4558,8 +4567,6 @@ dependencies = [ [[package]] name = "rattler_repodata_gateway" version = "0.21.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "315d710364bd4ca46ed37fbb06f50d3e4774f5b7775fb77f1f232d35632fa149" dependencies = [ "anyhow", "async-compression", @@ -4587,7 +4594,7 @@ dependencies = [ "ouroboros", "parking_lot 0.12.3", "pin-project-lite", - "rattler_cache", + "rattler_cache 0.2.13", "rattler_conda_types", "rattler_digest", "rattler_networking", @@ -4598,7 +4605,7 @@ dependencies = [ "serde", "serde_json", "serde_with", - "simple_spawn_blocking", + "simple_spawn_blocking 1.0.0", "superslice", "tempfile", "thiserror 1.0.69", @@ -4613,8 +4620,6 @@ dependencies = [ [[package]] name = "rattler_shell" version = "0.22.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "070b851b93cd8973a6e9377c06323aca1d8faeeeb5b59f80f3cd1e2c8a7684bf" dependencies = [ "enum_dispatch", "fs-err 3.0.0", @@ -4632,8 +4637,6 @@ dependencies = [ [[package]] name = "rattler_solve" version = "1.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "948f7a8d90cfe3cd48637724d2112a82928cdedb1f17027ce1019927cc8ad977" dependencies = [ "chrono", "futures", @@ -4651,8 +4654,6 @@ dependencies = [ [[package]] name = "rattler_virtual_packages" version = "1.1.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7567e46d8ad302bbc3c5d657843c957d481a2c6b7c45397d95e0cd4b8ae47a17" dependencies = [ "archspec", "libloading", @@ -5627,6 +5628,13 @@ dependencies = [ "time", ] +[[package]] +name = "simple_spawn_blocking" +version = "1.0.0" +dependencies = [ + "tokio", +] + [[package]] name = "simple_spawn_blocking" version = "1.0.0" diff --git a/Cargo.toml b/Cargo.toml index bd8f64ba8..17ffd58ce 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -359,6 +359,18 @@ tokio = { workspace = true, features = ["rt"] } #rattler_solve = { git = "https://github.com/conda/rattler", branch = "main" } #rattler_virtual_packages = { git = "https://github.com/conda/rattler", branch = "main" } +file_url = { path = "/var/home/julian/Projekte/github.com/prefix-dev/rattler/crates/file_url" } +rattler = { path = "/var/home/julian/Projekte/github.com/prefix-dev/rattler/crates/rattler" } +rattler_conda_types = { path = "/var/home/julian/Projekte/github.com/prefix-dev/rattler/crates/rattler_conda_types" } +rattler_digest = { path = "/var/home/julian/Projekte/github.com/prefix-dev/rattler/crates/rattler_digest" } +rattler_lock = { path = "/var/home/julian/Projekte/github.com/prefix-dev/rattler/crates/rattler_lock" } +rattler_networking = { path = "/var/home/julian/Projekte/github.com/prefix-dev/rattler/crates/rattler_networking" } +rattler_package_streaming = { path = "/var/home/julian/Projekte/github.com/prefix-dev/rattler/crates/rattler_package_streaming" } +rattler_repodata_gateway = { path = "/var/home/julian/Projekte/github.com/prefix-dev/rattler/crates/rattler_repodata_gateway" } +rattler_shell = { path = "/var/home/julian/Projekte/github.com/prefix-dev/rattler/crates/rattler_shell" } +rattler_solve = { path = "/var/home/julian/Projekte/github.com/prefix-dev/rattler/crates/rattler_solve" } +rattler_virtual_packages = { path = "/var/home/julian/Projekte/github.com/prefix-dev/rattler/crates/rattler_virtual_packages" } + # Config for 'dist' [workspace.metadata.dist] # The preferred dist version to use in CI (Cargo.toml SemVer syntax) diff --git a/crates/pixi_record/src/pinned_source.rs b/crates/pixi_record/src/pinned_source.rs index e355365f6..1d7c26169 100644 --- a/crates/pixi_record/src/pinned_source.rs +++ b/crates/pixi_record/src/pinned_source.rs @@ -70,6 +70,10 @@ impl PinnedSourceSpec { } } + pub fn editable(&self) -> bool { + self.as_path().map(|p| p.editable).unwrap_or(false) + } + /// Converts this instance into a [`MutablePinnedSourceSpec`], or if this /// instance does not refer to mutable source the original /// [`PinnedSourceSpec`]. @@ -147,6 +151,7 @@ impl From for PinnedSourceSpec { #[derive(Debug, Clone)] pub struct PinnedPathSpec { pub path: Utf8TypedPathBuf, + pub editable: bool, } impl PinnedPathSpec { @@ -204,7 +209,11 @@ impl TryFrom for PinnedSourceSpec { fn try_from(value: UrlOrPath) -> Result { match value { UrlOrPath::Url(_) => unimplemented!(), - UrlOrPath::Path(path) => Ok(PinnedPathSpec { path }.into()), + UrlOrPath::Path(path) => Ok(PinnedPathSpec { + path, + editable: false, + } + .into()), } } } diff --git a/crates/pixi_record/src/source_record.rs b/crates/pixi_record/src/source_record.rs index d6538ec76..5692a3fae 100644 --- a/crates/pixi_record/src/source_record.rs +++ b/crates/pixi_record/src/source_record.rs @@ -21,6 +21,9 @@ pub struct SourceRecord { /// If this is `None`, the input hash was not computed or is not relevant /// for this record. The record can always be considered up to date. pub input_hash: Option, + + /// Whether the package is installed as editable + pub editable: bool, } /// Defines the hash of the input files that were used to build the metadata of @@ -45,6 +48,7 @@ impl From for CondaPackageData { hash: i.hash, globs: i.globs, }), + editable: value.editable, }) } } @@ -60,6 +64,7 @@ impl TryFrom for SourceRecord { hash: hash.hash, globs: hash.globs, }), + editable: value.editable, }) } } diff --git a/crates/pixi_spec/src/lib.rs b/crates/pixi_spec/src/lib.rs index e9bcce250..6c5df321d 100644 --- a/crates/pixi_spec/src/lib.rs +++ b/crates/pixi_spec/src/lib.rs @@ -332,6 +332,16 @@ pub enum SourceSpec { Path(PathSourceSpec), } +impl SourceSpec { + /// Whether the spec is editable + pub fn editable(&self) -> bool { + match self { + Self::Path(path) => path.editable, + _ => false, + } + } +} + impl From for PixiSpec { fn from(value: SourceSpec) -> Self { match value { diff --git a/crates/pixi_spec/src/path.rs b/crates/pixi_spec/src/path.rs index 82873527d..5d716e71f 100644 --- a/crates/pixi_spec/src/path.rs +++ b/crates/pixi_spec/src/path.rs @@ -6,7 +6,7 @@ use typed_path::{Utf8NativePathBuf, Utf8TypedPathBuf}; use crate::{BinarySpec, SpecConversionError}; -/// A specification of a package from a git repository. +/// A specification of a package from a path. #[derive(Debug, Clone, Hash, Eq, PartialEq)] pub struct PathSpec { /// The path to the package diff --git a/src/build/mod.rs b/src/build/mod.rs index 228dc63ba..6c63eddba 100644 --- a/src/build/mod.rs +++ b/src/build/mod.rs @@ -266,8 +266,8 @@ impl BuildContext { channel_configuration: ChannelConfiguration { base_url: self.channel_config.channel_alias.clone(), }, - // FIXME - editable: Some(PathBuf::from_str("/var/home/julian/Projekte/github.com/prefix-dev/pixi-1/pytest-temp/test_editable_pyproject0/editable-pyproject").unwrap()), + // FIXME: don't hardcode path, also figure out why source_spec.editable is false + editable: source_spec.editable.then(|| PathBuf::from_str("/var/home/julian/Projekte/github.com/prefix-dev/pixi-1/pytest-temp/test_editable_pyproject0/editable-pyproject").unwrap()), outputs: Some(vec![CondaOutputIdentifier { name: Some(source_spec.package_record.name.as_normalized().to_string()), version: Some(source_spec.package_record.version.version().to_string()), @@ -371,6 +371,7 @@ impl BuildContext { path: source_path, pinned: PinnedPathSpec { path: path.path.clone(), + editable: source_spec.editable(), } .into(), }) @@ -625,6 +626,7 @@ fn source_metadata_to_records( SourceRecord { input_hash: input_hash.clone(), source: source.pinned.clone(), + editable: source.pinned.editable(), package_record: PackageRecord { // We cannot now these values from the metadata because no actual package // was built yet. diff --git a/src/cli/install.rs b/src/cli/install.rs index 3fd2507a4..e6b8234a1 100644 --- a/src/cli/install.rs +++ b/src/cli/install.rs @@ -31,6 +31,18 @@ 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 9eee95d4e..1689ddba8 100644 --- a/src/environment.rs +++ b/src/environment.rs @@ -762,6 +762,7 @@ 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) diff --git a/src/lock_file/update.rs b/src/lock_file/update.rs index 3021e99e8..1fdc30529 100644 --- a/src/lock_file/update.rs +++ b/src/lock_file/update.rs @@ -74,7 +74,7 @@ impl Project { &self, options: UpdateLockFileOptions, ) -> miette::Result> { - self::update_lock_file(self, options).await + update_lock_file(self, options).await } /// Get lockfile without checking diff --git a/tests/integration_python/pixi_build/test_build.py b/tests/integration_python/pixi_build/test_build.py index c7218a9ed..a797666b1 100644 --- a/tests/integration_python/pixi_build/test_build.py +++ b/tests/integration_python/pixi_build/test_build.py @@ -152,7 +152,6 @@ def test_editable_pyproject(pixi: Path, build_data: Path, tmp_pixi_workspace: Pa env=env, ) - # TODO: Is it always re-installing? If yes, how can we avoid that? # Verify that package is installed as editable verify_cli_command( [