Skip to content

Commit

Permalink
fix(pixi.lock): reverted changes
Browse files Browse the repository at this point in the history
fix(install.rs): add missing semicolon for proper syntax

refactor(upgrade.rs): remove no_activation flag to simplify upgrade function signature and reduce complexity

refactor(upgrade_all.rs): remove no_activation flag to align with upgrade function signature

test(test_main_cli.py): remove tests for no_activation flag to reflect removal of the flag in upgrade commands
  • Loading branch information
183amir committed Sep 20, 2024
1 parent d3774ab commit 0caacac
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 55 deletions.
32 changes: 16 additions & 16 deletions pixi.lock

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

2 changes: 1 addition & 1 deletion src/cli/global/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ pub(super) async fn create_executable_scripts(
}
} else {
activation_script.clone()
}
};

shell
.run_command(
Expand Down
16 changes: 2 additions & 14 deletions src/cli/global/upgrade.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@ pub struct Args {
/// The platform to install the package for.
#[clap(long, default_value_t = Platform::current())]
platform: Platform,

/// Do not insert conda_prefix, path modifications, and activation script into the installed executable script.
#[clap(long)]
no_activation: bool,
}

impl HasSpecs for Args {
Expand All @@ -45,22 +41,14 @@ impl HasSpecs for Args {
pub async fn execute(args: Args) -> miette::Result<()> {
let config = Config::load_global();
let specs = args.specs()?;
upgrade_packages(
specs,
config,
args.channels,
args.platform,
args.no_activation,
)
.await
upgrade_packages(specs, config, args.channels, args.platform).await
}

pub(super) async fn upgrade_packages(
specs: IndexMap<PackageName, MatchSpec>,
config: Config,
cli_channels: ChannelsConfig,
platform: Platform,
no_activation: bool,
) -> miette::Result<()> {
let channel_cli = cli_channels.resolve_from_config(&config);

Expand Down Expand Up @@ -212,7 +200,7 @@ pub(super) async fn upgrade_packages(
records,
authenticated_client.clone(),
platform,
no_activation,
false,
)
.await?;
pb.finish_with_message(format!("{} {}", console::style("Updated").green(), message));
Expand Down
13 changes: 1 addition & 12 deletions src/cli/global/upgrade_all.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ pub struct Args {
/// The platform to install the package for.
#[clap(long, default_value_t = Platform::current())]
platform: Platform,

/// Do not insert conda_prefix, path modifications, and activation script into the installed executable script.
#[clap(long)]
no_activation: bool,
}

pub async fn execute(args: Args) -> miette::Result<()> {
Expand All @@ -42,12 +38,5 @@ pub async fn execute(args: Args) -> miette::Result<()> {
);
}

upgrade_packages(
specs,
config,
args.channels,
args.platform,
args.no_activation,
)
.await
upgrade_packages(specs, config, args.channels, args.platform).await
}
12 changes: 0 additions & 12 deletions tests/integration/test_main_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,21 +195,9 @@ def test_global_install(pixi: Path) -> None:
# Upgrade
verify_cli_command([pixi, "global", "upgrade", "rattler-build"], ExitCode.SUCCESS)

# Upgrade with --no-activation
verify_cli_command(
[pixi, "global", "upgrade", "rattler-build", "--no-activation"],
ExitCode.SUCCESS,
)

# Upgrade all
verify_cli_command([pixi, "global", "upgrade-all"], ExitCode.SUCCESS)

# Upgrade all with --no-activation
verify_cli_command(
[pixi, "global", "upgrade-all", "--no-activation"],
ExitCode.SUCCESS,
)

# List
verify_cli_command([pixi, "global", "list"], ExitCode.SUCCESS, stderr_contains="rattler-build")

Expand Down

0 comments on commit 0caacac

Please sign in to comment.