posit-dev / positron

Positron, a next-generation data science IDE
https://positron.posit.co
Other
2.82k stars 91 forks source link

Workbench: Positron new Project cannot use Python versions not on the path? #5341

Open jthomasmock opened 1 week ago

jthomasmock commented 1 week ago

System details:

Positron and OS details:

Positron Version: 2024.11.0 build 140 Code - OSS Version: 1.93.0 Commit: e0d844b031f95acbf89f234a2cce2af9b6721f6c Date: 2024-10-31T14:13:54.986Z Browser: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36

Interpreter details:

Python 3.12.4

Describe the issue:

On a Workbench server that doesn't have Python on the PATH, try to create a new Project with a version of Python in /opt/python but not on PATH. Note that the versions in /opt/python are not discovered

Image

Steps to reproduce the issue:

1. 2.

Expected or desired behavior:

Were there any error messages in the UI, Output panel, or Developer Tools console?

sharon-wang commented 6 days ago

This is related to https://github.com/posit-dev/positron/issues/4270. The Project Wizard only includes Pyenv and Global interpreters in this dropdown. I think Python versions not on the PATH have runtime source Unknown, which is not included in this dropdown.

https://github.com/posit-dev/positron/blob/0108e5002265f3b1dbbfcd3c4468f01de1f9ab0b/src/vs/workbench/browser/positronNewProjectWizard/interfaces/newProjectWizardEnums.ts#L39-L45

We probably want to create a new command in the Python extension that checks if a given interpreter path is for a global Python installation, and display the interpreter in the Project Wizard interpreter dropdown based on the result. We currently make the runtime filtering decision in the Project Wizard, which currently only recognizes Pyenv and Global runtime sources as "Global" python installations.