feat!: environment aware python installations #1290
Draft
+94
−4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Leverages the
ms-python.pythonextension and its node APIin 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 interpretervia 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
pipInstallwithinstallPythonPackagethings 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-extensionrequires bumping the minimum vscode engine and types to ^1.78.0.Outdated vscode installations will not work anymore!
Fixes #1273