Open hushoujier opened 1 year ago
Thank you @suuperhu for the feature request. I'm unsure if this is a good way to go, as things could get complicated quickly. Micromamba environment file allows defining libraries and versions in a very flexible format. For example, here is an environment file that I use often:
# Micromamba environment file
# https://marketplace.visualstudio.com/items?itemName=corker.vscode-micromamba
name: default
channels:
- conda-forge
dependencies:
- nodejs=18
- terraform=1
- pip:
- azure-cli
As you can see, we pin node
and terraform
versions and add azure-cli
via pip
It would be great to define a feature that could cover multiple scenarios for developers in a convenient way.
I'm still thinking about how to do it. I'd be glad to hear your thoughts on this.
Honestly, I think this could be addressed simply with some README improvements. Today I tried to use this with a project that already had an environment.yml
, but my file had prefix: path\to\conda\env
set. This caused it to fail without much error. But I didn't even realize that "Create Environment" implied "Create Environment from environment.yml
if one already exists, otherwise create a new environment.yml
.
I would suggest changing the readme:
This command uses environment.yml
to create or update a virtual environment. The environment.yml
is a mamba environment file which describes the interpreters and packages to install into the environment. If your project doesn't have an environment.yml
yet, one will be created. The extension comes with a number of templates, but you could change it to your needs and re-run the create command.
With the suggested wording, I think it should be clear to users that they can do this workflow in a new project:
environment.yml
to add nodejs, python packages, set a specific python version, etcЧестно говоря, я думаю, что эту проблему можно решить простыми улучшениями README. Сегодня я попытался использовать это с проектом, у которого уже был
environment.yml
, но мой файл имелprefix: path\to\conda\env
набор. Это привело к сбою без особых ошибок. Но я даже не осознавал, что «Создать среду» подразумевало «Создать среду изenvironment.yml
если он уже существует, в противном случае создайте новыйenvironment.yml
.Я бы предложил изменить readme:
Микромамба: создаем среду
This command uses
environment.yml
to create or update a virtual environment. Theenvironment.yml
is a mamba environment file which describes the interpreters and packages to install into the environment. If your project doesn't have anenvironment.yml
yet, one will be created. The extension comes with a number of templates, but you could change it to your needs and re-run the create command.With the suggested wording, I think it should be clear to users that they can do this workflow in a new project:
1. Micromamba: Create Environment 2. Edit the `environment.yml` to add nodejs, python packages, set a specific python version, etc 3. Run Micromamba: Create Environment again
Thanks for the explanation, I didn't even think about the fact that micromamba has the same config as conda. 😁
I do not know why, but my environment.yml file is not visible in vscode explorer.
It should be something local, not related to the extension. Please check if the file is visible in the system terminal or in the file system explorer
Environment
node -v
: nonenpm -v
: nonePrerequisite
Install this extension
Steps to Reproduce
Relevant Debug Info
none
Expected Behavior
Or
Actual Behavior
The environment automatically creates and downloads the latest programming language version