Skip to content
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

feat: new pixi global #1833

Draft
wants to merge 19 commits into
base: main
Choose a base branch
from
Draft

feat: new pixi global #1833

wants to merge 19 commits into from

Conversation

Hofer-Julian
Copy link
Contributor

@Hofer-Julian Hofer-Julian commented Aug 19, 2024

This adds functionality as described in https://pixi.sh/dev/design_proposals/pixi_global_manifest/

Test it locally by doing the following:

# Clone the repository
git clone https://github.com/prefix-dev/pixi.git

# Navigate into the repository
cd pixi

# Checkout a specific branch
git switch feature/pixi-global

# Install the Rust project with a custom binary name
cargo install --path . --locked

This adds functionality and tests to parse the `pixi-global.toml` as
described in the
[proposal](https://pixi.sh/dev/design_proposals/pixi_global_manifest/)
@Hofer-Julian Hofer-Julian changed the title feature: Pixi global manifest feat: Pixi global manifest Aug 19, 2024
@Hofer-Julian Hofer-Julian changed the title feat: Pixi global manifest feat: pixi global manifest Aug 19, 2024
@ruben-arts ruben-arts changed the title feat: pixi global manifest feat: new pixi global Aug 19, 2024
@ruben-arts ruben-arts added this to the New `pixi global` milestone Aug 20, 2024
@baszalmstra baszalmstra added the area:global Related to pixi global label Aug 20, 2024
@ruben-arts
Copy link
Contributor

Nitpick: I'm not a fan of the project directory as this has nothing to do with the "pixi projects". I would just move all the code into the src/global. And then you could move the manifest into its own module for instance.

Hofer-Julian and others added 10 commits September 2, 2024 09:11
Main features:
- minimal implementation of `pixi global sync`
- it creates environments if they are on the manifest but not on the
systsem
- it deletes environments if they are not in the manifest
- It adds binaries that are exposed in the manifest
- It removes binares that are not exposed in the manifest
- it doesn´t check yet whether environments already exist to avoid
double work
- it doesn´t import from existing environments on the system yet

Side features:
- Add `sort_channels_by_priority` function
- Heavily refactor structs in `common.rs`
- Add many tests

How to test:

Create `~/.pixi/manifests/pixi-global.toml` with:

```toml
# The name of the environment is `python`
[envs.python]
channels = ["conda-forge"]
# optional, defaults to your current OS
# platform = "osx-64"
# It will expose python, python3 and python3.11, but not pip
[envs.python.dependencies]
python = "3.11.*"
pip = "*"

[envs.python.exposed]
python = "python"
python3 = "python3"
"python3.11" = "python3.11"

# The name of the environment is `python3-10`
[envs.python3-10]
channels = ["https://fast.prefix.dev/conda-forge"]
# It will expose python3.10
[envs.python3-10.dependencies]
python = "3.10.*"

[envs.python3-10.exposed]
"python3.10" = "python"
```

---------

Co-authored-by: nichmor <nmorkotilo@gmail.com>
As soon as we implement it, this marker should throw an error
@ruben-arts ruben-arts linked an issue Sep 20, 2024 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:global Related to pixi global
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pixi global inject
4 participants