-
Notifications
You must be signed in to change notification settings - Fork 414
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
Use py launcher to select Python interpreter #1002
Conversation
c97350b
to
0d3d6dd
Compare
0d3d6dd
to
a497ed7
Compare
e2d811e
to
fcbecfe
Compare
Some thoughts:
|
Hi @uranusjr, thanks so much for the feedback! I haven't used py launcher in Linux before, but I can investigate adding support for it as well. Could that be part of a follow-up PR? For the 2nd and 3rd points, I thought that your direction in the original issue was to avoid magic. The nice thing about the 2nd option would be that a single command could be used across platforms, but no magic is fine as well. |
The second point is mainly to maintain existing usages. We already support The UNIX launcher can be found here: https://github.com/brettcannon/python-launcher |
Hi team, is there anything else needed before we merge this? |
efad648
to
00f12fe
Compare
00f12fe
to
c22a19f
Compare
Thanks! |
Thanks team for your reviews and getting this merged, I think this will be a nice improvement to pipx! |
docs/changelog.md
Summary of changes
This PR closes #940 by adding support to use the py launcher to select the Python interpreter when the
--python
option is provided.The feature is used like
pipx install --python 3.10 cowsay
to install using the Python 3.10 interpreter. The only way to do this right now is by passing in the full path to the interpreter.I also did some refactoring in nearby code to leave the codebase in better shape than I found it.
Test plan
Tested by running
pipx install --python 3.100 cowsay
raises a FileNotFound error, which is similar to the behavior in Linux if you runpipx install --python python3.100 cowsay
.