Skip to content

Conversation

@gnikit
Copy link
Member

@gnikit gnikit commented Jan 7, 2026

Leverages the ms-python.python extension and its node API
in order to softly detect if the extension is present.
If present it will activate it, search for the "correct" environment
and install the package there.

The choice of the environment is purely dependant on the rules
imposed in ms-python.python. The user can select an interpreter
via the the command palette, but this is a suboptimal Fortran user
experience, since detection and messages about missing fortls
pop up before the user can do that (realistically at least).

In addition, changes in Python environments are not propagated.
Watch events need to be added and detection/installation/execution
needs be redone in such cases.

This only takes care of the installation process but does nothing
for the detection/execution of the binaries. Consequently, if replacing
naively pipInstall with installPythonPackage things will fail.

The detection, execution and installation need to me rewritten
in a cohesive way without duplication.
Paths need to be cached and resolve wrt user inputs from the configs.

For multi-root workspaces, with different Python environments this
could trigger a cascade of installs, which might or might not be the
intended behaviour.

BREAKING CHANGE: using @vscode/python-extension requires bumping the minimum vscode engine and types to ^1.78.0.

Outdated vscode installations will not work anymore!

Fixes #1273

Leverages the `ms-python.python` extension and its node API
in order to softly detect if the extension is present.
If present it will activate it, search for the "correct" environment
and install the package there.

The choice of the environment is purely dependant on the rules
imposed in `ms-python.python`. The user can select an interpreter
via the the command palette, but this is a suboptimal Fortran user
experience, since detection and messages about missing fortls
pop up before the user can do that (realistically at least).

In addition, changes in Python environments are not propagated.
Watch events need to be added and detection/installation/execution
needs be redone in such cases.

This only takes care of the installation process but does nothing
for the detection/execution of the binaries. Consequently, if replacing
naively `pipInstall` with `installPythonPackage` things will fail.

The detection, execution and installation need to me rewritten
in a cohesive way without duplication.
Paths need to be cached and resolve wrt user inputs from the configs.

For multi-root workspaces, with different Python environments this
could trigger a cascade of installs, which might or might not be the
intended behaviour.

BREAKING CHANGE: using `@vscode/python-extension` requires bumping the minimum vscode engine and types to ^1.78.0.

Outdated vscode installations will not work anymore!

Fixes #1273
@codecov
Copy link

codecov bot commented Jan 7, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.65%. Comparing base (8538da3) to head (0b31beb).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1290   +/-   ##
=======================================
  Coverage   81.65%   81.65%           
=======================================
  Files          13       13           
  Lines        2436     2437    +1     
  Branches      202      202           
=======================================
+ Hits         1989     1990    +1     
  Misses        442      442           
  Partials        5        5           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: better handling of Python packages and environments

2 participants