Skip to content

Commit

Permalink
docs: extend pixi global proposal (#1861)
Browse files Browse the repository at this point in the history
- Add channels
- Add platform
- Override global manifest path via config key rather than env var
- Add `pixi global-all` command
- Add channel and platform commands
  • Loading branch information
Hofer-Julian authored Aug 21, 2024
1 parent 5e9d294 commit 6e400fe
Showing 1 changed file with 36 additions and 8 deletions.
44 changes: 36 additions & 8 deletions docs/design_proposals/pixi_global_manifest.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ Among other things it will be written in the TOML format, be named `pixi-global.
The motivation for the location is discussed [further below](#multiple-manifests)

```toml title="pixi-global.toml"
[envs.python]
channels = ["https://fast.prefix.dev/conda-forge"] # optional, defaults to global config, which defaults to "conda-forge"
platform = "osx-64" # optional, defaults to your current OS
# The name of the environment is `python`
# It will expose python, python3 and python3.11, but not pip
[envs.python.dependencies]
Expand Down Expand Up @@ -61,21 +64,31 @@ If the environment already exists, the command will return with an error.
The syntax for `MAPPING` is `exposed_name=binary_name`, so for example `python3.10=python`.

```
pixi global install [--expose MAPPING] [--environment ENV] <PACKAGE>...
pixi global install [--expose MAPPING] [--environment ENV] [--platform PLATFORM] [--channel CHANNEL] <PACKAGE>...
```

Remove environments `ENV`.
```
pixi global uninstall <ENV>...
```

Update `PACKAGE` if `--package` is given. If not, all packages in environments `ENV` will be updated.
Update `PACKAGE_NAME` if `--package` is given. If not, all packages in environments `ENV` will be updated.
If the update leads to binaries being removed, it will offer to remove the mappings.
If the user declines the update process will stop.
If the update leads to binaries being added, it will offer for each binary individually to expose it.
`--assume-yes` will assume yes as answer for every question that would otherwise be asked interactively.
```
pixi global update [--package PACKAGE] [--assume-yes] <ENV>...
pixi global update [--package PACKAGE_NAME] [--assume-yes] <ENV>...
```

Updates all packages in all environments.
If the update leads to binaries being removed, it will offer to remove the mappings.
If the user declines the update process will stop.
If the update leads to binaries being added, it will offer for each binary individually to expose it.
`--assume-yes` will assume yes as answer for every question that would otherwise be asked interactively.

```
pixi global update-all [--assume-yes]
```

Add one or more packages `PACKAGE` into an existing environment `ENV`.
Expand All @@ -88,12 +101,12 @@ The syntax for `MAPPING` is `exposed_name=binary_name`, so for example `python3.
pixi global add --environment ENV [--expose MAPPING] <PACKAGE>...
```

Remove package `PACKAGE` from environment `ENV`.
Remove package `PACKAGE_NAME` from environment `ENV`.
If that was the last package remove the whole environment and print that information in the console.
If this leads to binaries being removed, it will offer to remove the mappings.
If the user declines the remove process will stop.
```
pixi global remove --environment ENV PACKAGE
pixi global remove --environment ENV PACKAGE_NAME
```

Add one or more `MAPPING` for environment `ENV` which describe which binaries are exposed.
Expand Down Expand Up @@ -121,6 +134,16 @@ List all environments, their specs and exposed binaries
pixi global list
```

Set the channels `CHANNEL` for a certain environment `ENV` in the pixi global manifest.
```
pixi global channel set --environment ENV <CHANNEL>...
```

Set the platform `PLATFORM` for a certain environment `ENV` in the pixi global manifest.
```
pixi global platform set --environment ENV PLATFORM
```


### Simple workflow

Expand Down Expand Up @@ -247,6 +270,7 @@ We still have to figure out which existing programs do something similar and how
### Multiple manifests

We could go for one default manifest, but also parse other manifests in the same directory.
The only requirement to be parsed as manifest is a `.toml` extension
In order to modify those with the `CLI` one would have to add an option `--manifest` to select the correct one.

- pixi-global.toml: Default
Expand All @@ -257,7 +281,11 @@ It is unclear whether the first implementation already needs to support this.
At the very least we should put the manifest into its own folder like `~/.pixi/global/manifests/pixi-global.toml`


### Discovery via environment variable
### Discovery via config key

In order to make it easier to manage manifests in version control, we could allow to set the manifest path via a key in the [pixi configuration](https://pixi.sh/dev/reference/pixi_configuration/).

In order to make it easier to manage manifests in version control, we could allow to set the manifest path via a environment variable.
That environment variable could be called `PIXI_GLOBAL_MANIFESTS`.

``` title="config.toml"
global_manifests = "/path/to/your/manifests"
```

0 comments on commit 6e400fe

Please sign in to comment.