You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How would this feature be useful?
Another common way of provisioning conda environments is through an environment.yml file which can be used to update an environment with
conda env update --file environment.yml
Describe the solution you'd like
Not sure what is ideal here. This particular use-case could be solved by adding a command:
session.conda_env_update("environment.yml")
or similar. This is easily implemented in session.py:
...
defconda_env_update(self, envfile='environment.yml': str, **kwargs: Any) ->None:
"""Install invokes `conda env update`_ to update the session's environment. To install packages directly:: session.conda_env_update('environment.yml') .. _conda env update: """venv=self._runner.venvprefix_args= () # type: Tuple[str, ...]ifisinstance(venv, CondaEnv):
prefix_args= ("--prefix", venv.location)
elifnotisinstance(venv, PassthroughEnv): # pragma: no coverraiseValueError(
"A session without a conda environment cannot update."
)
if"silent"notinkwargs:
kwargs["silent"] =Trueself._run(
"conda", "env", "update", *prefix_args, "--file", envfile, external="error", **kwargs
)
...
however, it might be better to provide a more general fallback that allows users to customize commands for conda provisioning.
possibly with variables for the --prefix argument. The other commands like conda_install could then be aliases to this more generic command. Note: there are some differences between conda install and conda env command (for example, --yes is not supported by the latter) which can cause confusion.
Related: one might also like to replace conda with mamba, so perhaps a kwarg could be provided. I will play with this a bit and try to make a reasonable PR/
The text was updated successfully, but these errors were encountered:
Yes - it looks very similar. Sorry, not sure how I missed that... I will review what was discussed there, then merge my comments and discussion with that issue and then close this.
@mforbes and @smarie I've just discovered nox, and it's really pretty awesome! Congratulations 💯 🎉
I'd love to be able to create a conda environment based on an environment.yml so it would be great to know if this issue will mature into a pull-request?
How would this feature be useful?
Another common way of provisioning conda environments is through an
environment.yml
file which can be used to update an environment withDescribe the solution you'd like
Not sure what is ideal here. This particular use-case could be solved by adding a command:
or similar. This is easily implemented in
session.py
:however, it might be better to provide a more general fallback that allows users to customize commands for conda provisioning.
possibly with variables for the
--prefix
argument. The other commands likeconda_install
could then be aliases to this more generic command. Note: there are some differences betweenconda install
andconda env
command (for example,--yes
is not supported by the latter) which can cause confusion.Related: one might also like to replace
conda
withmamba
, so perhaps a kwarg could be provided. I will play with this a bit and try to make a reasonable PR/The text was updated successfully, but these errors were encountered: