Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
afe606e
wip: process of removing --no-lockfile-update
tdejager Aug 11, 2025
8e91c5c
fix: updated the strings
tdejager Aug 12, 2025
e75a14c
feat: make flags more sensible
tdejager Aug 12, 2025
782815e
lint
tdejager Aug 12, 2025
f34ca50
Merge branch 'main' into feat/remove-no-lock-file-update
tdejager Aug 14, 2025
f9dc266
fix: lint
tdejager Aug 14, 2025
ed76443
Merge branch 'main' into feat/remove-no-lock-file-update
tdejager Aug 14, 2025
3e0f830
feat: remove `--revalidate` everywhere
tdejager Aug 14, 2025
65e4bb8
fix: fmt
tdejager Aug 14, 2025
0c20f71
feat: remove --revalidation test
tdejager Aug 14, 2025
31addfb
feat: update test
tdejager Aug 14, 2025
0259cab
fix: fmt
tdejager Aug 14, 2025
879526d
fix: update cli docs
tdejager Aug 14, 2025
438dea7
Merge branch 'main' into feat/remove-no-lock-file-update
tdejager Aug 14, 2025
236f342
fmt
tdejager Aug 14, 2025
c95aedb
fix: compile errors
tdejager Aug 14, 2025
e9467f0
fix: update error message and improve docs
tdejager Aug 14, 2025
f468cae
feat: move to test folder and add missing tests
tdejager Aug 14, 2025
a34581e
feat: common
tdejager Aug 14, 2025
a1ba9ed
feat: remove unused flags from import
tdejager Aug 14, 2025
d3d8d4d
feat: warning to upgrade
tdejager Aug 14, 2025
d4ae702
Update src/cli/cli_config.rs
tdejager Aug 15, 2025
e9c76ff
fix: hide deprecated cli command
ruben-arts Aug 15, 2025
421d6dd
chore: version to 0.52.0 (#4347)
ruben-arts Aug 14, 2025
ad4e247
ci: turn off trampoline workflow on push (#4348)
lucascolley Aug 14, 2025
acc6050
feat: infer package name for source package with pixi global install …
Hofer-Julian Aug 14, 2025
dbbb6dc
feat: Add `pixi --list` to view all the commands (pixi-extensions + b…
mrswastik-robot Aug 15, 2025
a5d63f6
feat: Use log level info for build backends (#4354)
pavelzw Aug 15, 2025
9e63a1c
refactor: remove manual conflicts check for `--frozen` & `--locked` (…
tdejager Aug 15, 2025
390f001
fix: test
tdejager Aug 15, 2025
91e9156
Merge branch 'main' into feat/remove-no-lock-file-update
tdejager Aug 15, 2025
95f2776
feat: use fill revalidation for workspace stuff for now
tdejager Aug 15, 2025
26cae85
feat: change deprecated docs
tdejager Aug 15, 2025
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
12 changes: 5 additions & 7 deletions crates/pixi_core/src/environment/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -393,12 +393,9 @@ pub enum LockFileUsage {
}

impl LockFileUsage {
/// Returns true if the lock-file should be updated if it is out of date.
pub(crate) fn allows_lock_file_updates(self) -> bool {
match self {
LockFileUsage::Update => true,
LockFileUsage::Locked | LockFileUsage::Frozen => false,
}
/// Returns true if the process should error when the lock-file
pub(crate) fn allow_updates(self) -> bool {
!matches!(self, LockFileUsage::Locked)
}

/// Returns true if the lock-file should be checked if it is out of date.
Expand Down Expand Up @@ -479,7 +476,8 @@ pub async fn get_update_lock_file_and_prefixes<'env>(
no_install,
max_concurrent_solves: update_lock_file_options.max_concurrent_solves,
})
.await?;
.await?
.0;

// Get the prefix from the lock-file.
let lock_file_ref = &lock_file;
Expand Down
62 changes: 31 additions & 31 deletions crates/pixi_core/src/lock_file/update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ impl Workspace {
pub async fn update_lock_file(
&self,
options: UpdateLockFileOptions,
) -> miette::Result<LockFileDerivedData<'_>> {
) -> miette::Result<(LockFileDerivedData<'_>, bool)> {
let lock_file = self.load_lock_file().await?;
let glob_hash_cache = GlobHashCache::default();

Expand All @@ -97,18 +97,20 @@ impl Workspace {
if !options.lock_file_usage.should_check_if_out_of_date() {
tracing::info!("skipping check if lock-file is up-to-date");

return Ok(LockFileDerivedData {
workspace: self,
lock_file,
package_cache,
updated_conda_prefixes: Default::default(),
updated_pypi_prefixes: Default::default(),
uv_context: Default::default(),
io_concurrency_limit: IoConcurrencyLimit::default(),
command_dispatcher,
glob_hash_cache,
was_outdated: false,
});
return Ok((
LockFileDerivedData {
workspace: self,
lock_file,
package_cache,
updated_conda_prefixes: Default::default(),
updated_pypi_prefixes: Default::default(),
uv_context: Default::default(),
io_concurrency_limit: IoConcurrencyLimit::default(),
command_dispatcher,
glob_hash_cache,
},
false,
));
}

// Check which environments are out of date.
Expand All @@ -122,23 +124,25 @@ impl Workspace {
tracing::info!("the lock-file is up-to-date");

// If no-environment is outdated we can return early.
return Ok(LockFileDerivedData {
workspace: self,
lock_file,
package_cache,
updated_conda_prefixes: Default::default(),
updated_pypi_prefixes: Default::default(),
uv_context: Default::default(),
io_concurrency_limit: IoConcurrencyLimit::default(),
command_dispatcher,
glob_hash_cache,
was_outdated: false,
});
return Ok((
LockFileDerivedData {
workspace: self,
lock_file,
package_cache,
updated_conda_prefixes: Default::default(),
updated_pypi_prefixes: Default::default(),
uv_context: Default::default(),
io_concurrency_limit: IoConcurrencyLimit::default(),
command_dispatcher,
glob_hash_cache,
},
false,
));
}

// If the lock-file is out of date, but we're not allowed to update it, we
// should exit.
if !options.lock_file_usage.allows_lock_file_updates() {
if !options.lock_file_usage.allow_updates() {
miette::bail!("lock-file not up-to-date with the workspace");
}

Expand All @@ -158,7 +162,7 @@ impl Workspace {
// Write the lock-file to disk
lock_file_derived_data.write_to_disk()?;

Ok(lock_file_derived_data)
Ok((lock_file_derived_data, true))
}

/// Loads the lockfile for the workspace or returns `Lockfile::default` if
Expand Down Expand Up @@ -258,9 +262,6 @@ pub struct LockFileDerivedData<'p> {

/// An object that caches input hashes
pub glob_hash_cache: GlobHashCache,

/// Whether the lock file was outdated
pub was_outdated: bool,
}

/// The mode to use when updating a prefix.
Expand Down Expand Up @@ -1723,7 +1724,6 @@ impl<'p> UpdateContext<'p> {
io_concurrency_limit: self.io_concurrency_limit,
command_dispatcher: self.command_dispatcher,
glob_hash_cache: self.glob_hash_cache,
was_outdated: true,
})
}
}
Expand Down
14 changes: 4 additions & 10 deletions crates/pixi_core/src/workspace/workspace_mut.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ impl WorkspaceMut {
match_specs: MatchSpecs,
pypi_deps: PypiDeps,
source_specs: SourceSpecs,
install_no_updates: bool,
no_install: bool,
lock_file_update_config: &LockFileUsage,
feature_name: &FeatureName,
platforms: &[Platform],
Expand Down Expand Up @@ -359,13 +359,9 @@ impl WorkspaceMut {
command_dispatcher,
glob_hash_cache,
io_concurrency_limit,
was_outdated: _,
} = UpdateContext::builder(self.workspace())
.with_lock_file(unlocked_lock_file)
.with_no_install(
(install_no_updates && !lock_file_update_config.allows_lock_file_updates())
|| dry_run,
)
.with_no_install(no_install || dry_run)
.finish()
.await?
.update()
Expand Down Expand Up @@ -412,13 +408,11 @@ impl WorkspaceMut {
io_concurrency_limit,
command_dispatcher,
glob_hash_cache,
was_outdated: true,
};
if lock_file_update_config.allows_lock_file_updates() && !dry_run {
if !dry_run {
updated_lock_file.write_to_disk()?;
}
if !install_no_updates
&& lock_file_update_config.allows_lock_file_updates()
if !no_install
&& !dry_run
&& self.workspace().environments().len() == 1
&& default_environment_is_affected
Expand Down
4 changes: 0 additions & 4 deletions docs/reference/cli/pixi/add.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,6 @@ pixi add [OPTIONS] <SPEC>...
## Update Options
- <a id="arg---no-install" href="#arg---no-install">`--no-install`</a>
: Don't modify the environment, only modify the lock-file
- <a id="arg---revalidate" href="#arg---revalidate">`--revalidate`</a>
: Run the complete environment validation. This will reinstall a broken environment
- <a id="arg---no-lockfile-update" href="#arg---no-lockfile-update">`--no-lockfile-update`</a>
: Don't update lockfile, implies the no-install as well
- <a id="arg---frozen" href="#arg---frozen">`--frozen`</a>
: Install the environment as defined in the lockfile, doesn't update lockfile if it isn't up-to-date with the manifest file
<br>**env**: `PIXI_FROZEN`
Expand Down
14 changes: 0 additions & 14 deletions docs/reference/cli/pixi/import.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,20 +48,6 @@ pixi import [OPTIONS] <FILE>
- <a id="arg---use-environment-activation-cache" href="#arg---use-environment-activation-cache">`--use-environment-activation-cache`</a>
: Use environment activation cache (experimental)

## Update Options
- <a id="arg---no-install" href="#arg---no-install">`--no-install`</a>
: Don't modify the environment, only modify the lock-file
- <a id="arg---revalidate" href="#arg---revalidate">`--revalidate`</a>
: Run the complete environment validation. This will reinstall a broken environment
- <a id="arg---no-lockfile-update" href="#arg---no-lockfile-update">`--no-lockfile-update`</a>
: Don't update lockfile, implies the no-install as well
- <a id="arg---frozen" href="#arg---frozen">`--frozen`</a>
: Install the environment as defined in the lockfile, doesn't update lockfile if it isn't up-to-date with the manifest file
<br>**env**: `PIXI_FROZEN`
- <a id="arg---locked" href="#arg---locked">`--locked`</a>
: Check if lockfile is up-to-date before installing the environment, aborts when lockfile isn't up-to-date with the manifest file
<br>**env**: `PIXI_LOCKED`

## Global Options
- <a id="arg---manifest-path" href="#arg---manifest-path">`--manifest-path <MANIFEST_PATH>`</a>
: The path to `pixi.toml`, `pyproject.toml`, or the workspace directory
Expand Down
4 changes: 2 additions & 2 deletions docs/reference/cli/pixi/list.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ pixi list [OPTIONS] [REGEX]
: Only list packages that are explicitly defined in the workspace

## Update Options
- <a id="arg---no-lockfile-update" href="#arg---no-lockfile-update">`--no-lockfile-update`</a>
: Don't update lockfile, implies the no-install as well
- <a id="arg---frozen" href="#arg---frozen">`--frozen`</a>
: Install the environment as defined in the lockfile, doesn't update lockfile if it isn't up-to-date with the manifest file
<br>**env**: `PIXI_FROZEN`
- <a id="arg---locked" href="#arg---locked">`--locked`</a>
: Check if lockfile is up-to-date before installing the environment, aborts when lockfile isn't up-to-date with the manifest file
<br>**env**: `PIXI_LOCKED`
- <a id="arg---no-install" href="#arg---no-install">`--no-install`</a>
: Don't modify the environment, only modify the lock-file

## Global Options
- <a id="arg---manifest-path" href="#arg---manifest-path">`--manifest-path <MANIFEST_PATH>`</a>
Expand Down
4 changes: 4 additions & 0 deletions docs/reference/cli/pixi/lock.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ pixi lock [OPTIONS]
- <a id="arg---check" href="#arg---check">`--check`</a>
: Check if any changes have been made to the lock file. If yes, exit with a non-zero code

## Update Options
- <a id="arg---no-install" href="#arg---no-install">`--no-install`</a>
: Don't modify the environment, only modify the lock-file

## Global Options
- <a id="arg---manifest-path" href="#arg---manifest-path">`--manifest-path <MANIFEST_PATH>`</a>
: The path to `pixi.toml`, `pyproject.toml`, or the workspace directory
Expand Down
4 changes: 0 additions & 4 deletions docs/reference/cli/pixi/remove.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,6 @@ pixi remove [OPTIONS] <SPEC>...
## Update Options
- <a id="arg---no-install" href="#arg---no-install">`--no-install`</a>
: Don't modify the environment, only modify the lock-file
- <a id="arg---revalidate" href="#arg---revalidate">`--revalidate`</a>
: Run the complete environment validation. This will reinstall a broken environment
- <a id="arg---no-lockfile-update" href="#arg---no-lockfile-update">`--no-lockfile-update`</a>
: Don't update lockfile, implies the no-install as well
- <a id="arg---frozen" href="#arg---frozen">`--frozen`</a>
: Install the environment as defined in the lockfile, doesn't update lockfile if it isn't up-to-date with the manifest file
<br>**env**: `PIXI_FROZEN`
Expand Down
4 changes: 0 additions & 4 deletions docs/reference/cli/pixi/run.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,6 @@ pixi run [OPTIONS] [TASK]...
## Update Options
- <a id="arg---no-install" href="#arg---no-install">`--no-install`</a>
: Don't modify the environment, only modify the lock-file
- <a id="arg---revalidate" href="#arg---revalidate">`--revalidate`</a>
: Run the complete environment validation. This will reinstall a broken environment
- <a id="arg---no-lockfile-update" href="#arg---no-lockfile-update">`--no-lockfile-update`</a>
: Don't update lockfile, implies the no-install as well
- <a id="arg---frozen" href="#arg---frozen">`--frozen`</a>
: Install the environment as defined in the lockfile, doesn't update lockfile if it isn't up-to-date with the manifest file
<br>**env**: `PIXI_FROZEN`
Expand Down
4 changes: 0 additions & 4 deletions docs/reference/cli/pixi/shell-hook.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,6 @@ pixi shell-hook [OPTIONS]
## Update Options
- <a id="arg---no-install" href="#arg---no-install">`--no-install`</a>
: Don't modify the environment, only modify the lock-file
- <a id="arg---revalidate" href="#arg---revalidate">`--revalidate`</a>
: Run the complete environment validation. This will reinstall a broken environment
- <a id="arg---no-lockfile-update" href="#arg---no-lockfile-update">`--no-lockfile-update`</a>
: Don't update lockfile, implies the no-install as well
- <a id="arg---frozen" href="#arg---frozen">`--frozen`</a>
: Install the environment as defined in the lockfile, doesn't update lockfile if it isn't up-to-date with the manifest file
<br>**env**: `PIXI_FROZEN`
Expand Down
4 changes: 0 additions & 4 deletions docs/reference/cli/pixi/shell.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,6 @@ pixi shell [OPTIONS]
## Update Options
- <a id="arg---no-install" href="#arg---no-install">`--no-install`</a>
: Don't modify the environment, only modify the lock-file
- <a id="arg---revalidate" href="#arg---revalidate">`--revalidate`</a>
: Run the complete environment validation. This will reinstall a broken environment
- <a id="arg---no-lockfile-update" href="#arg---no-lockfile-update">`--no-lockfile-update`</a>
: Don't update lockfile, implies the no-install as well
- <a id="arg---frozen" href="#arg---frozen">`--frozen`</a>
: Install the environment as defined in the lockfile, doesn't update lockfile if it isn't up-to-date with the manifest file
<br>**env**: `PIXI_FROZEN`
Expand Down
4 changes: 2 additions & 2 deletions docs/reference/cli/pixi/tree.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ pixi tree [OPTIONS] [REGEX]
: Invert tree and show what depends on given package in the regex argument

## Update Options
- <a id="arg---no-lockfile-update" href="#arg---no-lockfile-update">`--no-lockfile-update`</a>
: Don't update lockfile, implies the no-install as well
- <a id="arg---frozen" href="#arg---frozen">`--frozen`</a>
: Install the environment as defined in the lockfile, doesn't update lockfile if it isn't up-to-date with the manifest file
<br>**env**: `PIXI_FROZEN`
- <a id="arg---locked" href="#arg---locked">`--locked`</a>
: Check if lockfile is up-to-date before installing the environment, aborts when lockfile isn't up-to-date with the manifest file
<br>**env**: `PIXI_LOCKED`
- <a id="arg---no-install" href="#arg---no-install">`--no-install`</a>
: Don't modify the environment, only modify the lock-file

## Global Options
- <a id="arg---manifest-path" href="#arg---manifest-path">`--manifest-path <MANIFEST_PATH>`</a>
Expand Down
4 changes: 0 additions & 4 deletions docs/reference/cli/pixi/upgrade.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,6 @@ pixi upgrade [OPTIONS] [PACKAGES]...
## Update Options
- <a id="arg---no-install" href="#arg---no-install">`--no-install`</a>
: Don't modify the environment, only modify the lock-file
- <a id="arg---revalidate" href="#arg---revalidate">`--revalidate`</a>
: Run the complete environment validation. This will reinstall a broken environment
- <a id="arg---no-lockfile-update" href="#arg---no-lockfile-update">`--no-lockfile-update`</a>
: Don't update lockfile, implies the no-install as well
- <a id="arg---frozen" href="#arg---frozen">`--frozen`</a>
: Install the environment as defined in the lockfile, doesn't update lockfile if it isn't up-to-date with the manifest file
<br>**env**: `PIXI_FROZEN`
Expand Down
4 changes: 0 additions & 4 deletions docs/reference/cli/pixi/workspace/channel/add.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,6 @@ pixi workspace channel add [OPTIONS] <CHANNEL>...
## Update Options
- <a id="arg---no-install" href="#arg---no-install">`--no-install`</a>
: Don't modify the environment, only modify the lock-file
- <a id="arg---revalidate" href="#arg---revalidate">`--revalidate`</a>
: Run the complete environment validation. This will reinstall a broken environment
- <a id="arg---no-lockfile-update" href="#arg---no-lockfile-update">`--no-lockfile-update`</a>
: Don't update lockfile, implies the no-install as well
- <a id="arg---frozen" href="#arg---frozen">`--frozen`</a>
: Install the environment as defined in the lockfile, doesn't update lockfile if it isn't up-to-date with the manifest file
<br>**env**: `PIXI_FROZEN`
Expand Down
4 changes: 0 additions & 4 deletions docs/reference/cli/pixi/workspace/channel/remove.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,6 @@ pixi workspace channel remove [OPTIONS] <CHANNEL>...
## Update Options
- <a id="arg---no-install" href="#arg---no-install">`--no-install`</a>
: Don't modify the environment, only modify the lock-file
- <a id="arg---revalidate" href="#arg---revalidate">`--revalidate`</a>
: Run the complete environment validation. This will reinstall a broken environment
- <a id="arg---no-lockfile-update" href="#arg---no-lockfile-update">`--no-lockfile-update`</a>
: Don't update lockfile, implies the no-install as well
- <a id="arg---frozen" href="#arg---frozen">`--frozen`</a>
: Install the environment as defined in the lockfile, doesn't update lockfile if it isn't up-to-date with the manifest file
<br>**env**: `PIXI_FROZEN`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@ pixi workspace export conda-explicit-spec [OPTIONS] <OUTPUT_DIR>
: Use environment activation cache (experimental)

## Update Options
- <a id="arg---no-lockfile-update" href="#arg---no-lockfile-update">`--no-lockfile-update`</a>
: Don't update lockfile, implies the no-install as well
- <a id="arg---frozen" href="#arg---frozen">`--frozen`</a>
: Install the environment as defined in the lockfile, doesn't update lockfile if it isn't up-to-date with the manifest file
<br>**env**: `PIXI_FROZEN`
- <a id="arg---locked" href="#arg---locked">`--locked`</a>
: Check if lockfile is up-to-date before installing the environment, aborts when lockfile isn't up-to-date with the manifest file
<br>**env**: `PIXI_LOCKED`
- <a id="arg---no-install" href="#arg---no-install">`--no-install`</a>
: Don't modify the environment, only modify the lock-file

## Global Options
- <a id="arg---manifest-path" href="#arg---manifest-path">`--manifest-path <MANIFEST_PATH>`</a>
Expand Down
2 changes: 1 addition & 1 deletion docs/workspace/environment.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ This file contains the following information:
The `environment_lock_file_hash` is used to check if the environment is in sync with the `pixi.lock` file.
If the hash of the `pixi.lock` file is different from the hash in the `pixi` file, Pixi will update the environment.

This is used to speedup activation, in order to trigger a full revalidation pass `--revalidate` to the `pixi run` or `pixi shell` command.
This is used to speedup activation, in order to trigger a full revalidation and installation use `pixi install` or `pixi reinstall`.
A broken environment would typically not be found with a hash comparison, but a revalidation would reinstall the environment.
By default, all lock file modifying commands will always use the revalidation and on `pixi install` it always revalidates.

Expand Down
12 changes: 6 additions & 6 deletions src/cli/add.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use pixi_spec::{GitSpec, SourceLocationSpec, SourceSpec};
use rattler_conda_types::{MatchSpec, PackageName};

use crate::cli::{
cli_config::{DependencyConfig, LockFileUpdateConfig, PrefixUpdateConfig, WorkspaceConfig},
cli_config::{DependencyConfig, LockFileUpdateConfig, NoInstallConfig, WorkspaceConfig},
has_specs::HasSpecs,
};

Expand Down Expand Up @@ -81,7 +81,7 @@ pub struct Args {
pub dependency_config: DependencyConfig,

#[clap(flatten)]
pub prefix_update_config: PrefixUpdateConfig,
pub no_install_config: NoInstallConfig,

#[clap(flatten)]
pub lock_file_update_config: LockFileUpdateConfig,
Expand All @@ -95,9 +95,9 @@ pub struct Args {
}

pub async fn execute(args: Args) -> miette::Result<()> {
let (dependency_config, prefix_update_config, lock_file_update_config, workspace_config) = (
let (dependency_config, no_install_config, lock_file_update_config, workspace_config) = (
args.dependency_config,
args.prefix_update_config,
args.no_install_config,
args.lock_file_update_config,
args.workspace_config,
);
Expand Down Expand Up @@ -197,8 +197,8 @@ pub async fn execute(args: Args) -> miette::Result<()> {
match_specs,
pypi_deps,
source_specs,
prefix_update_config.no_install,
&lock_file_update_config.lock_file_usage(),
no_install_config.no_install,
&lock_file_update_config.lock_file_usage()?,
&dependency_config.feature,
&dependency_config.platforms,
args.editable,
Expand Down
Loading
Loading