microsoft / microsoft/vscode-python-environments

Python Extension and Python Environment Extension both activate when `python.useEnvironmentsExtension` defaults to false

Open
#1,778 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

triage-needed
Dominant language
TypeScript
Stars
138
Forks
62
Avg merge
1d 4h
Merged PRs (30d)
35

Description

## Environment data

## Repro Steps

* Install the Python extension
* Install the Python environment extension
* Set the user configuration to:

```json
"workbench.enableExperiments": false,
"python.experiments.enabled": false
```

Reload the window

## Expected behavior

* The Python and Python environment extension agree on which extension is responsible for managing environments

## Actual behavior

* Both extensions activate
* I see two Python selectors
* The `Select Python Environment` selector from the Python Environment extension is missing

Image

## Additional context

The Python Environment Extension uses `inspect` to decide whether `useEnvironmentsExtension` is set to false, but this does not take into account a default value.

The `when` condition of the Command Palette entry uses `when`, which takes default values into account

The Python Extension uses `get`, which takes default values into account

This came up in https://github.com/astral-sh/ty-vscode/issues/551 because it's now unclear which extension ty should consider as being authoritative when it comes to selecting an environment.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the Python Environment Extension’s configuration inspection and activation logic, then compare it with the Python Extension’s default-aware get behavior and the Command Palette when condition. Reproduce with both extensions installed and experiments disabled; done means the extensions agree on environment ownership and only the expected selector is shown.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, typescript, vscode
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.