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

Ideas for the project export conda-environment command #2089

Open
Yura52 opened this issue Sep 19, 2024 · 1 comment
Open

Ideas for the project export conda-environment command #2089

Yura52 opened this issue Sep 19, 2024 · 1 comment
Labels
✨ enhancement Feature request

Comments

@Yura52
Copy link
Contributor

Yura52 commented Sep 19, 2024

Problem description

I am excited about the new pixi project export command, thanks @synapticarbors @abkfenris and the team for implementing it! For various reasons, I am interested specifically in the conda-environment command (not in the conda-explicit-spec command). In particular, because there are PyPI dependencies in my projects and because I would like the output to be easier to read and modify.

(1) Channels

I noticed that the output does not include the channel information for individual packages. It means that the environment created from the conda-environment output can be different than the original pixi environment.

Let's consider the following manifest file:

[project]
channels = ["conda-forge", "pytorch"]
name = "tmp"
platforms = ["osx-arm64"]
version = "0.1.0"

[dependencies]
python = "3.10.5"
pytorch = { version = "2.0.0", channel = "pytorch" }

The output of pixi project export conda-environment:

name: default
channels:
- conda-forge
- pytorch
dependencies:
- python ==3.10.5
- pytorch ==2.0.0. # Should be pytorch::pytorch ==2.0.0

Now, if do micromamba env create -f environment.yaml, the pytorch package will be installed from conda-forge instead of the original pytorch channel. While this is in line with what, say, micromamba env export does, I think it would be valuable to allow including the channel information for better reproducibility. In particular, specifically the channel:: format is interesting, because it makes the output compatible with (or more easily adjustable to) different architectures (contrary to the --channel-subdir feature of micromamba env export).

(2) Implicit dependencies

Currently, only the explicit dependencies are included in the output. It would be nice to allow including all dependencies to better match the original environment.

(3) nodefaults

Also, perhaps, the nodefaults channel should be included by default if it is not presented in the original pixi project? First, for better reproducibility (as far as I understand, otherwise, conda can pull packages from the default channel). Second, generally, I am not aware of the legal details of the recent licence changes around the default channel, so I would like to ensure that I don't accidentally install something from the default channel and break any licence agreements.

P.S. Basically, (1) and (3) is what I do manually every time after I run micromamba env export in my projects.

@ruben-arts
Copy link
Contributor

@Yura52 Thanks for the great write-up!

I agree with all your ideas, implemented 1 and 3 in a PR.

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

2 participants