anaconda / anaconda-project

Tool for encapsulating, running, and reproducing data science projects
https://anaconda-project.readthedocs.io/en/latest/
Other
217 stars 88 forks source link

[ENH] set variables into conda env on prepare #342

Open AlbertDeFusco opened 2 years ago

AlbertDeFusco commented 2 years ago

If environment variables are set in the anaconda-project.yml file they are only set when using anaconda-project run. It is possible to set variables into the $CONDA_PREFIX/conda-meta/state file to allow setting variables upon activation.

> conda env config vars set DUDE=woah 
> cat $CONDA_PREFIX/conda-meta/state
{"env_vars": {"DUDE": "woah"}}

The prepare action can be amended to set variables as shown above