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

Support multi envs #392

Closed
zen-xu opened this issue Oct 17, 2023 · 11 comments
Closed

Support multi envs #392

zen-xu opened this issue Oct 17, 2023 · 11 comments
Labels
enhancement New feature or request

Comments

@zen-xu
Copy link
Contributor

zen-xu commented Oct 17, 2023

Problem description

I need multiple Python version environments, but I can't declare multiple versions simultaneously.

Maybe we can specify envs like

# pixi.toml

[env.py37.dependencies]
python = "3.7.*"
default = true

[env.py311.dependencies]
python = "3.11.*"

After exec pixi install will create two env dirs

  • .pixi/py37
  • .pixi/py311

Control the environment through the -e/--env option

pixi run -e py311 python
@zen-xu zen-xu added the enhancement New feature or request label Oct 17, 2023
@baszalmstra
Copy link
Contributor

This is related to #239 .

Although we are not entirely sure what it will look like we are very keen to have something like this implemented in pixi.

@baszalmstra
Copy link
Contributor

See #239 (comment) for some more thoughts

@zen-xu
Copy link
Contributor Author

zen-xu commented Oct 17, 2023

It seems issue #239 can't solve my problem. I need to have multiple environments locally so I can test in different Python versions.

@baszalmstra
Copy link
Contributor

I think testing in different Python versions is also the use case mentioned in #239 .

There are a couple of different use cases for having multiple environments but none of them are super trivial to implement because we still want to lock all the environments down to ensure reproducibility on anyone's machine.

We are still in the design phase for this issue but I'm sure we'll come up with something. :)

@pavelzw
Copy link
Contributor

pavelzw commented Nov 23, 2023

This proposal is relevant to this issue: https://gist.github.com/0xbe7a/bbf8a323409be466fe1ad77aa6dd5428

@ruben-arts
Copy link
Contributor

https://github.com/bokeh/bokeh/tree/branch-3.4/conda Good example of what we need to solve with pixi multi envs.

@ruben-arts
Copy link
Contributor

Started a project that implements this issue: https://github.com/orgs/prefix-dev/projects/10

@ruben-arts
Copy link
Contributor

Update

Done:

  • The de-serialization of the environments and feature are pretty much done. (
  • In the code there are Environment and Feature objects which can be used to fetch the important specified information.
  • All the sorting and overwriting is implemented as stated in the proposal.

Next:

  • We still need make the logic to select a specific environment instead of using the default.
  • We need to modify the CLI to allow the user to specify an environment.

We expect to have a first working multi environment project end of next week 🚀 . If there are any users that want to poke/stress the logic in the tests to find bug. Please do so, help is much appriciated ❤️ !

@pavelzw
Copy link
Contributor

pavelzw commented Feb 5, 2024

This can be closed now or is anything still missing?

@ruben-arts
Copy link
Contributor

The last parts we want to build in the short future are defined in this project: https://github.com/orgs/prefix-dev/projects/10?query=is%3Aopen+sort%3Aupdated-desc

Should be one more sprint.

@dhirschfeld
Copy link

dhirschfeld commented Mar 19, 2024

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

No branches or pull requests

5 participants