Giter Site home page Giter Site logo

mamba-org / vscode-micromamba Goto Github PK

View Code? Open in Web Editor NEW
78.0 6.0 10.0 1.79 MB

A VSCode extension to generate development environments using micromamba and conda-forge package repository

License: BSD 3-Clause "New" or "Revised" License

TypeScript 100.00%
conda mamba vscode-extension micromamba conda-forge

vscode-micromamba's Introduction

vscode-micromamba

Build Status Coverage Status Visual Studio Marketplace Open VSX Version


Content


The Aim

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

Commands

Micromamba: create an environment

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.

  1. Open the command palette (Ctrl+Shift+P)
  2. Type - micromamba create environment
  3. Choose a template from a list
  4. The environment is activated automatically

Micromamba: deactivate the environment

  1. Open the command palette (Ctrl+Shift+P)
  2. Type - micromamba deactivate environment

Micromamba: activate environment

  1. Open the command palette (Ctrl+Shift+P)
  2. Type - micromamba activate environment
  3. Choose an environment from a list of created environments

Micromamba: remove the environment

  1. Open the command palette (Ctrl+Shift+P)
  2. Type - micromamba remove environment
  3. Choose an environment from a list of created environments

Micromamba: clear all

Clear all command, removes micromamba and packages, and reset the environment to the initial state.

  1. Open the command palette (Ctrl+Shift+P)
  2. Type - micromamba clear all

Micromamba: activate environment by path

Activate an environment created outside of the vscode-micromamba extension.

  1. Open the command palette (Ctrl+Shift+P)
  2. type - micromamba activate by path

Micromamba: use the global home directory

Store micromamba files and environments for all projects in one global directory.

  1. Open the command palette (Ctrl+Shift+P)
  2. Type - micromamba use global home directory

Micromamba: use the local home directory

Store micromamba files and environments in the .micromamba directory inside the project.

  1. Open the command palette (Ctrl+Shift+P)
  2. Type - micromamba use local home directory

This is a default behavior

Micromamba: self-update

Update micromamba to the latest version.

  1. Open the command palette (Ctrl+Shift+P)
  2. Type - micromamba self update

Micromamba updates each time before creating a new environment

Micromamba: show output

Show output pane and select micromamba source

  1. Open the command palette (Ctrl+Shift+P)
  2. Type - micromamba show output

Global home directory

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.

Local mode

  1. A fully encapsulated installation per project - all files are inside the project directory
  2. Nothing left behind when the project gets deleted
  3. Easy to investigate the content of the micromamba environments

Global mode

  1. Use less disk space and could be faster to create environments because packages are cached globally
  2. Micromamba files inside the project directory could conflict with other tools. E.g., yarn doesn't like local mode in combination with the module node package type.

Location of the global home directory

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 support

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.

Multi-root workspaces

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

How to get it?

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.

Maintainers

Michael Borisov (@corker).

Want to Contribute?

Thanks for considering! Check here for useful tips and guidelines.

License

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.

vscode-micromamba's People

Contributors

anton-matosov avatar carlthome avatar corker avatar dependabot[bot] avatar sauravmaheshkar avatar vroger11 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

vscode-micromamba's Issues

ENOENT: no such file or directory, scandir 'C:\...' on Linux (WSL2) machine

Environment

  1. node -v: N/A
  2. npm -v: N/A
  3. Operating system: WSL2 (Ubuntu 22.04, 5.15.90.1-microsoft-standard-WSL2, x86_64)

Prerequisite

[fill]

Steps to Reproduce

  • Add a environment.yml to project folder:
# environment.yml
name: redash
channels:
  - conda-forge
dependencies:
  - python=3.7
  - nodejs=14
  - yarn=1
  • Click on create:
    image

Relevant Debug Info

  • Why does it prefix a C:\ when I am using Linux (WSL2)?

Expected Behavior

Extension successfully creates a .micromamba folder in the project folder

Actual Behavior

ENOENT: no such file or directory, scandir 'C:\home\lucasfcnunes\projects\getredash\redash'

image

*Clicking in 'Reload' doesn't solve the problem and it keeps showing no matter how many times you click on it.

$PATH is set incorrectly when using multiple folders

Environment

Operating system: Arch Linux
Node: v17.3.0
VS Code: 1.62.2

Steps to Reproduce

  • Add FolderA to Workspace
  • Add FolderB to Workspace
  • Open Terminal for FolderB

Expected Behavior

$PATH should be set to FolderB/.micromamba

Actual Behavior

