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

"pixi global install" should support constraints #2050

Closed
ctcjab opened this issue Sep 13, 2024 · 8 comments
Closed

"pixi global install" should support constraints #2050

ctcjab opened this issue Sep 13, 2024 · 8 comments
Labels
✨ enhancement Feature request

Comments

@ctcjab
Copy link

ctcjab commented Sep 13, 2024

Repro

  1. Run pixi global install conda-lock
  2. Invoke the resulting conda-lock that gets installed
  3. Observe that you hit the following bug: SyntaxWarning on Python 3.12 conda/conda-lock#677
  4. Note this could be worked around if you could somehow pass a python=3.11 constraint to the pixi global install invocation (much like you can pass --python=3.11 to a uv tool install invocation)

Thanks for your consideration and for the amazing work on pixi!

@ctcjab ctcjab added the ✨ enhancement Feature request label Sep 13, 2024
@Hofer-Julian
Copy link
Contributor

Thanks for the issue.

This will be fixed as soon as https://pixi.sh/latest/design_proposals/pixi_global_manifest/ is released

@Hofer-Julian Hofer-Julian added this to the New `pixi global` milestone Sep 14, 2024
@ctcjab
Copy link
Author

ctcjab commented Sep 16, 2024

Nice, took a quick look, and shareable global environments coupled with non-imperative-only management sounds very interesting. At work I'm eventually hoping to provide all developers here with a base environment of common devtools, plus associated default configuration for them, which I can centrally manage. I was thinking of using the nix ecosystem for this (and try to paper over some of its complexity for my users), but I wonder if pixi could be a better alternative someday.

Looking forward to taking a look once there is something ready to try. (I'll keep an eye on this issue to find out when, unless I should watch some other one.)

@ruben-arts
Copy link
Contributor

@ctcjab Cool! For non NixOS usecases pixi will be really close! But it should be much more comfortable. I'll close this issue for now as it is already part of the design! Thanks for dropping by!

@ctcjab
Copy link
Author

ctcjab commented Sep 17, 2024

Nice, and thank you for all the great work on pixi.

With this issue closed, is there another one I can watch to find out when there's something ready for me to test? I looked through https://github.com/prefix-dev/pixi/issues?q=global+manifest but didn't spot one.

@Hofer-Julian
Copy link
Contributor

@ctcjab The feature branch can be found here: #1833

At the moment, it will remove your currently installed binaries, but that will change soon.

Any testing is much appreciated 🙏🏻

@ctcjab
Copy link
Author

ctcjab commented Oct 16, 2024

Just saw the new pixi global implementation was released in v0.33.0, and tried to take advantage of it to work around the bug mentioned in the description by running:

pixi global install -e conda-lock conda-lock python=3.11

This successfully worked around the bug, but it also exposed a bunch of executables (from python) that I do not want exposed[1].

Is there any way to get the conda-lock environment to use python3.11 to satisfy conda-lock's python dependency without exposing the executables that python provides? I checked the docs and --help output and didn't see any --no-expose option. Hoping I can now use pixi to get the same result as uv tool install --python=3.11 conda-lock (i.e. only expose conda-lock globally and just internally use python3.11 for that environment), but not sure it's possible yet.

Thanks for any help, and congrats on the new release!

[1] namely:

   - 2to3
   - 2to3-3.11
   - idle3
   - idle3.11
   - pydoc
   - pydoc3
   - pydoc3.11
   - python
   - python3
   - python3-config
   - python3.1
   - python3.11
   - python3.11-config

@Hofer-Julian
Copy link
Contributor

@ctcjab You can run the following in order to only expose conda-lock:

pixi global install --environment conda-lock --expose conda-lock conda-lock python=3.11

@ctcjab
Copy link
Author

ctcjab commented Oct 16, 2024

Thanks @Hofer-Julian, that worked!

Sorry I missed that. I re-read the https://pixi.sh/latest/features/global_tools/#exposed docs and, now that I know this, it's clear enough from "but you want to get a select few". Perhaps an example with multiple packages in the same env would have made it clearer, or maybe just adding the word "only"?

In any case, thanks again, and great work on the latest version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ enhancement Feature request
Projects
None yet
Development

No branches or pull requests

3 participants