-
Notifications
You must be signed in to change notification settings - Fork 421
feat: (demo) allow users to use Pixi named workspaces through a registry #5277
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
base: main
Are you sure you want to change the base?
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. |
This argument represents the name of a workspace that has been registered to a global registry of workspaces. It is mutually exclusive with the manifest_path argument.
…registering a workspace
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
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:
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.Creating new named workspaces
Users may create a new workspace that is automatically registered in the workspace registry by using the
--workspace/-wargument in thepixi initcommand. For exampleThe original proposal suggests
Instead of creating new named workspaces in a central location, this demo suggests that when a new workspace is created with the
--nameargument, pixi should:Then, users can further customize the install location of their environment using the
detached-environmnetconfiguration parameter.Further investigation
It would be helpful to include a demo using:
Argument name
In this demo, the name of the argument to is
workspace, shortcut to-wthis is becausenameand-nare already used.Other notes
Demo for #4461
If this is a direction that your team is interested in, I would be very excited to clean this demo up and write up some testing.
How Has This Been Tested?
Try out this demo:
Register an existing pixi project
Create a new named+registered environment
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
AI Disclosure
Tools: {e.g., Claude, Codex, GitHub Copilot, ChatGPT, etc.}
Checklist:
schema/model.py.