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

Possible to export pip-packages? #75

Closed
JohannesWiesner opened this issue May 30, 2023 · 4 comments
Closed

Possible to export pip-packages? #75

JohannesWiesner opened this issue May 30, 2023 · 4 comments

Comments

@JohannesWiesner
Copy link

I am using setup-micromamba@v1 to create environments and would like to export them as text files, either with micromamba env export --name ... > file.yml or conda list --explicit > file.txt. However, I noticed that pip-packages are not included in the exported text files. Is this behavior normal?

Here's an example repo where I use the workflow to create an environment based on the input file environment.yml, export it to text files and then push it back to the repo (the two files with _solved as suffixes).

@jonashaag
Copy link
Collaborator

See mamba-org/mamba#2008

@jonashaag jonashaag closed this as not planned Won't fix, can't repro, duplicate, stale May 30, 2023
@pavelzw
Copy link
Member

pavelzw commented May 30, 2023

For now, you could do something like this:

- name: setup micromamba and solve environment
  uses: mamba-org/setup-micromamba@v1
  with:
    environment-file: environment.yml
    environment-name: ${{ runner.os }}
- name: export environment created with micromamba using conda
  run: |
    conda env export -p "${MAMBA_ROOT_PREFIX}/envs/${{ runner.os }}" > ./environments/${{ runner.os }}_solved_with_pip.yml

Btw conda list --explicit can be replaced by micromamba env export --explicit.

@JohannesWiesner
Copy link
Author

Thanks! Just as a sanity check:

1.) If one wants to output a .yml file, -p "${MAMBA_ROOT_PREFIX}/envs/name_of_my_environment" does the trick. Right now, this only works in combination with conda env export, not micromamba env export.

2.) However, if one wants to output a spec file with the exact package URLs, neither conda list --explicit nor micromamba env export --explicit will include pip-packages which is probably out of scope of this repo and which is addressed in this issue

@pavelzw
Copy link
Member

pavelzw commented May 31, 2023

Yes, seems right 👍🏻

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

No branches or pull requests

3 participants