8000 GH-80789: Bundle ``ensurepip`` wheels at build time by AA-Turner · Pull Request #109130 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

GH-80789: Bundle ensurepip wheels at build time #109130

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

Closed
wants to merge 12 commits into from
Prev Previous commit
Next Next commit
Changes from first review
  • Loading branch information
AA-Turner committed Sep 9, 2023
commit ccaad2decfa4368dbcaeb70805d91102c5a760bb
2 changes: 1 addition & 1 deletion Doc/whatsnew/3.13.rst
Original file line number Diff line number Diff line change
Expand Up @@ -862,7 +862,7 @@ Build Changes

* Wheels for :mod:`ensurepip` are no longer bundled in the CPython source
tree. Distributors should bundle these as part of the build process by
running :file:`Tools/build/verify_ensurepip_wheels.py`.
running :file:`Tools/build/bundle_ensurepip_wheels.py`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would probably be clearer:

Suggested change
running :file:`Tools/build/bundle_ensurepip_wheels.py`.
running :file:`Tools/build/bundle_ensurepip_wheels.py` with no arguments.



C API Changes
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Replaced vendored ``pip`` wheels for :mod:`ensurepip` with a new bundler script,
:file:`Tools/build/verify_ensurepip_wheels.py`, to be run by distributors.
:file:`Tools/build/bundle_ensurepip_wheels.py`, to be run by distributors.
4 changes: 2 additions & 2 deletions Tools/build/bundle_ensurepip_wheels.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python3

"""
Download wheels for :mod:`ensurepip` packages from the Cheeseshop.
Download wheels for 'ensurepip' packages from PyPI.

When GitHub Actions executes the script, output is formatted accordingly.
https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-a-notice-message
Expand Down Expand Up @@ -42,7 +42,7 @@ def download_wheels() -> int:
try:
projects = _get_projects()
except (AttributeError, TypeError):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there's an abstraction leak here: it's hard to guess from looking at the _get_projects() function, what in it might trigger these exceptions. I'd recommend processing them inside that function and making obvious such places where the exceptions may occur. Instead, I'd convert both of the exceptions into something like an ImportError and handle just that. This would contribute to transparency of how that function works.

print_error("Could not find '_PROJECTS' in {ENSURE_PIP_INIT}.")
print_error(f"Could not find '_PROJECTS' in {ENSURE_PIP_INIT}.")
return 1

errors = 0
Expand Down
0