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 for using Conda/Mamba solver to recursively find dependencies #57

Open
manics opened this issue Apr 25, 2022 · 0 comments
Open

Comments

@manics
Copy link

manics commented Apr 25, 2022

I've got a proof-of-concept of using the Mamba/Conda dependency solver to find the full set of dependencies for a set of package specifications:
https://github.com/manics/conda-mirror/tree/conda-mamba-downloader

The main advantage of this is it only downloads one version of each each package or dependency. The corresponding disadvantage is you can't whitelist multiple versions of a package, so if you're adding to an existing set of downloaded packages you may not be able to install the new packages alongside them. This is acceptable for me and is easier than trying to restrict the number of versions of everything.

I've done this by using the mamba/conda dependency solver to provide a list of package filenames (*.tar.bz2), and passing this into conda-mirror to handle downloads, validation and updating repodata.json.

I've effectively written a wrapper script https://github.com/manics/conda-mirror/blob/conda-mamba-downloader/conda_downloader/download.py
which calls the solver: https://github.com/manics/conda-mirror/blob/bc1eca6bac0ec78ee35d2f2ce833b7fcbe794a82/conda_mamba_downloader/download.py#L122-L143
and wraps a call to conda_mirror.main(): https://github.com/manics/conda-mirror/blob/bc1eca6bac0ec78ee35d2f2ce833b7fcbe794a82/conda_mamba_downloader/download.py#L203-L229

I made one change to conda-mirror to use the filename as an additional match key:
manics@2bad966

Do you have any thoughts on how/whether this should work with conda-mirror? As a standalone change adding the filename key so conda-mirror can be used as a backend library for this, or add the full solver functionality (with limitations) to conda-mirror?

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

1 participant