uses python-finder during env activate #5778
Closed
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.
Pull Request Check List
Resolves #3520
While resolving for python versions in the PATH, python-finder executes a python command to get the python version. It will execute the command for every supported python implementation in the path until it finds the right one.
On windows, pythons registered per pep-514 take priority over path pythons. When checking registered pythons, it does not execute the version command. It does succeed in finding pythons installed through the MS Store (they are in the path). Py.exe also prefers registered pythons over MS Store pythons, so the behavior here is consistent. To be clear this doesn't use py.exe. pyenv-win creates a python.bat shim in the path. The bat files are recognized as other pythons in the path so it just works.
I added an experimental flag to enable or disable the python-finder.
I haven't tested this with linux but I figured the implementation wouldn't change much so creating the draft PR. I also expected to just work since python-finder covers this testing.