-
Notifications
You must be signed in to change notification settings - Fork 348
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 --prune flag in 'mamba install' #688
Comments
Does #327 enable the |
@LunarLanding you're mentioning For |
@ahgraber sorry haven't had the time to test it yet. I mentioned The process would be as you say: solve directly from source of truth (=environment file) to get a package spec (fast), leave already installed packages as is, remove those not in the spec, install the ones that are not present in the installation. |
@ahgraber I just tested. Removing a package with no dependencies from the environment file and then running |
@LunarLanding we haven't worked on this yet. You're welcome to give this a hand! I think it shouldn't be too hard to add that flag to |
@wolfv thanks for the clarification, it's understandable; and thanks for the pointer, I initally thought I would have to touch the C implementation, but if it's doable via python then I'll try it. |
This fixes mamba-org#688 and the similar issue for conda conda/conda#7279. The prune flag is implemented by running the solver as if it was given an empty prefix and then computing the diff between the current prefix and the newly solved target and executing those resulting links and unlinks. This assumes that it is always possible to transform a given prefix to any other consistent set of packages, since the solver never sees the list of currently installed packages. Furthermore a small fix for leaking temporary files is included.
This fixes mamba-org#688 and the similar issue for conda conda/conda#7279. The prune flag is implemented by running the solver as if it was given an empty prefix and then computing the diff between the current prefix and the newly solved target and executing those resulting links and unlinks. This assumes that it is always possible to transform a given prefix to any other consistent set of packages, since the solver never sees the list of currently installed packages. Furthermore a small fix for leaking temporary files is included.
This fixes mamba-org#688 and the similar issue for conda conda/conda#7279. The prune flag is implemented by running the solver as if it was given an empty prefix and then computing the diff between the current prefix and the newly solved target and executing those resulting links and unlinks. This assumes that it is always possible to transform a given prefix to any other consistent set of packages, since the solver never sees the list of currently installed packages. Furthermore a small fix for leaking temporary files is included.
Matching changes done to channel/package specs to an environment could be done efficiently by supporting the prune flag properly; however conda env --prune [...] takes in account the history of conda install commands, and while a fix is in the works, it is taking a very long time (the issue was first reported in 2018 : conda/conda#7279 ).
The current workaround is deleting and recreating the environment. Given how fast mamba is at solving plus caching, this works for now. In fact the only package I recall ever taking a long time to setup is jupyter, with its build step.
Either way, I wonder if it would be possible to support --prune directly in mamba install. Perhaps with a different name to not cause confusion ('-sync'?).
The text was updated successfully, but these errors were encountered: