Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix global python interpreter filtering in Project Wizard #5502

Merged
merged 4 commits into from
Nov 26, 2024

Conversation

sharon-wang
Copy link
Member

@sharon-wang sharon-wang commented Nov 25, 2024

Addresses

Implementation

  • add new command python.isGlobalPython to the Python extension
    • Given a python interpreter path, return whether it is a global python interpreter
  • remove RuntimeFilter, PythonRuntimeFilter and runtimeSource filtering logic from the Project Wizard, which would require an update to the appropriate enum every time we want to recognize a specific runtimeSource as a permitted "Global Python"
  • rework _getFilteredInterpreters() to return all interpreters, only global interpreters, or undefined depending on the current state of the project wizard
  • add/update log messages in the Project Wizard state handling methods

QA Notes

On Windows, MicrosoftStore-installed Python versions should now show in the Project Wizard interpreter dropdown when creating a new Venv.

image

On other operating systems, Global, Pyenv, Unknown and any other "Global" Python installations should show in the Project Wizard interpreter dropdown when creating a new Venv.

image

Given a python interpreter path, return whether it is a global python interpreter.
...to filter the list of available Global Python interpreters which can be used to create a new Venv environment.
@sharon-wang sharon-wang requested a review from seeM November 25, 2024 23:04
Copy link
Contributor

@seeM seeM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code changes look good! I haven't been able to test the behavior on macOS because of another issue below, you could have someone else test on this branch or have it QA'd after merge.


I'm seeing a weird issue where the interpreter dropdown doesn't work when I've selected venv. It happens on the latest release for me as well so it is probably unrelated. Here's a video. Any idea what's happening here? Maybe it's a weird Python env on my laptop?

Screen.Recording.2024-11-26.at.11.55.45.mov

@sharon-wang
Copy link
Member Author

I was able to reproduce and I think this could be related to #3061. Posted a comment over there with some recordings!

If you move the Project Wizard closer to the top of the screen and click the dropdown, does it show then? If you have a lot of interpreters paired with not enough vertical space, I think that's when this issue occurs.

@seeM
Copy link
Contributor

seeM commented Nov 26, 2024

@sharon-wang ah yes that moving the modal does fix the dropdown for me, great catch!

image

@sharon-wang sharon-wang merged commit 150ef81 into main Nov 26, 2024
24 checks passed
@sharon-wang sharon-wang deleted the project-wizard/python-interpreter-filtering branch November 26, 2024 15:47
@github-actions github-actions bot locked and limited conversation to collaborators Nov 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants