Open jonashaag opened 2 years ago
I think we can use the current micromamba update -f myenv.yml
for that.
We can add a command line option to --prune-to-specs
.
micromamba update -f myenv.yml
seems to ignore myenv.yml
.
I am realizing that maybe that is the desired behavior and micromamba install
is all we should ever need?
Let's picture some scenarios -- assuming we have a created environment. What should the ideal command line look like. We could quite easily add the following flags:
micromamba install -f env.yml
-> installs new packages to specsmicromamba install -f env.yml --update
-> installs & updates new packages according to env.yml
micromamba install -f env.yml --update --prune-to-specs
-> installs & updates new packages to specs, removes packages not in the environment but not in env.yml
Yes that sounds reasonable as well. What would be the role of micromamba update
in that case? Is it just a shorthand to install --update
?
When using install --update
we could use the SOLVER_FLAG_INSTALL_ALSO_UPDATES
flag. It would be different from update
because update
doesn't install any new packages.
We just hit this again. Shall we remove the --file
option from `update?
Is there any intention to add a --prune
option to be able to remove packages that are not specified in an environment file?
My understanding is that mamba env update -n myenv -f environment.yml --prune
will install new packages, update existing packages, and remove extraneous packages so that myenv
ends up in the same state as it would be if you did mamba env remove -n myenv && mamba create -n myenv -f environment.yml
.
It would be good for an analogous command to exist in micromamba. It would be especially convenient if this command created the environment if it didn't already exist. (E.g., after you run this command, you're guaranteed to end up with myenv
matching the given environment.yml
file regardless of the initial state or existence of myenv
, and the command would get you there in the most efficient way.)
--prune-to-specs - @ wolfv at https://github.com/mamba-org/mamba/issues/1455#issuecomment-1032754684
that is very much needed 😃
the issue with env create
is that it doesn't use existing cache and has to download all the packages again.
combining this with #2700 issue, this pruning feature will allow to quickly remove the devt dependencies to get a lean environment back again.
What's the current best alternative to micromamba env update -n X -f environment.yml
?
--prune-to-specs
- @ wolfv at #1455 (comment)
that is very much needed 😃 the issue with
env create
is that it doesn't use existing cache and has to download all the packages again.combining this with #2700 issue, this pruning feature will allow to quickly remove the devt dependencies to get a lean environment back again.
micromamba env create -f env.yaml
already reuses cache and is pretty fast to update an existing environment now.
It would be nice to have a way in Micromamba to update an env from an
environment.yml
. In Mamba this works bymamba env update -n X -f environment.yml
.