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

Pathfinder #101

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Pathfinder #101

wants to merge 2 commits into from

Conversation

hoganld
Copy link

@hoganld hoganld commented Mar 3, 2016

This is an attempt to save the user a little typing when creating a new virtualenv or project. Instead of typing:

> pew new -p $(pew locate_python 3.5.1) venv

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant