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 is an attempt to save the user a little typing when creating a new virtualenv or project. Instead of typing:
the user can just type:
> pew new -p 3.5.1 venv
I tried to be as unobtrusive as possible -- the new code should be completely backwards compatible. The old style is still supported, and it shouldn't break anything on Windows.
Unfortunately I wasn't able to simply call into Pythonz's functionality to find the path, because instead of returning the path as a string, it prints the path to STDOUT directly and returns None. Capturing STDOUT proved to be too messy and fragile, but the relevant code in Pythonz is short and straightforward, so I adapted it for this purpose in a new function,
locate_python_by_version
.I also added a few tests, trying to stick to the style of your existing tests.
Hopefully you agree that this is a useful feature. If you want me to revisit the implementation or find bugs/regressions, let me know.
Cheers, and thanks for making Pew!