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

feat: support Python version for --python arg when py launcher is n… #1343

Merged
merged 20 commits into from
Apr 27, 2024

Conversation

huxuan
Copy link
Member

@huxuan huxuan commented Apr 12, 2024

…ot available

  • I have added a news fragment under changelog.d/ (if the patch affects the end users)

Summary of changes

Close #1342

  1. Add find_python_command() to find python command according to provided python version.
  2. Add corresponding tests for pipx install and find_python_interpreter().

Test plan

Tested by running

# command(s) to exercise these changes
nox -s tests

BTW, I am a little confused about the fixture pipx_temp_env, seems shutil.which(python_command) will always return empty result when it is enabled. So I removed it in some related test cases. Please help me to double confirm whether it is used as expected.

@huxuan huxuan force-pushed the xuan.hu/find_command_python branch 2 times, most recently from f985999 to 82e9664 Compare April 16, 2024 06:00
@huxuan huxuan marked this pull request as ready for review April 16, 2024 06:24
@huxuan huxuan force-pushed the xuan.hu/find_command_python branch from 82e9664 to 1327a20 Compare April 17, 2024 01:00
src/pipx/interpreter.py Outdated Show resolved Hide resolved
src/pipx/interpreter.py Outdated Show resolved Hide resolved
src/pipx/interpreter.py Outdated Show resolved Hide resolved
src/pipx/main.py Outdated Show resolved Hide resolved
tests/test_install.py Show resolved Hide resolved
src/pipx/interpreter.py Outdated Show resolved Hide resolved
src/pipx/interpreter.py Outdated Show resolved Hide resolved
tests/test_install.py Outdated Show resolved Hide resolved
tests/test_install.py Outdated Show resolved Hide resolved
tests/test_interpreter.py Outdated Show resolved Hide resolved
@huxuan huxuan requested a review from chrysle April 18, 2024 18:32
@huxuan huxuan force-pushed the xuan.hu/find_command_python branch 2 times, most recently from 56ced5d to ec3f705 Compare April 19, 2024 23:00
tests/test_install.py Outdated Show resolved Hide resolved
tests/test_install.py Show resolved Hide resolved
tests/test_interpreter.py Show resolved Hide resolved
src/pipx/interpreter.py Outdated Show resolved Hide resolved
@huxuan huxuan force-pushed the xuan.hu/find_command_python branch from e721cc4 to b2ee495 Compare April 23, 2024 14:12
@huxuan huxuan requested a review from chrysle April 23, 2024 15:25
src/pipx/interpreter.py Outdated Show resolved Hide resolved
tests/test_install.py Show resolved Hide resolved
src/pipx/interpreter.py Outdated Show resolved Hide resolved
@huxuan huxuan force-pushed the xuan.hu/find_command_python branch 2 times, most recently from 83945ef to 2903daa Compare April 25, 2024 15:21
@huxuan huxuan force-pushed the xuan.hu/find_command_python branch from 2903daa to a2d98c3 Compare April 26, 2024 13:47
@dukecat0 dukecat0 merged commit c4f35c8 into pypa:main Apr 27, 2024
14 checks passed
@huxuan huxuan deleted the xuan.hu/find_command_python branch April 27, 2024 15:32
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.

Support Python version number for --python arg when py launcher is not available
3 participants