-
Notifications
You must be signed in to change notification settings - Fork 417
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[feature] Download/use standalone python build when chose --python ve…
…rsion doesn't exist (#1243) * set up cache dir for standalone pythons to live in * adapt yen's downloader / unpacker implementation to work well in pipx's codebase * idempotent downloader function to download any desired major/minor python version available * update `find_python_interpreter` to download the correct python version if it's not available on user's system * add `--fetch-missing-python` flag to relevant commands * add `PIPX_FETCH_MISSING_PYTHON` environment variable * refactor `download_python_build_standalone` to automatically cleanup temp files in case of errors * add news update for new feature * add "fetch missing" unit tests for unix and (hopefully) windows * improve error messaging for python-standalone errors * remove hard-coded version numbers from interpreter unit tests * Apply suggestions from code review, fixup unit tests Co-authored-by: chrysle <[email protected]> * implement changes requested by chrysle * implement changes requested by gitznik, fixup unit tests * group and de-duplicate python cli args * refactor unit tests, mock out github API response * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * add unit test for python_standalone failure mode * refactor unit tests, remove need to derive target python version * de-duplicate unit test Co-authored-by: chrysle <[email protected]> --------- Co-authored-by: chrysle <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: chrysle <[email protected]>
- Loading branch information
1 parent
c2df428
commit 407b797
Showing
8 changed files
with
326 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Add a `--fetch-missing-python` flag to all commands that accept a `--python` flag. | ||
|
||
When combined, this will automatically download a standalone copy of the requested python version if it's not already available on the user's system. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.