Content
Provide a convenient way to install developer tools in VSCode workspaces from conda-forge with micromamba. Get NodeJS, Go, Rust, Python, or JupyterLab installed by running a single command.
Inspired by Robocorp RPA developer tools:
- RCC - a command-line tool to run software robots and integrate with the Robocorp Cloud
- Robocorp Code - a VSCode extension to build software robots
This command creates a file - environment.yml describing configuration. The environment.yml is a mamba environment file The extension comes with a number of templates, but you could change it to your needs and re-run the init command.
- Open the command palette (Ctrl+Shift+P)
- Type - micromamba create environment
- Choose a template from a list
- The environment is activated automatically
- Open the command palette (Ctrl+Shift+P)
- Type - micromamba deactivate environment
- Open the command palette (Ctrl+Shift+P)
- Type - micromamba activate environment
- Choose an environment from a list of created environments
- Open the command palette (Ctrl+Shift+P)
- Type - micromamba remove environment
- Choose an environment from a list of created environments
Clear all command, removes micromamba and packages, and reset the environment to the initial state.
- Open the command palette (Ctrl+Shift+P)
- Type - micromamba clear all
Activate an environment created outside of the vscode-micromamba extension.
- Open the command palette (Ctrl+Shift+P)
- type - micromamba activate by path
Store micromamba files and environments for all projects in one global directory.
- Open the command palette (Ctrl+Shift+P)
- Type - micromamba use global home directory
Store micromamba files and environments in the .micromamba directory inside the project.
- Open the command palette (Ctrl+Shift+P)
- Type - micromamba use local home directory
This is a default behavior
Update micromamba to the latest version.
- Open the command palette (Ctrl+Shift+P)
- Type - micromamba self update
Micromamba updates each time before creating a new environment
Show output pane and select micromamba source
- Open the command palette (Ctrl+Shift+P)
- Type - micromamba show output
The extension works locally by default when all additional files are created in the <workspaceRoot>/.micromamba
directory.
Switching to global home directory mode is also possible when files for all projects are stored in one place.
- A fully encapsulated installation per project - all files are inside the project directory
- Nothing left behind when the project gets deleted
- Easy to investigate the content of the micromamba environments
- Use less disk space and could be faster to create environments because packages are cached globally
- Micromamba files inside the project directory could conflict with other tools. E.g.,
yarn
doesn't like local mode in combination with themodule
node package type.
On Linux and Mac, the global home directory is always $HOME/.vscode-micromamba
On Windows, the extension asks to provide a path to the global home directory. It's recommended to make the path as short as possible to minimize MAX_PATH problems, especially when using Python.
DotEnv file is a convenient way to provide environment variables to other extensions or user scripts. Each time a user creates or activates an environment, a ~/.micromamba/.env.{prefix-name} file is created.
With multi-root workspaces, all operations will work the same way as if you open the first workspace folder in VSCode. The idea is that the first workspace folder is a target folder.
Let's say you have a project.code-workspace
with content:
{
"folders": [
{
"path": "folderA"
},
{
"path": "folderB"
}
]
}
Assuming folders are already created, when you open the workspace in VSCode and command to create a micromamba environment, you'll see the following directory structure:
.
├── folderA
│ ├── .micromamba
│ └── environment.yml
├── folderB
Simply open Micromamba - Visual Studio Marketplace and click Install. Alternatively, open Visual Studio Code, go to the extension view and search for Micromamba.
For detailed releases and migration help, please see releases.
Michael Borisov (@corker).
Thanks for considering! Check here for useful tips and guidelines.
We use a shared copyright model that enables all contributors to maintain the copyright on their contributions.
This software is licensed under the BSD-3-Clause license. See the LICENSE file for details.