Skip to content

Conversation

@hguandl
Copy link

@hguandl hguandl commented Dec 18, 2024

Attempt to support #20919.

Currently, vscode-python can partially support micromamba with the following settings:

python.condaPath: "/usr/local/bin/micromamba"
python.locator: "native"

The extension can recognize the environments, however, it fails to activate the environment properly. This PR adds the activation script for micromamba, which is a self-contained executable and does not have the base environment.

Example
Suppose there is an environment named foo. The micromamba executable is located at /usr/local/bin/micromamba.

  • Current behavior: source /usr/local/bin/activate foo;
  • Expected behavior: micromamba activate foo.

Caveats
It is difficult to check whether the executable is micromamba, as there is no deterministic API available. Currently, the implementation relies solely on checking the executable's name.

Tested on macOS (zsh) and Windows (PowerShell).

@hguandl
Copy link
Author

hguandl commented Dec 18, 2024

@microsoft-github-policy-service agree

@karthiknadig
Copy link
Member

Thanks for the PR. I will take a look.

Just FYI, if you want to provide a fully featured support for micromamba consider using https://github.com/microsoft/vscode-python-environments extension API to build a micromamba extension.

@karthiknadig karthiknadig self-assigned this Dec 18, 2024
@karthiknadig karthiknadig added the feature-request Request for new features or functionality label Dec 18, 2024
@karthiknadig karthiknadig self-requested a review December 18, 2024 16:27
@karthiknadig
Copy link
Member

I think this feature should be moved into https://github.com/microsoft/vscode-python-environments extension, where this could be handled better. Or it can be an independent extension providing full features micromamba support (using env and package manage APIs from the environments extension), which could include shipping it in the box. Either way, I will be closing this PR here, since the activation features here will be moved to different location.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature-request Request for new features or functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants