Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve pixi global update reporting #2284

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 26 additions & 1 deletion src/global/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
use pixi_config::home_path;
use pixi_manifest::PrioritizedChannel;
use pixi_utils::executable_from_path;
use rattler_conda_types::{Channel, ChannelConfig, NamedChannelOrUrl, PackageRecord, PrefixRecord};
use rattler_conda_types::{
Channel, ChannelConfig, NamedChannelOrUrl, PackageName, PackageRecord, PrefixRecord,
};
use std::collections::HashMap;
use std::ffi::OsStr;
use std::str::FromStr;
Expand Down Expand Up @@ -201,6 +203,11 @@
RemovedExposed(ExposedName),
UpdatedExposed(ExposedName),
AddedPackage(PackageRecord),
RemovedPackage(PackageName),

Check failure on line 206 in src/global/common.rs

View workflow job for this annotation

GitHub Actions / Cargo Lint

variants `RemovedPackage` and `UpdatedPackage` are never constructed

Check failure on line 206 in src/global/common.rs

View workflow job for this annotation

GitHub Actions / Build Binary | Linux-x86_64

variants `RemovedPackage` and `UpdatedPackage` are never constructed

Check failure on line 206 in src/global/common.rs

View workflow job for this annotation

GitHub Actions / Build Binary | Linux-aarch64

variants `RemovedPackage` and `UpdatedPackage` are never constructed

Check failure on line 206 in src/global/common.rs

View workflow job for this annotation

GitHub Actions / Build Binary | macOS-x86

variants `RemovedPackage` and `UpdatedPackage` are never constructed

Check failure on line 206 in src/global/common.rs

View workflow job for this annotation

GitHub Actions / Build Binary | macOS-arm

variants `RemovedPackage` and `UpdatedPackage` are never constructed

Check failure on line 206 in src/global/common.rs

View workflow job for this annotation

GitHub Actions / Build Binary | Windows

variants `RemovedPackage` and `UpdatedPackage` are never constructed

Check failure on line 206 in src/global/common.rs

View workflow job for this annotation

GitHub Actions / Build Binary | Windows-arm

variants `RemovedPackage` and `UpdatedPackage` are never constructed
UpdatedPackage {
old_pkg: PackageRecord,
new_pkg: PackageRecord,
},
AddedEnvironment,
RemovedEnvironment,
UpdatedEnvironment,
Expand Down Expand Up @@ -350,6 +357,24 @@
env_name.fancy_display()
);
}
StateChange::RemovedPackage(pkg_name) => {
eprintln!(
"{}Removed package {} from environment {}.",
console::style(console::Emoji("✔ ", "")).green(),
console::style(pkg_name.as_normalized()).green(),
env_name.fancy_display()
);
}
StateChange::UpdatedPackage { old_pkg, new_pkg } => {
eprintln!(
"{}Updated package {} of environment {} from {} to {}.",
console::style(console::Emoji("✔ ", "")).green(),
console::style(old_pkg.name.as_normalized()).green(),
console::style(&old_pkg.version).blue(),
console::style(&new_pkg.version).blue(),
env_name.fancy_display()
);
}
StateChange::AddedEnvironment => {
eprintln!(
"{}Added environment {}.",
Expand Down
3 changes: 1 addition & 2 deletions src/global/project/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -678,8 +678,7 @@ impl Project {
})
.collect::<Result<IndexSet<MatchSpec>, miette::Report>>()?;

let env_dir =
EnvDir::from_path(self.env_root.clone().path().join(env_name.clone().as_str()));
let env_dir = EnvDir::from_path(self.env_root.path().join(env_name.as_str()));

let specs_in_sync =
environment_specs_in_sync(&env_dir, &specs, environment.platform).await?;
Expand Down
Loading