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

feat: pixi diff #2340

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

feat: pixi diff #2340

wants to merge 2 commits into from

Conversation

benmoss
Copy link

@benmoss benmoss commented Oct 23, 2024

I love @pavelzw 's https://github.com/pavelzw/pixi-diff-to-markdown/ tool but the problem is that you can only get these diffs from pixi update --json right now.

This is a POC to introduce a new pixi diff command that will diff the current pixi.toml & pixi.lock to a different pixi.lock to generate the same diff.

@benmoss
Copy link
Author

benmoss commented Oct 23, 2024

Example:

pixi diff --old-lockfile <(git show HEAD~100:pixi.lock) | pixi-diff-to-markdown

Explicit dependencies

Dependency1 Before After Change Environments
filelock 3.16.0 Added {default, schema} on all platforms
pytest-rerunfailures 14.0 Added {default, schema} on all platforms
rich 13.7.1 Added {default, schema} on all platforms
tomli-w 1.0.0 Added {default, schema} on all platforms
rust 1.80.1 1.81.0 Minor Upgrade default on all platforms
taplo h823019e_0 ha073cba_1 Only build string lint on win-64

Implicit dependencies

Dependency1 Before After Change Environments
markdown-it-py 3.0.0 Added {default, schema} on all platforms
mdurl 0.1.2 Added {default, schema} on all platforms
pygments 2.18.0 Added {default, schema} on all platforms
filelock 3.15.4 3.16.0 Minor Upgrade lint on all platforms
rust-std-aarch64-apple-darwin 1.80.1 1.81.0 Minor Upgrade default on osx-arm64
rust-std-x86_64-apple-darwin 1.80.1 1.81.0 Minor Upgrade default on osx-64
rust-std-x86_64-pc-windows-msvc 1.80.1 1.81.0 Minor Upgrade default on win-64
rust-std-x86_64-unknown-linux-gnu 1.80.1 1.81.0 Minor Upgrade default on linux-64

Footnotes

  1. Bold means explicit dependency. 2

Example:

```
pixi diff --old-lockfile <(git show HEAD~100:pixi.lock)
```
@benmoss benmoss changed the title POC: pixi diff feat: pixi diff Oct 23, 2024
@benmoss benmoss marked this pull request as draft October 23, 2024 00:07
@ruben-arts
Copy link
Contributor

Hey @benmoss, Thanks for the idea. I would like to discuss the cli command a little more. Especially the location. I believe there are more requests around some interaction with the lockfile. There is also the request for a pixi lock maybe diff could be a subcommand of that. or do you see a different future for this command? e.g. pixi diff --old-manifest etc.

@pavelzw
Copy link
Contributor

pavelzw commented Oct 25, 2024

There is also the request for a pixi lock

what should pixi lock do?

As mentioned in https://discord.com/channels/1082332781146800168/1298438329788010556/1298935042680029226, i think we are all on the same page that we should split this into a separate executable pixi-diff that you could call using pixi exec pixi-diff

@ruben-arts
Copy link
Contributor

what should pixi lock do?

My braindump
We could introduce some more introspection to that command but also the actual ability to lock on request. Where you would now need to do a pixi list --no-install or some other hacks.

  • pixi lock generates the lock-file and only installs the minimal requirements for that. e.g. the conda environment to solve pypi.
  • pixi lock diff would do what this pr does
  • pixi lock --platform linux-64 would lock only a single platform, which I would find useful when I'm testing some complex setups. And would allow me to test in CLI which platforms would work with this project without modifying the manifest.
  • pixi lock --environment cuda12.1 test locking for a single env, same as platform.
  • pixi lock export could be a way to do the pixi project export but a little more clearly that the lock is being exported and not the "project".

I don't think it's going to deliver a lot more features but just a more ergonomic interaction.

What do you think?

ps. this is not the right location to discuss but putting it here as there isn't a issue or discussion yet and not sure it's going to be useful yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants