feat: add --dry-run flag to pixi lock command#5288
feat: add --dry-run flag to pixi lock command#5288ruben-arts merged 8 commits intoprefix-dev:mainfrom
Conversation
baszalmstra
left a comment
There was a problem hiding this comment.
Can you try to add a test that verifies that this indeed doesnt update the lock-file?
| match self { | ||
| LockFileUsage::Update | LockFileUsage::Locked => true, | ||
| LockFileUsage::Frozen => false, | ||
| LockFileUsage::DryRun => false, |
There was a problem hiding this comment.
You're absolutely right!
With DryRun => true, the dependency resolution happens and the diff is computed
| async fn test_lock_dry_run_doesnt_modify_lockfile() { | ||
| // Create a new pixi project | ||
| let pixi = PixiControl::new().unwrap(); | ||
| pixi.init().with_channel("conda-forge").await.unwrap(); |
There was a problem hiding this comment.
This makes the test reach out the the internet. You can use MockRepoData to setup a local channel, this both improves the performance, makes it more targeted, and less flaky.
|
Should we instead of calling it |
|
Case against my point |
baszalmstra
left a comment
There was a problem hiding this comment.
The code looks good but Ill ask @ruben-arts to check the UX.
ruben-arts
left a comment
There was a problem hiding this comment.
Thank you, ux wise it fits the rest of pixi, merging it in!
Description
This PR adds a
--dry-runflag to thepixi lockcommand, addressing issue # #5280 .How Has This Been Tested?
I verified the changes by building the binary from source and testing the flag's behavior in a local environment.
Checklist:
schema/model.py.