$PATH is always set to FolderA/.micromamba

To set PATH to FolderB/.micromamba you have to remove all folders until FolderB is on top of your folder list.

Cannot find micromamba environment.

Environment

  1. node -v: v14.16.1
  2. npm -v: 6.14.12
  3. Operating system: ubuntu 18.04 arm64

Prerequisite

I'm using ubuntu inside proot, which allows running linux on android. And I'm using vscode for arm 1.55.2

Steps to Reproduce

ctrl shift p and enter Micromamba: activate environment

Relevant Debug Info

no debug info showed.

Expected Behavior

show a list of environments

Actual Behavior

nothing happened. No hints like "activate failed".

I tried run Micromamba:create and the create process runned successfully. The new environment was created correctly. But the last step, which I think might be activate the new env failed.
My env folder was ~/micromamba/envs/ and my working folder was ~/works/program.

Micromamba Extension not respecting `.condarc` file

Environment

  1. node -v: -
  2. npm -v: -
  3. Operating system: OSX Sonoma 14.1.1

Prerequisite

I already have a environment.yml file that contains some packages that are only available through our intern channel. The configuration to access this channel is specified in ~/.condarc. When activating the environment, an error occurred stating the intern channel could not be found.

Expected Behavior

I would expect the extension to allow for a global configuration like ~/.condarc.

Actual Behavior

I didn't find a setting where I could set a global configuration file. Is there something I've missed?

Activate the micromamba by path error

Environment

  1. node -v: v10.24.0
  2. npm -v: not installed
  3. Operating system: deepin (like debian )

Prerequisite

Installed micromamba by path /home/username/micromamba and use the base env
Try to activate the micromamba by path ( /home/username/micromamba )

Steps to Reproduce

Try to activate the micromamba by path ( /home/username/micromamba )

Relevant Debug Info

It's ok by path /home/username/micromamba/envs/env1. but it is wrong with /home/username/micromamba
图片

Expected Behavior

Activate the micromamba env base by activate the micromamba by path ( /home/username/micromamba )

Activate the micromamba env env1 by activate the micromamba by path ( /home/username/micromamba/envs/env1 )

Actual Behavior

Activate the micromamba env base by activate the micromamba by path ( /home/username/micromamba )
图片

But Activate the micromamba env env1 by activate the micromamba by path ( /home/username/micromamba/envs/env1 ) is ok

The extension is disabled in a remote web based vscode

Thank you for your efforts ! Making micromamba and vscode working well together is something that i'm looking for. Unfortunately i have a web based remote vscode installation ( i use code-server), and apparently the extension does only support Desktop based install of vscode, when installing the extension, i get this message :

This extension is disabled because it is defined to run only in code-server for the desktop

Do you plan to support remote vscode install ?

try to reuse installed `micromamba` and envs

Environment

  1. node -v: [fill]
  2. npm -v: [fill]
  3. Operating system: Linux

Prerequisite

System already installed micromamba

Steps to Reproduce

  1. install micromamba to /usr/local/bin/micromamba
  2. micromamba create -n example
  3. install the extension

Expected Behavior

The extension is expected to use installed binary first, and search environments inside $HOME/micromamba

Actual Behavior

The extension try to download binary to .vscode-micromamba/micromamba even there is one installed.
And can't find environment inside $HOME/micromamba.

Work Around

cd
ln -sd /root/micromamba .vscode-micromamba
ln -s /usr/local/bin/micromamba .vscode-micromamba/micromamba

The fastest (and the most fun) way to resolve the issue is to submit a pull-request yourself. If you are interested, feel free to check out the contribution guide, we look forward to seeing your PR...

Publish `vscode-micromamba` to Open VSX

Dear extension author,
Please publish this extension to the Open VSX marketplace.

Context

Unfortunately, as Microsoft prohibits usages of the Microsoft marketplace by any other products or redistribution of .vsix files from it, in order to use VS Code extensions in non-Microsoft products, we kindly ask that you take ownership of the VS Code extension namespace in Open VSX and publish this extension on Open VSX.

What is Open VSX? Why does it exist?

Open VSX is a vendor neutral alternative to the MS marketplace used by most other derivatives of VS Code like VSCodium, Gitpod, OpenVSCode, Theia-based IDEs, and so on.

You can read on about Open VSX at the Eclipse Foundation's Open VSX FAQ.

How can you publish to Open VSX?

The docs to publish an extension can be found here. This process is straightforward and shouldn't take too long. Essentially, you need an authentication token and to execute the ovsx publish command to publish your extension. There's also a doc explaining the whole process with an example GitHub Action workflow.

