-
Notifications
You must be signed in to change notification settings - Fork 463
Description
Problem description
Pixi always works in a directory of a workspace, you can avoid that logic by defining it's --manifest-path however this still forces the users to take care of the location of that workspace.
conda users have shared the need for the manual creation of an environment and be able to activate it from anywhere on demand.
For example, conda users just want to create an environment and reuse it in multiple directories.
> conda create -n env python numpy scipy
> cd dir
> conda activate env
(env) > python main.pyThis is not as easy with pixi as you first need to init a workspace and then manage that location yourself.
Initially we thought about recreating the full conda workflow using pixi's solve capabilities, but that would mean we had to maintain a complete extra set of commands and management workflow.
Proposal
Next to --manifest-path have --name to specify the workspace you want to work with.
Creating new named workspaces
Create $PIXI_HOME/workspaces/workspace and adds it to the named-workspaces
And adds the packages to the workspace and installs them.
Similar to conda create -n env mamba create -n workspace
pixi init --name env python numpy rattler-build
Adding packages to a named workspace
Adds python to the workspace in $PIXI_HOME/workspaces/env
Similar to conda install -n env python
pixi add --name env python
Register existing workspaces
Adds env to $PIXI_HOME/config.toml named-workspaces = { env = "/path/to/env" }
pixi workspace register env
Using named workspaces
Run a task in the env workspace
pixi run -n env task
Activate a shell in the env workspace
pixi shell -n env
Using activated named workspaces
After activating a shell in the workspace, that workspace is the one used by pixi.
> pixi shell --name env
(env) > pixi run task
The task is run in the env workspace
This solves:
Access your favorite environment from anywhere on your machine, pixi will keep the model of which name links to which workspace.
This would allow for a similar workflow experience to conda in pixi while keeping all the cool features pixi offers like pypi-dependencies and conda source dependencies with pixi build.
Questions:
- Does this give you everything that makes it hard to switch from conda to Pixi?
- Should we create a
pixi createcommand or modify thepixi initcommand?
Related
Related to #4457 as it would allow you to immediately get the best binaries for your platform regardless of the default system-requirements we define for normal workspaces.