Skip to content

Commit

Permalink
add post-processing
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfv committed Jan 11, 2024
1 parent c21ba81 commit 0a9ed86
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 60 deletions.
55 changes: 24 additions & 31 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

42 changes: 21 additions & 21 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ minijinja = { version = "1.0.10", features = ["builtins"] }
once_cell = "1.18.0"
pep440_rs = "0.3.12"
pep508_rs = { version = "0.2.3", features = ["modern"] }
rattler = { version = "0.15.0", default-features = false }
rattler_conda_types = { version = "0.15.0", default-features = false }
rattler_digest = { version = "0.15.0", default-features = false }
rattler_lock = { version = "0.15.0", default-features = false }
rattler_networking = { version = "0.15.0", default-features = false }
rattler_repodata_gateway = { version = "0.15.0", default-features = false, features = ["sparse"] }
rattler_shell = { version = "0.15.0", default-features = false, features = ["sysinfo"] }
rattler_solve = { version = "0.15.0", default-features = false, features = ["resolvo"] }
rattler_virtual_packages = { version = "0.15.0", default-features = false }
rattler = { version = "0.16.2", default-features = false }
rattler_conda_types = { version = "0.16.2", default-features = false }
rattler_digest = { version = "0.16.2", default-features = false }
rattler_lock = { version = "0.16.2", default-features = false }
rattler_networking = { version = "0.16.2", default-features = false }
rattler_repodata_gateway = { version = "0.16.2", default-features = false, features = ["sparse"] }
rattler_shell = { version = "0.16.2", default-features = false, features = ["sysinfo"] }
rattler_solve = { version = "0.16.2", default-features = false, features = ["resolvo"] }
rattler_virtual_packages = { version = "0.16.2", default-features = false }
regex = "1.10.2"
reqwest = { version = "0.11.22", default-features = false }
rip = { package = "rattler_installs_packages", version = "0.1.0", default-features = false }
Expand All @@ -73,24 +73,24 @@ libc = { version = "0.2.150", default-features = false }
signal-hook = "0.3.17"

[dev-dependencies]
rattler_digest = "0.15.0"
rattler_digest = "0.16.2"
serde_json = "1.0.108"
serial_test = "2.0.0"
tokio = { version = "1.34.0", features = ["rt"] }
toml = "0.8.8"

[patch.crates-io]
rattler = { git = "https://github.com/mamba-org/rattler", branch = "main" }
rattler_conda_types = { git = "https://github.com/mamba-org/rattler", branch = "main" }
rattler_digest = { git = "https://github.com/mamba-org/rattler", branch = "main" }
rattler_lock = { git = "https://github.com/mamba-org/rattler", branch = "main" }
rattler_networking = { git = "https://github.com/mamba-org/rattler", branch = "main" }
rattler_repodata_gateway = { git = "https://github.com/mamba-org/rattler", branch = "main" }
rattler_shell = { git = "https://github.com/mamba-org/rattler", branch = "main" }
rattler_solve = { git = "https://github.com/mamba-org/rattler", branch = "main" }
rattler_virtual_packages = { git = "https://github.com/mamba-org/rattler", branch = "main" }
#rip = { package = "rattler_installs_packages", git = "https://github.com/prefix-dev/rattler_installs_packages", branch = "main" }
#deno_task_shell = { path = "../deno_task_shell" }
# rattler = { git = "https://github.com/mamba-org/rattler", branch = "main" }
# rattler_conda_types = { git = "https://github.com/mamba-org/rattler", branch = "main" }
# rattler_digest = { git = "https://github.com/mamba-org/rattler", branch = "main" }
# rattler_lock = { git = "https://github.com/mamba-org/rattler", branch = "main" }
# rattler_networking = { git = "https://github.com/mamba-org/rattler", branch = "main" }
# rattler_repodata_gateway = { git = "https://github.com/mamba-org/rattler", branch = "main" }
# rattler_shell = { git = "https://github.com/mamba-org/rattler", branch = "main" }
# rattler_solve = { git = "https://github.com/mamba-org/rattler", branch = "main" }
# rattler_virtual_packages = { git = "https://github.com/mamba-org/rattler", branch = "main" }
# rip = { package = "rattler_installs_packages", git = "https://github.com/prefix-dev/rattler_installs_packages", branch = "main" }
# deno_task_shell = { path = "../deno_task_shell" }

rattler = { path = "../rattler/crates/rattler" }
rattler_conda_types = { path = "../rattler/crates/rattler_conda_types" }
Expand Down
2 changes: 1 addition & 1 deletion src/cli/global/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ pub(super) async fn globally_install_package(

// Create the transaction that we need
let transaction = Transaction::from_current_and_desired(
prefix_records,
prefix_records.clone(),
records.iter().cloned(),
Platform::current(),
)
Expand Down
9 changes: 6 additions & 3 deletions src/environment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -265,9 +265,12 @@ pub async fn update_prefix_conda(
let desired_conda_packages = lock_file
.get_conda_packages_by_platform(platform)
.into_diagnostic()?;
let transaction =
Transaction::from_current_and_desired(installed_packages.clone(), desired_conda_packages, platform)
.into_diagnostic()?;
let transaction = Transaction::from_current_and_desired(
installed_packages.clone(),
desired_conda_packages,
platform,
)
.into_diagnostic()?;

// Execute the transaction if there is work to do
if !transaction.operations.is_empty() {
Expand Down
13 changes: 9 additions & 4 deletions src/install.rs
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
use crate::default_retry_policy;
use crate::prefix::Prefix;
use crate::progress::{
default_progress_style, finished_progress_style, global_multi_progress,
ProgressBarMessageFormatter,
};
use futures::future::ready;
use futures::{stream, FutureExt, StreamExt, TryFutureExt, TryStreamExt};
use itertools::Itertools;
use miette::{IntoDiagnostic, WrapErr};
use miette::IntoDiagnostic;
use rattler::install::{
link_package, unlink, unlink_package, InstallDriver, InstallOptions, Transaction,
self, link_package, unlink_package, InstallDriver, InstallOptions, Transaction,
TransactionOperation,
};
use rattler::package_cache::PackageCache;
use rattler_conda_types::{PrefixRecord, RepoDataRecord};
use rattler_networking::AuthenticatedClient;
use std::cmp::Ordering;
use std::io::ErrorKind;
use std::path::{Path, PathBuf};
use std::time::Duration;

Expand All @@ -31,7 +31,7 @@ pub async fn execute_transaction(
let package_cache = PackageCache::new(cache_dir.join("pkgs"));

// Create an install driver which helps limit the number of concurrent filesystem operations
let install_driver = InstallDriver::new(100, Some(&installed_packages));
let install_driver = InstallDriver::new(100, Some(installed_packages));

// Define default installation options.
let install_options = InstallOptions {
Expand Down Expand Up @@ -141,6 +141,11 @@ pub async fn execute_transaction(
}
link_pb.into_progress_bar().finish_and_clear();

let prefix_records = PrefixRecord::collect_from_prefix(&target_prefix).into_diagnostic()?;
install_driver
.post_process(&prefix_records, &target_prefix)
.into_diagnostic()?;

result
}

Expand Down

0 comments on commit 0a9ed86

Please sign in to comment.