Cannot install micromamba on remote server (via SSH)

Environment

Vscode = 1.76.1
Operating system: Macos 13.3

Prerequisite

Have a remote SSH server to connect yourself in.

Steps to Reproduce

  1. connect to the remote server via the "remote - ssh" extension
  2. going to extension
  3. impossible to install micromamba on the remote server (python and pylance can be installed on the remote)

More information on working with a remote server: https://code.visualstudio.com/docs/remote/ssh#_managing-extensions

Expected Behavior

Be able to install micromamba extension remotely to use environments on the remote server.

Actual Behavior

Micromamba functions with local environments and not with the remote ones, so it found nothing to match with remote projects.

does not work on Windows

It does not work at all with windows. With creating an Env. no list of possible types comes. I can not enter the name of the Env. Unusable

Windows 11
Powershell
Latest Micromamba

Add command to generate bootstrap and activate scripts

This is more of a feature request than a bug, feel free to close the issue if it falls outside the current scope.

Currently, when utilizing this extension and including the environment.yml file in a project, the user is restricted to controlling the environment solely within VSCode. It would be highly beneficial to have a command within the extension that generates a script enabling the initialization and activation of the virtual environment outside of the VSCode environment. This enhancement would greatly enhance flexibility and convenience for users.

Logs during micromamba env creation

First of all, this is an awesome extension to setup multiple micromamba env.

Just wondering, is there a way to view the logs/verbose scripts debug during the creation of environments?

  • It seems to fail without any obvious prompts when there are errors in the environment.yaml (unresolvable/wrong version setup etc)
  • And would (at times) take quite a bit of time during setup (perhaps due to mixing micromamba + various pip packages on my side)

Add possibility to configure micromamba path to vscode-micromamba

I was very excited to see that micromamba had a VS code extension but I have a major drawback - I already had micromamba installed in a custom path and all my environments in there, so I cannot use this extension! Is there a way to add some way of configuring this?

Publish `corker.vscode-micromamba` to Open VSX

Dear extension author,
Please publish this extension corker.vscode-micromamba to the Open VSX marketplace.

Context

Unfortunately, as Microsoft prohibits usages of the Microsoft marketplace by any other products or redistribution of .vsix files from it, in order to use VS Code extensions in non-Microsoft products, we kindly ask that you take ownership of the VS Code extension namespace in Open VSX and publish this extension on Open VSX.

What is Open VSX? Why does it exist?

Open VSX is a vendor neutral alternative to the MS marketplace used by most other derivatives of VS Code like VSCodium, Gitpod, OpenVSCode, Theia-based IDEs, and so on.

You can read on about Open VSX at the Eclipse Foundation's Open VSX FAQ.

How can you publish to Open VSX?

The docs to publish an extension can be found here. This process is straightforward and shouldn't take too long. Essentially, you need an authentication token and to execute the ovsx publish command to publish your extension. There's also a doc explaining the whole process with an example GitHub Action workflow.

Please add a feature that allows selecting the programming language version or selecting a personal template prepared in advance when creating a new environment.

Environment

  1. node -v: none
  2. npm -v: none
  3. Operating system: Windows 10 21H2 19044.1288

Prerequisite

Install this extension

Steps to Reproduce

1. Open the command palette (Ctrl+Shift+P)
2. Type - micromamba create environment
3. Choose a template from a list
4. The environment is activated automatically

Relevant Debug Info

none

Expected Behavior

1. Open the command palette (Ctrl+Shift+P)
2. Type - micromamba create environment
3. Choose a template from a list
4. Choose the programming language version
5. The environment is activated automatically

Or

1. Open the command palette (Ctrl+Shift+P)
2. Type - micromamba create environment
3. Choose a personal template prepared in advance
4. The environment is activated automatically

Actual Behavior

The environment automatically creates and downloads the latest programming language version


Please add support for MAMBA_ROOT_PREFIX

Environment

  1. node -v: --
  2. npm -v: --
  3. Operating system: Windows 10 Pro

Prerequisite

--

Steps to Reproduce

Micromamba: activate environment

Expected Behavior

"Micromamba: activate environment" should check if MAMBA_ROOT_PREFIX is set and use it

Actual Behavior

"Micromamba: create environment" needs to be used


Hi corker, I saw in #3 that you plan to work on this feature. Do you have a rough schedule of when you will have time for it? Unfortunately, I am not familiar with TypeScript, so I cannot help out with a pull request.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.