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

Install development dependencies incrementally #515

Open
2 tasks done
nealstewart opened this issue Sep 27, 2023 · 5 comments
Open
2 tasks done

Install development dependencies incrementally #515

nealstewart opened this issue Sep 27, 2023 · 5 comments

Comments

@nealstewart
Copy link

Checklist

  • I added a descriptive title
  • I searched open requests and couldn't find a duplicate

What is the idea?

I use conda-lock to lock versions before building Docker images, and also to create a local development environment. With conda-lock's development dependencies, I can create a fresh conda environment with said dependencies, but I would like to be able to update an existing conda environment seamlessly to do so and include pip dependencies that are locked.

Why is this needed?

Essentially this would just support staged Docker builds without adding egregious amounts of time to my build in order to install with conda-lock twice.

What should happen?

conda-lock install --no-dev -n example
conda-lock install --dev -n example # Incrementally installs the development. dependencies

Additional Context

No response

@maresb
Copy link
Contributor

maresb commented Sep 27, 2023

I use it similarly and would really like to see this. In particular it would be great if conda-lock install didn't clobber existing environments, but rather diffed with the existing dependencies in order to figure out the necessary changes.

Another potentially nice usage case along these lines with Docker would be, in the case of large environments, to apply sequences of lockfiles in order to avoid a full rebuild, e.g.

COPY conda-lock-01.yml .
RUN conda-lock install conda-lock-01.yml
COPY conda-lock-02.yml .
RUN conda-lock install conda-lock-02.yml
...

@nealstewart, would you be willing to contribute a PR?

@nealstewart
Copy link
Author

@maresb PR incoming...

@nealstewart
Copy link
Author

I've implemented it as an optional new flag --update, in order to preserve the existing API behaviour (install twice, create two environments).

I just leverage conda env update behind the scenes to leverage Conda's existing behaviour.

@nealstewart
Copy link
Author

There you go!

nealstewart added a commit to nealstewart/conda-lock that referenced this issue Sep 29, 2023
@sjdemartini
Copy link

As mentioned in #516 (comment), this would be useful not just for development dependencies, but it would be super useful in general to be able to update an existing env to match a lockfile, rather than deleting/recreating the env entirely as seems to happen now. The latter approach is unsafe for any shared environments (e.g. a JupyterHub kernel env), but conda-lock would be very useful there for updating environments predictably.

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

3 participants