-
Notifications
You must be signed in to change notification settings - Fork 177
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
feat: new pixi global
#1833
Conversation
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/)
Nitpick: I'm not a fan of the |
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
Co-authored-by: Bas Zalmstra <bas@prefix.dev> Co-authored-by: Bas Zalmstra <zalmstra.bas@gmail.com>
It now informs you if `pixi global sync` did nothing
Some missing things: - [x] : public doc strings - [x] : tests - [x] : better errors - [x] : running pixi global sync at the end it is also should be merged after #1975 lands first --------- Co-authored-by: Hofer-Julian <30049909+Hofer-Julian@users.noreply.github.com> Co-authored-by: Julian Hofer <julianhofer@gnome.org>
Cleaning up the creation of the manifest from existing environments. Improving error.
And one last little one: I tried to figure out what version of rattler-build I had installed, but I think |
@wolfv |
Users will get an error message when they attempt to use `pixi global upgrade` or `pixi global upgrade-all` --------- Co-authored-by: Ruben Arts <ruben@prefix.dev>
Packages having underscore in their name get ignored $ pixi g list
Global install location: C:\[redacted]\
├── conda-smithy 3.41.1
| └─ exec: feedstocks.bat, conda-smithy.bat
├── huggingface_hub 0.25.1
| └─ exec: huggingface-cli.bat
├── rattler-build 0.23.0
| └─ exec: rattler-build.bat, generate-cli-docs.bat
└── uv 0.4.17
└─ exec: uvx.bat, uv.bat
$ pixi-next g list
WARN Failed to parse environment name 'huggingface_hub', please use only lowercase letters, numbers and dashes
Global environments as specified in 'C:\[redacted]\manifests\pixi-global.toml'
├── conda-smithy: 3.41.1
│ └─ exposes: feedstocks, conda-smithy
├── rattler-build: 0.23.0
│ └─ exposes: generate-cli-docs, rattler-build
└── uv: 0.4.17
└─ exposes: uvx, uv |
Oh nice find @chawyehsu! |
Normalize input in `EnvironmentName::from_str`
Only error on non-unique exposed names when the already existing exposed name is in a different environment
Fixes on windows: ``` pixi global edit code ``` Aligns `edit` cli: ``` pixi config edit -g code ```
Extend them and make them more consistent
I thought that it would be nice to name it the same as we have it in `pixi exec` --------- Co-authored-by: Hofer-Julian <30049909+Hofer-Julian@users.noreply.github.com>
clap-rs/clap#4507 (comment) `num_args = 1.. ` don't make packages a mandatory argument. This PR aims to fix this, and some other stylistic usage of report instead of computing println message
fixes: ``` pixi global install python pixi global install python==3.10 Error can't find exposed `python3.13` ``` --------- Co-authored-by: Julian Hofer <julianhofer@gnome.org>
Give a more helpful error message if `--environment` is missing
Doesn't change reporting, but the code is now a bit more logical
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome work 🚀
This adds functionality as described in https://pixi.sh/dev/design_proposals/pixi_global_manifest/
Test it locally by doing the following:
Helpful tests for us: