pixi icon indicating copy to clipboard operation
pixi copied to clipboard

Design discussion: `pixi global` manifest and CLI changes

Open Hofer-Julian opened this issue 1 year ago • 0 comments

Typical usage

This is a starting point for the pixi global manifest and how the CLI has to change.

pixi global install python=3.11.*

Will create a new manifest at some global location, create a new environment with the implied name python and expose all binaries of the python package.

[[envs]]
name = "python"

[envs.dependencies.python]
spec = "3.11.*"
expose_binaries = "auto" # This will expose python, python3 and python3.11

Injecting dependencies

pixi global install pip --name=python

Will inject pip into the existing environment, named python. Binaries will not be exposed by default when installing into an existing environment.

[[envs]]
name = "python"

[envs.dependencies.python]
spec = "3.11.*"
expose_binaries = "auto" # This will expose python, python3 and python3.11

[envs.dependencies.pip]
spec = "*"

Specify which binaries to expose

pixi global install python=3.10.* --name=python_3_10 --expose-binary="python3.10=python"

Will create another environment of name python_3_10, add dependency python and expose python with name python3.10.

[[envs]]
name = "python"

[envs.dependencies.python]
spec = "3.11.*"
expose_binaries = "auto" # This will expose python, python3 and python3.11

[envs.dependencies.pip]
spec = "*"

[[envs]]
name = "python_3_10"

[envs.dependencies.python]
spec = "3.10.*"
expose_binaries = {"python3.10"="python"}

Discussion points:

How to change exposed binaries from the CLI?

Proposal: Let pixi global set instead of add exposed_binaries

[[envs]]
name = "python_3_10"

[envs.dependencies.python]
spec = "3.10.*"
expose_binaries = {"python3.10"="python"}

Running this

pixi global install python=3.10.* --name=python_3_10 --expose-binary="python_old=python"

would lead to

[[envs]]
name = "python_3_10"

[envs.dependencies.python]
spec = "3.10.*"
expose_binaries = {"python_old"="python"}

Multiple exposed binaries could be set like this:

pixi global install python=3.10.* --name=python_3_10 \
    --expose-binary="python3.10=python" --expose-binary="python_old=python"

How to deal with existing packages?

Proposal: If there's no manifest present, every pixi global commands offers to create a new manifest filled with the information of the existing environments

Which API should we add to update packages?

Hofer-Julian avatar Aug 06 '24 13:08 Hofer-Julian