Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add activation command for micromamba #24635

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

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
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