Option to stop initiating the reticulate environment as default Python interpreter until called by R
System details:
Windows 11
Positron and OS details:
Positron Version: 2024.09.0 (system setup) build 103 Code - OSS Version: 1.93.0 Commit: 8274fe26a1582fa0dd0096d6631b500f591416c4 Date: 2024-09-30T02:46:12.087Z Electron: 30.4.0 Chromium: 124.0.6367.243 Node.js: 20.15.1 V8: 12.4.254.20-electron.0 OS: Windows_NT x64 10.0.22631
Interpreter details:
R 4.4.1 Python 3.11.9
Describe the issue:
Currently, once a reticulate environment is used for one project, subsequent Positron sessions automatically initiates the reticulate environment before it is being called by R.
Steps to reproduce the issue:
- Open a folder.
- Run
reticulate::py_eval("print('hi')"). - Note that reticulate environment has been initiated.
- Switch to another folder.
- Switch back to the previous folder.
- Python (reticulate) is chosen as the default Python interpreter and initiated without being called by R.
Expected or desired behavior:
In my workflow, I wish to manually specify which python environment to use for my reticulate session through my R code. I hope there is a global option to opt out of this auto-starting feature of reticulate, while giving the user a project-based option to set a default reticulate environment to be automatically activated when booting, as suggested in https://github.com/posit-dev/positron/issues/2317.
Were there any error messages in the UI, Output panel, or Developer Tools console?
No
This is an interesting use case! Thank you for filing it. I'll flag this for further triage.
Implementation note: I think this would be pretty easy to do by creating a new runtime startup behavior category for runtimes that should not ever start automatically (i.e. should not saved as the affiliated interpreter)
https://github.com/posit-dev/positron/blob/20a2eacb0ea8ee1ff7d1942c5b45afb381b2139f/src/vs/workbench/services/languageRuntime/common/languageRuntimeService.ts#L507-L524
Verified Fixed
Positron Version(s) : 2024.11.0-60
OS Version : OSX
Test scenario(s)
Verified that reticulate will not auto start even if its the last interpreter used before shutdown.
Link(s) to TestRail test cases run or created: