feat: allow users to use Pixi named workspaces through a registry#5277
feat: allow users to use Pixi named workspaces through a registry#5277ruben-arts merged 45 commits intoprefix-dev:mainfrom
Conversation
4cdee0b to
10d0a0f
Compare
|
Thanks @soapy1 ! This is very cool! I think your arguments are all very reasonable. Note that we choose the argument name to be I will let @ruben-arts take a closer look at the UX but he is currently on a skiing trip until the end of the week. I understood from your discord message that you want to redo the PR after the user-experience is more fine-tuned so I held off on reviewing the code itself. |
|
Awesome stuff! |
|
Hi @soapy1, thanks for your work! I would like to discuss a few parts. Arguments
|
I think
How about simply
I think that will be very confusing for people who do not want this flow. Which I still think will be the majority. What about: or |
I'm fine with that.
What about |
|
I think if we really want to offer users a similar CLI to conda, we should just add an extra subcommand e.g. So: The UI should then explain what just happened. |
10d0a0f to
8a728a6
Compare
|
Thanks @baszalmstra and @ruben-arts for the review on the UX! Following up on some of your notes:
Yep, I agree with your thoughts here.
A lot of notes on this point. I'm not quite sure the direction we landed on here? Say Another important feature of being able to have an association of names to environments is being able to list what the named environments are. For example, in conda we have
Good idea, added!
A few follow up questions about implementation for this approach:
Note, conda also has two different commands for creating environments that are slightly different from each other. This creates quite a bit of user confusion.
Good idea! I added
Aha! Yes, that would be something on my to-do list. You might have already noticed from thumbing through this PR but, I'm certainly out of my element writing Rust code. This is a helpful tip, thanks!
Aha! We get this for free in this pr. Try out This will create a new environment at
IMO it's handy to be able to have named environments. And the workflows suggested by conda are good. But, it would be nice for pixi to be able to support this functionality without requiring bringing along the exact conda way of doing things. Other things to do:
|
I quite like A potential alternative could be |
|
I think I'll not focus on the One idea @wolfv and I discussed is that instead of using a configuration file for the registry we could make use of the file system and place symlinks, or a file with a path on platforms that don't support symlinks, to point to workspaces. This way there still is a directory that can be inspected, which can also future prove the effort to add workspaces that don't have a user choosen location. |
0adf4b2 to
1376c6a
Compare
|
Circling back here, got a demo of the
oh, that's a compelling idea! I'm happy to put together a demo (+ notes) for this. I'm a bit slammed the rest of the week, but should be able to get to it pretty soon 💯. |
ee3662d to
15fc2ce
Compare
|
Ok so, circling back to this! I wrote a few different demos to explore options for how pixi ought to organize the registry. I would like to emphasize that I took a lot of shortcuts writing these demos. The goal was to be able to get a feel for what the limitations for each approach is. There are 3 demo implementations:
I wrote up some notes in this google doc if that is helpful. Going through that exercise, I think a nice solution might be to:
@ruben-arts what are your thoughts? |
d070d91 to
e0f5434
Compare
|
Hey @soapy1, amazing work on the R&D! Would you be open to discuss this in real time? I send you a message on Discord. |
6fe6c75 to
dac968d
Compare
8be4828 to
075bd07
Compare
This allows for adding a new type of `DiscoverStart` that uses the workspace registry to find the pixi manifest.
Co-authored-by: Ruben Arts <ruben.arts@pm.me>
4aa80fb to
69d05eb
Compare
69d05eb to
9713bf0
Compare
|
I'm super excited for this functionality to land! 🚀 Thanks @soapy1 for implementing this, and @ruben-arts for all the reviews to get it to this stage! ❤️ Just bumping this PR in the hope that it can make the next release 🙏 |
ruben-arts
left a comment
There was a problem hiding this comment.
Thank you @soapy1!
I'm going to merge it now, sorry for the huge delay, the PR got burried by other work.
You did a great job, nice working with you. I would love to see a followup PR to add more documentation e.g. in https://pixi.prefix.dev/latest/switching_from/conda/
But I'm not holding this PR back on it. Thanks @dhirschfeld for the ping!
|
Yay! Thanks for all your guidance here @ruben-arts and pixi team/community 🙌 I got a little follow up docs pr here #5720 |
Description
This implements a demo for the global registry of workspaces suggested in #4461.
Key changes
pixi workspace registercommandThis command looks like:
It allows users to make an association between a path on disk and a name that represents the environment at that location. Users my create a new registry entry by running the commands:
Registering a workspace with a name that is already registered will not not update the registry. Users can provide the
--forceflag to force this behaviour.Cleaning up the registry of workspaces
Currently, this suggests 2 ways of being able to clean up registered workspaces:
pixi clean (--workspaces-registry)pixi workspace register pruneThese commands will remove any name/path association where the path no longer exists.
Further, users may remove an association using the
pixi workspace removecommand.Argument name
The name of the argument to is
workspace, shortcut to-wthis is becausenameand-nare already used.Other notes
How Has This Been Tested?
Try out this demo:
Register an existing pixi project
Use a named workspace
Using a name workspace acts in the same way as using the
--manifest-pathargument.Use a named workspace with multiple environments
Consider a pixi.toml
Let's register the workspace and interact with the environments
Remove a workspace from the registry
Using a workspace that doesn't exist
AI Disclosure
Tools: {e.g., Claude, Codex, GitHub Copilot, ChatGPT, etc.}
Checklist:
schema/model.py.