-
Notifications
You must be signed in to change notification settings - Fork 186
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: pixi global reinstall flag #2274
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/)
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 <[email protected]>
As soon as we implement it, this marker should throw an error
Co-authored-by: Bas Zalmstra <[email protected]> Co-authored-by: Bas Zalmstra <[email protected]>
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 prefix-dev#1975 lands first --------- Co-authored-by: Hofer-Julian <[email protected]> Co-authored-by: Julian Hofer <[email protected]>
Cleaning up the creation of the manifest from existing environments. Improving error.
…2140) This is going to help to get the meta data easier in more scenarios --------- Co-authored-by: Hofer-Julian <[email protected]> Co-authored-by: Julian Hofer <[email protected]>
Co-authored-by: Ruben Arts <[email protected]>
- Use long form CLI commands. They are preferable in scripts and docs. - Require parameter `packages` - Use `HasSpecs` trait - Fail if environment doesn't exist - Use `environment_prefix` in more places - Take ownership of `env_name` in `environment_prefix` - Use stderr for messages as described in https://clig.dev/#the-basics - Adapt mapping docs - Dropped `global` namespace in integration test naming for consistency - Extended integration tests
It used to accept not giving any positional parameters
Now the migration script will result in: ```toml [envs.package2] channels = ["file:///C:/Users/Ruben/development/pixi/tests/integration/test_data/global_update_channel_1/output"] dependencies = { package2 = "*" } exposed = { package2 = "package2" } [envs.pixi-pack] channels = ["conda-forge"] dependencies = { pixi-pack= "*" } exposed = { pixi-pack= "pixi-pack" } ```` Instead of ```toml [envs.package2] channels = ["file:///C:/Users/Ruben/development/pixi/tests/integration/test_data/global_update_channel_1/output"] dependencies = { package2 = "*" } exposed = { package2 = "package2" } [envs.pixi-pack] channels = ["https://conda.anaconda.orge/conda-forge/"] dependencies = { pixi-pack= "*" } exposed = { pixi-pack= "pixi-pack" } ```` This PR also fixes the migration from multi channel environments, as it was not checking all channels used in the initial install. Before: ```toml [envs.lsd] channels = ["https://prefix.dev/rust-forge"] dependencies = { lsd = "*" } exposed = { lsd = "lsd" } ``` after this PR: ```toml [envs.lsd] channels = [ "https://prefix.dev/rust-forge", "conda-forge", ] dependencies = { lsd = "*" } exposed = { lsd = "lsd" } ``` --------- Co-authored-by: Julian Hofer <[email protected]>
Co-authored-by: Ruben Arts <[email protected]>
Co-authored-by: Ruben Arts <[email protected]>
Co-authored-by: Ruben Arts <[email protected]> Co-authored-by: Ruben Arts <[email protected]>
…nc (prefix-dev#2246) This fixes the situation where we removed environments that were removed from the manifest on `pixi global uninstall` but it should only uninstall the requested environments.
Adds a subcommand to pixi global: ``` pixi global edit ``` This will open the manifest file in the editor defined in `EDITOR` path variable or defaults to `nano` or `notepad` depending on the machine. This code is stolen from `pixi config edit` --------- Co-authored-by: Julian Hofer <[email protected]>
Co-authored-by: Ruben Arts <[email protected]>
Co-authored-by: Ruben Arts <[email protected]>
…fix-dev#2169) Not proud of this but it's a start. I rather spend more time on improving the code then documenting my way around it. --------- Co-authored-by: Julian Hofer <[email protected]> Co-authored-by: Hofer-Julian <[email protected]>
Co-authored-by: Hofer-Julian <[email protected]>
Users will get an error message when they attempt to use `pixi global upgrade` or `pixi global upgrade-all` --------- Co-authored-by: Ruben Arts <[email protected]>
Normalize input in `EnvironmentName::from_str`
Only error on non-unique exposed names when the already existing exposed name is in a different environment
Extend them and make them more consistent
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.