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 micromamba env update #1455

Closed
jonashaag opened this issue Feb 8, 2022 · 14 comments
Closed

Implement micromamba env update #1455

jonashaag opened this issue Feb 8, 2022 · 14 comments

Comments

@jonashaag
Copy link
Collaborator

It would be nice to have a way in Micromamba to update an env from an environment.yml. In Mamba this works by mamba env update -n X -f environment.yml.

@wolfv
Copy link
Member

wolfv commented Feb 8, 2022

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.

@jonashaag
Copy link
Collaborator Author

jonashaag commented Feb 8, 2022

micromamba update -f myenv.yml seems to ignore myenv.yml.

@wolfv
Copy link
Member

wolfv commented Feb 8, 2022

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 specs
  • micromamba 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

@jonashaag
Copy link
Collaborator Author

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?

@wolfv
Copy link
Member

wolfv commented Feb 9, 2022

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.

#1317

@jonashaag
Copy link
Collaborator Author

We just hit this again. Shall we remove the --file option from `update?

@CDTR-MattConroy
Copy link

Is there any intention to add a --prune option to be able to remove packages that are not specified in an environment file?

@shenker
Copy link

shenker commented May 31, 2023

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.)

@goyalyashpal
Copy link

goyalyashpal commented Aug 12, 2023

--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.

@GitHunter0
Copy link

What's the current best alternative to micromamba env update -n X -f environment.yml?

@jonashaag
Copy link
Collaborator Author

Fixed in #2827?

@chenzhekl
Copy link

--prune-to-specs

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.

@jjerphan
Copy link
Member

jjerphan commented Oct 8, 2024

micromamba env update has been implemented and improved by the following PRs:

{micromamba,mamba} env update -n myenv -f environment.yml --prune (as proposed by #1455 (comment)) could potentially be implemented if this is still useful UX-wise.

Please do 👍-react if you are interested so that this can be considered further.

@jjerphan
Copy link
Member

I propose continuing the discussions on #3529.

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

8 participants