You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We can get the value of the python.defaultInterpreterPath setting either from PythonSettings.pythonPath or IInterpreterPathService.get (which I think is used to set pythonPath).
One challenge is how to determine whether the result of interpreterSelector.getRecommendedSuggestion should be ignored in favor of defaultInterpreterPath. They should be doing something similar upstream so there should be a solution.
The text was updated successfully, but these errors were encountered:
Adding this to #6202, as we intend to document python.defaultInterpreterPath for Workbench admins as the method to set a default interpreter for users.
Adds in a selection process for implicitly or immediately starting a
runtime before discovery in `recommendWorkspaceRuntime()`. The hope here
is that, if there is a local env or a user-defined environment we know
about _before_ discovery, we can automatically select it.
### Release Notes
<!--
Optionally, replace `N/A` with text to be included in the next release
notes.
The `N/A` bullets are ignored. If you refer to one or more Positron
issues,
these issues are used to collect information about the feature or
bugfix, such
as the relevant language pack as determined by Github labels of type
`lang: `.
The note will automatically be tagged with the language.
These notes are typically filled by the Positron team. If you are an
external
contributor, you may ignore this section.
-->
#### New Features
- #6281
- #6204
#### Bug Fixes
- N/A
### QA Notes
<!--
Add additional information for QA on how to validate the change,
paying special attention to the level of risk, adjacent areas that
could be affected by the change, and any important contextual
information not present in the linked issues.
-->
I have a few scenarios highlighted and what is expected. Since this part
of the codebase cares a lot about past selections, I'd highly recommend
clearing state and then restoring settings by running:
```
rm -rf ~/.vscode-oss-dev/;
rm -rf ~/.positron-dev;
mkdir -p ~/.vscode-oss-dev/User;
touch ~/.vscode-oss-dev/User/settings.json;
echo '{"python.defaultInterpreterPath": "PATH TO SOME PYTHON"}' > ~/.vscode-oss-dev/User/settings.json
```
| scenario | expected |
|
-------------------------------------------------------------------------------------------------------------------------------------
| ---------------------------------------------------------- |
| in workspace:<br>has .venv<br>has user level defaultInterpreterPath
set | .venv<br>immediate startup |
| in workspace:<br>had active runtime when Positron shut down<br>has
user level defaultInterpreterPath | previous active runtime<br>immediate
startup<br> |
| in workspace:<br>brand new, no affiliated runtime<br>has user level
defaultInterpreterPath set | user level
defaultInterpreterPath<br>implicit startup |
| in workspace:<br>no affiliated runtime<br>has workspace level
defaultInterpreterPath set<br>has user level defaultInterpreterPath set
| workspace level defaultInterpreterPath<br>implicit startup |
| no workspace:<br>has user level defaultInterpreterPath set | user
level defaultInterpreterPath<br>implicit startup |
---------
Signed-off-by: Isabel Zimmerman <[email protected]>
Co-authored-by: Wasim Lorgat <[email protected]>
Co-authored-by: sharon <[email protected]>
We don't currently respect the
python.defaultInterpreterPath
setting (see upstream description):IInterpreterPathService.onDidChange
event).The logic for our initial interpreter selection is here:
positron/extensions/positron-python/src/client/positron/discoverer.ts
Lines 42 to 47 in 1edb801
We can get the value of the
python.defaultInterpreterPath
setting either fromPythonSettings.pythonPath
orIInterpreterPathService.get
(which I think is used to setpythonPath
).One challenge is how to determine whether the result of
interpreterSelector.getRecommendedSuggestion
should be ignored in favor ofdefaultInterpreterPath
. They should be doing something similar upstream so there should be a solution.The text was updated successfully, but these errors were encountered: