Fixes installing versions with pyenv-win #4949
Merged
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.
This fixes #4525
This issue has two parts:
pipenv
callspipenv-win.bat
as mentioned by @uranusjr here.pyenv-win
not supporting the-s/--skip-existing
flags whilepyenv
does, as mentioned by @i3v here. Luckily this is done automatically inpyenv-win
, and it does not ask for user input which I guess it's why it was added in the first place. I initially opened a PR inpyenv-win
to add support for it but then realized more differences between the original vs the Windows versions which made me finally close it and go for this path.To fix it, I have ensured that
shell=True
is passed tosubprocess_run
when running the pyenv install code under Windows, and I've removed the-s
from thepyenv install -s <version>
command under the same conditions, since the final behaviour will be the same (no prompts and skip installation if it already exists).My local tests, on Windows 10 and Ubuntu 20.04:
Test Pipfile:
pipenv output (with
PIPENV_YES=1
)Windows 10
Ubuntu 20.04
Thank you very much for your time, I'll be happy to change/update things if required 😄