Support anaconda-project.yml #35
Replies: 2 comments 3 replies
-
Docs for
Can there be more than one environment? I ask because if there can be then it becomes of a question of how does one choose which environment to select? I'm assuming most people only have one, but if they can have more than one is there any hint as to which one the user most likely wants? |
Beta Was this translation helpful? Give feedback.
-
Anaconda Project has its own procedure for determining the "default" of something and I can add a cli command to return the name or path to the "default" environment, like When Anaconda Project is faced with a choice between environments ( I will go into some extreme detail below for how Anaconda Project determines the default behavior. Minimal project yaml filename: example-project
dependencies:
- python=3.8
- flask
channels:
- defaults
commands:
server:
unix: python app.py In this scenario name: example-project
dependencies:
- python=3.8
- flask
channels:
- defaults
commands:
server:
unix: python app.py
env_spec: default
env_specs:
default:
dependencies: []
channels: [] Where the keys in Multiple environmentsIt is somewhat common to have multiple environments, for example an env for development and testing separate from what is needed to run the application. Here I'm going to keep the default environment and add a second one in this case I must write out name: example-project
dependencies:
- python=3.8
- flask
channels:
- defaults
commands:
server:
unix: python app.py
test:
unix: pytest -xvv
env_spec: develop
env_specs:
develop:
dependencies:
- pytest
default:
dependencies: []
channels: [] Because there is an env_spec named "default" Notice that there is no command named "default" so When the user explicitly executes the test ( |
Beta Was this translation helpful? Give feedback.
-
Similar to #5 you might consider supporting Anaconda Project. Anaconda Project (and its eventual successor conda-project) extends the concepts of environment.yml to include runable commands, environment variables, data downloads, and multiple conda environments within a single project/directory. An important difference is that all Conda environments defined through the anaconda-project.yml file are installed local to the project in the
./envs
folder. The Python extension already searches for a./envs
directory and provides conda environments found there as recommended in the environment discovery.It would be really cool for either the future Python extension or an extension specific to Anaconda Project that activates only when
anaconda-project.yml
is found to offer to runanaconda-project prepare
on the terminal which will install the environment[s] defined in the yaml file if they are not already present and the sets active environment appropriately, ignoring the global conda environments.Beta Was this translation helpful? Give feedback.
All reactions