Closed AlbertDeFusco closed 3 years ago
I have discovered that Using Conda activate.d
does not work because Anaconda Project does not use the standard Conda activate mechanism
@AlbertDeFusco should we fix this? That is to say, should we correct how anaconda-project does activation to either use conda's approach directly or reproduce the same steps?
Now that conda run
in version 4.9 supports output streaming --no-capture-output
I'd like to explore whether we could offload the work to conda run
rather than replicating it.
That's a good idea, but it raises an important question about how to handle older versions of conda (like those found in AE). As long as we don't break current behavior, but enable newer/better behavior for newer versions of conda, that would be fine.
Exactly! It seems like lack of support activate.d has not yet been called out as a bug, so I'm happy to leave this PR as-is and attack activate.d later and potentially only when using against newer conda versions.
There are now 5 places where environment variables can be set for use in
anaconda-project run
. The order listed here is highest priority first, meaning that variables set in any location override the same variable name if exists lower on the list.Command line invocation
MY_VAR='on cli' anaconda-project run
Shell export
Set within the
anaconda-project.yml
file defined for the command to be runSet within the
anaconda-project.yml
at the top levelWithin the Conda environment after running
anaconda-project prepare
conda env config vars
or through https://github.com/conda/conda/pull/10169 coupled with #275Variable priority examples
The examples here are presented in reverse order from above to demonstrate the override. Each example builds from the previous state.
Conda env config vars
Top-level project key
Adding
variables
to the project file overrides the Conda env.Command-specific variable
Exported in shell
Set on shell command