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

Implement --prune flag for mamba env update #1343

Merged
merged 1 commit into from
Jan 20, 2022

Conversation

adament
Copy link
Contributor

@adament adament commented Dec 10, 2021

This fixes #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 pull request is not compatible with the current conda implementation but instead implements the feature as documented in conda env update --help and as requested in the related conda issue (as far as I understand it). As it was suggested in #688 it might thus be preferred to implement this as a separate argument to mamba env update but with my very limited understanding of conda internals it seems a much greater task.

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.
@adament
Copy link
Contributor Author

adament commented Dec 10, 2021

Off topic question but is there a way I can run the python formatters locally?

@baszalmstra
Copy link
Contributor

Off topic question but is there a way I can run the python formatters locally?

I simply run pre-commit run --all, but you can also simply install and run black=19.10b

@adament
Copy link
Contributor Author

adament commented Dec 11, 2021

Off topic question but is there a way I can run the python formatters locally?

I simply run pre-commit run --all, but you can also simply install and run black=19.10b

Thank you!

@wolfv wolfv merged commit f2c40e2 into mamba-org:master Jan 20, 2022
@wolfv
Copy link
Member

wolfv commented Jan 20, 2022

Thanks!

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

Successfully merging this pull request may close these issues.

Support --prune flag in 'mamba install'
3 participants