poetry
poetry copied to clipboard
Use py.exe to find python on Windows
On Windows, python installs the py.exe launcher as a reliable way to find a given installed version of python.
This PR adds the possibillity to specify a python version (e.g. poetry env use 3.10
) on Windows.
We tried this once, I do not recall if it was merged and reverted or simply never merged. The takeaway was that pythonfinder or something similar (pure Python) should be used instead of py.exe
which really designed for our use case.
cc @finswimmer @abn
Fixes #3520. Related to #5778.
I'm really not sure what is bad about calling py.exe
, since poetry env use
already calls python
using a subprocess. I only changed the name of the called executable.
I'm not against the use of pythonfinder
, but imho, this solution is just simpler.
Also related to #4217.
The prior PR for this approach that I could find is #4217. The comments seem to cover the main concerns with this approach, and was closed in favour of a pythonfinder-based approach, which appeared in #5778 but apparently never went anywhere.