-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
Replace bundled pip and setuptools with a downloader in the ensurepip module #80789
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
Comments
Hi, I've noticed that there's an idea to not pollute Git tree with vendored blobs. In particular, Such a wish was expressed here: https://bugs.python.org/issue35277#msg330098 So I thought I'd take a stab at it... |
ensurepip does not access the network, by design. We do not want it to start access the network without a lot of discussion. And if it does access the network, it will need to be able to use alternate URLs. For example: where I deploy Python, it would not have access to the URLs in your PR, but instead would need to specify a different (internal) location. This is the same reason that pip install has --find-links, --no-index, --extra-index-url, etc. I think this would need a lot of discussion (probably on distutils-sig), and probably a PEP. |
And I don't mean to sound like a total downer. I just think it's important that we recognize all of the use cases. Thanks for your work on this. |
(Not sure how the Roundup handles email replies but I'm hoping this goes to I think it would be better if the downloading got invoked during the Functionally, I imagine having all the download logic in some sort of On Fri, 12 Apr 2019 at 8:54 PM, Eric V. Smith <[email protected]>
|
I proposed to move bundled pip and setuptools to the external repository and download them at build time like Tcl and other dependencies on Windows. |
Thanks for the feedback! I've changed it a bit to have a separate command for downloading bundles to the source tree. It'd work as in Does it sound better now? |
Prior to this patch, Pip wheels were stored in the Git repository of CPython. Git is optimized for text but these artifacts are binary. So the unpleasant side effect of doing this is that the bare Git repository size is being increased by the zip archive side every time it is added, removed or modified. It's time to put a stop to this. The patch implements an `ensurepip.bundle` module that is meant to be called through `runpy` to download the Pip wheel and place it into the same location as before. It removes the wheel file from the Git repository and prevents re-adding it by defining a new `.gitignore` configuration file. The idea is that the builders of CPython are supposed to invoke the following command during the build time: ```console $ python -m ensurepip.bundle ``` This command will verify the existing wheel's SHA-256 hash and, if it does not match, or doesn't exist, it will proceed to download the artifact from PyPI. It will confirm its SHA-256 hash before placing it into the `Lib/ensurepip/_bundled/` directory. Every single line added or modified as a part of this change is also covered with tests. Every new module has 100% coverage. The only uncovered lines under `Lib/ensurepip/` are the ones that are absolutely unrelated to this effort. Resolves python#80789. Ref: https://bugs.python.org/issue36608.
Prior to this patch, Pip wheels were stored in the Git repository of CPython. Git is optimized for text but these artifacts are binary. So the unpleasant side effect of doing this is that the bare Git repository size is being increased by the zip archive side every time it is added, removed or modified. It's time to put a stop to this. The patch implements an `ensurepip.bundle` module that is meant to be called through `runpy` to download the Pip wheel and place it into the same location as before. It removes the wheel file from the Git repository and prevents re-adding it by defining a new `.gitignore` configuration file. The idea is that the builders of CPython are supposed to invoke the following command during the build time: ```console $ python -m ensurepip.bundle ``` This command will verify the existing wheel's SHA-256 hash and, if it does not match, or doesn't exist, it will proceed to download the artifact from PyPI. It will confirm its SHA-256 hash before placing it into the `Lib/ensurepip/_bundled/` directory. Every single line added or modified as a part of this change is also covered with tests. Every new module has 100% coverage. The only uncovered lines under `Lib/ensurepip/` are the ones that are absolutely unrelated to this effort. Resolves python#80789. Ref: https://bugs.python.org/issue36608.
Prior to this patch, Pip wheels were stored in the Git repository of CPython. Git is optimized for text but these artifacts are binary. So the unpleasant side effect of doing this is that the bare Git repository size is being increased by the zip archive side every time it is added, removed or modified. It's time to put a stop to this. The patch implements an `ensurepip.bundle` module that is meant to be called through `runpy` to download the Pip wheel and place it into the same location as before. It removes the wheel file from the Git repository and prevents re-adding it by defining a new `.gitignore` configuration file. The idea is that the builders of CPython are supposed to invoke the following command during the build time: ```console $ python -m ensurepip.bundle ``` This command will verify the existing wheel's SHA-256 hash and, if it does not match, or doesn't exist, it will proceed to download the artifact from PyPI. It will confirm its SHA-256 hash before placing it into the `Lib/ensurepip/_bundled/` directory. Every single line added or modified as a part of this change is also covered with tests. Every new module has 100% coverage. The only uncovered lines under `Lib/ensurepip/` are the ones that are absolutely unrelated to this effort. Resolves python#80789. Ref: https://bugs.python.org/issue36608.
Prior to this patch, Pip wheels were stored in the Git repository of CPython. Git is optimized for text but these artifacts are binary. So the unpleasant side effect of doing this is that the bare Git repository size is being increased by the zip archive side every time it is added, removed or modified. It's time to put a stop to this. The patch implements an `ensurepip.bundle` module that is meant to be called through `runpy` to download the Pip wheel and place it into the same location as before. It removes the wheel file from the Git repository and prevents re-adding it by defining a new `.gitignore` configuration file. The idea is that the builders of CPython are supposed to invoke the following command during the build time: ```console $ python -m ensurepip.bundle ``` This command will verify the existing wheel's SHA-256 hash and, if it does not match, or doesn't exist, it will proceed to download the artifact from PyPI. It will confirm its SHA-256 hash before placing it into the `Lib/ensurepip/_bundled/` directory. Every single line added or modified as a part of this change is also covered with tests. Every new module has 100% coverage. The only uncovered lines under `Lib/ensurepip/` are the ones that are absolutely unrelated to this effort. Resolves python#80789. Ref: https://bugs.python.org/issue36608.
Prior to this patch, Pip wheels were stored in the Git repository of CPython. Git is optimized for text but these artifacts are binary. So the unpleasant side effect of doing this is that the bare Git repository size is being increased by the zip archive side every time it is added, removed or modified. It's time to put a stop to this. The patch implements an `ensurepip.bundle` module that is meant to be called through `runpy` to download the Pip wheel and place it into the same location as before. It removes the wheel file from the Git repository and prevents re-adding it by defining a new `.gitignore` configuration file. The idea is that the builders of CPython are supposed to invoke the following command during the build time: ```console $ python -m ensurepip.bundle ``` This command will verify the existing wheel's SHA-256 hash and, if it does not match, or doesn't exist, it will proceed to download the artifact from PyPI. It will confirm its SHA-256 hash before placing it into the `Lib/ensurepip/_bundled/` directory. Every single line added or modified as a part of this change is also covered with tests. Every new module has 100% coverage. The only uncovered lines under `Lib/ensurepip/` are the ones that are absolutely unrelated to this effort. Resolves python#80789. Ref: https://bugs.python.org/issue36608.
Prior to this patch, Pip wheels were stored in the Git repository of CPython. Git is optimized for text but these artifacts are binary. So the unpleasant side effect of doing this is that the bare Git repository size is being increased by the zip archive side every time it is added, removed or modified. It's time to put a stop to this. The patch implements an `ensurepip.bundle` module that is meant to be called through `runpy` to download the Pip wheel and place it into the same location as before. It removes the wheel file from the Git repository and prevents re-adding it by defining a new `.gitignore` configuration file. The idea is that the builders of CPython are supposed to invoke the following command during the build time: ```console $ python -m ensurepip.bundle ``` This command will verify the existing wheel's SHA-256 hash and, if it does not match, or doesn't exist, it will proceed to download the artifact from PyPI. It will confirm its SHA-256 hash before placing it into the `Lib/ensurepip/_bundled/` directory. Every single line added or modified as a part of this change is also covered with tests. Every new module has 100% coverage. The only uncovered lines under `Lib/ensurepip/` are the ones that are absolutely unrelated to this effort. Resolves python#80789. Ref: https://bugs.python.org/issue36608.
Prior to this patch, Pip wheels were stored in the Git repository of CPython. Git is optimized for text but these artifacts are binary. So the unpleasant side effect of doing this is that the bare Git repository size is being increased by the zip archive side every time it is added, removed or modified. It's time to put a stop to this. The patch implements an `ensurepip.bundle` module that is meant to be called through `runpy` to download the Pip wheel and place it into the same location as before. It removes the wheel file from the Git repository and prevents re-adding it by defining a new `.gitignore` configuration file. The idea is that the builders of CPython are supposed to invoke the following command during the build time: ```console $ python -m ensurepip.bundle ``` This command will verify the existing wheel's SHA-256 hash and, if it does not match, or doesn't exist, it will proceed to download the artifact from PyPI. It will confirm its SHA-256 hash before placing it into the `Lib/ensurepip/_bundled/` directory. Every single line added or modified as a part of this change is also covered with tests. Every new module has 100% coverage. The only uncovered lines under `Lib/ensurepip/` are the ones that are absolutely unrelated to this effort. Resolves python#80789. Ref: https://bugs.python.org/issue36608.
Prior to this patch, Pip wheels were stored in the Git repository of CPython. Git is optimized for text but these artifacts are binary. So the unpleasant side effect of doing this is that the bare Git repository size is being increased by the zip archive side every time it is added, removed or modified. It's time to put a stop to this. The patch implements an `ensurepip.bundle` module that is meant to be called through `runpy` to download the Pip wheel and place it into the same location as before. It removes the wheel file from the Git repository and prevents re-adding it by defining a new `.gitignore` configuration file. The idea is that the builders of CPython are supposed to invoke the following command during the build time: ```console $ python -m ensurepip.bundle ``` This command will verify the existing wheel's SHA-256 hash and, if it does not match, or doesn't exist, it will proceed to download the artifact from PyPI. It will confirm its SHA-256 hash before placing it into the `Lib/ensurepip/_bundled/` directory. Every single line added or modified as a part of this change is also covered with tests. Every new module has 100% coverage. The only uncovered lines under `Lib/ensurepip/` are the ones that are absolutely unrelated to this effort. Resolves python#80789. Ref: https://bugs.python.org/issue36608.
Prior to this patch, Pip wheels were stored in the Git repository of CPython. Git is optimized for text but these artifacts are binary. So the unpleasant side effect of doing this is that the bare Git repository size is being increased by the zip archive side every time it is added, removed or modified. It's time to put a stop to this. The patch implements an `ensurepip.bundle` module that is meant to be called through `runpy` to download the Pip wheel and place it into the same location as before. It removes the wheel file from the Git repository and prevents re-adding it by defining a new `.gitignore` configuration file. The idea is that the builders of CPython are supposed to invoke the following command during the build time: ```console $ python -m ensurepip.bundle ``` This command will verify the existing wheel's SHA-256 hash and, if it does not match, or doesn't exist, it will proceed to download the artifact from PyPI. It will confirm its SHA-256 hash before placing it into the `Lib/ensurepip/_bundled/` directory. Every single line added or modified as a part of this change is also covered with tests. Every new module has 100% coverage. The only uncovered lines under `Lib/ensurepip/` are the ones that are absolutely unrelated to this effort. Resolves python#80789. Ref: https://bugs.python.org/issue36608.
Prior to this patch, Pip wheels were stored in the Git repository of CPython. Git is optimized for text but these artifacts are binary. So the unpleasant side effect of doing this is that the bare Git repository size is being increased by the zip archive side every time it is added, removed or modified. It's time to put a stop to this. The patch implements an `ensurepip.bundle` module that is meant to be called through `runpy` to download the Pip wheel and place it into the same location as before. It removes the wheel file from the Git repository and prevents re-adding it by defining a new `.gitignore` configuration file. The idea is that the builders of CPython are supposed to invoke the following command during the build time: ```console $ python -m ensurepip.bundle ``` This command will verify the existing wheel's SHA-256 hash and, if it does not match, or doesn't exist, it will proceed to download the artifact from PyPI. It will confirm its SHA-256 hash before placing it into the `Lib/ensurepip/_bundled/` directory. Every single line added or modified as a part of this change is also covered with tests. Every new module has 100% coverage. The only uncovered lines under `Lib/ensurepip/` are the ones that are absolutely unrelated to this effort. Resolves python#80789. Ref: https://bugs.python.org/issue36608.
Prior to this patch, Pip wheels were stored in the Git repository of CPython. Git is optimized for text but these artifacts are binary. So the unpleasant side effect of doing this is that the bare Git repository size is being increased by the zip archive side every time it is added, removed or modified. It's time to put a stop to this. The patch implements an `ensurepip.bundle` module that is meant to be called through `runpy` to download the Pip wheel and place it into the same location as before. It removes the wheel file from the Git repository and prevents re-adding it by defining a new `.gitignore` configuration file. The idea is that the builders of CPython are supposed to invoke the following command during the build time: ```console $ python -m ensurepip.bundle ``` This command will verify the existing wheel's SHA-256 hash and, if it does not match, or doesn't exist, it will proceed to download the artifact from PyPI. It will confirm its SHA-256 hash before placing it into the `Lib/ensurepip/_bundled/` directory. Every single line added or modified as a part of this change is also covered with tests. Every new module has 100% coverage. The only uncovered lines under `Lib/ensurepip/` are the ones that are absolutely unrelated to this effort. Resolves python#80789. Ref: https://bugs.python.org/issue36608.
Prior to this patch, Pip wheels were stored in the Git repository of CPython. Git is optimized for text but these artifacts are binary. So the unpleasant side effect of doing this is that the bare Git repository size is being increased by the zip archive side every time it is added, removed or modified. It's time to put a stop to this. The patch implements an `ensurepip.bundle` module that is meant to be called through `runpy` to download the Pip wheel and place it into the same location as before. It removes the wheel file from the Git repository and prevents re-adding it by defining a new `.gitignore` configuration file. The idea is that the builders of CPython are supposed to invoke the following command during the build time: ```console $ python -m ensurepip.bundle ``` This command will verify the existing wheel's SHA-256 hash and, if it does not match, or doesn't exist, it will proceed to download the artifact from PyPI. It will confirm its SHA-256 hash before placing it into the `Lib/ensurepip/_bundled/` directory. Every single line added or modified as a part of this change is also covered with tests. Every new module has 100% coverage. The only uncovered lines under `Lib/ensurepip/` are the ones that are absolutely unrelated to this effort. Resolves python#80789. Ref: https://bugs.python.org/issue36608.
Folks, I revamped the PR and need some help with the build process integration here: https://github.com/python/cpython/pull/12791/files#r1306308587. Could anybody take a look? |
Prior to this patch, Pip wheels were stored in the Git repository of CPython. Git is optimized for text but these artifacts are binary. So the unpleasant side effect of doing this is that the bare Git repository size is being increased by the zip archive side every time it is added, removed or modified. It's time to put a stop to this. The patch implements an `ensurepip.bundle` module that is meant to be called through `runpy` to download the Pip wheel and place it into the same location as before. It removes the wheel file from the Git repository and prevents re-adding it by defining a new `.gitignore` configuration file. The idea is that the builders of CPython are supposed to invoke the following command during the build time: ```console $ python -m ensurepip.bundle ``` This command will verify the existing wheel's SHA-256 hash and, if it does not match, or doesn't exist, it will proceed to download the artifact from PyPI. It will confirm its SHA-256 hash before placing it into the `Lib/ensurepip/_bundled/` directory. Every single line added or modified as a part of this change is also covered with tests. Every new module has 100% coverage. The only uncovered lines under `Lib/ensurepip/` are the ones that are absolutely unrelated to this effort. Resolves python#80789. Ref: https://bugs.python.org/issue36608.
Prior to this patch, Pip wheels were stored in the Git repository of CPython. Git is optimized for text but these artifacts are binary. So the unpleasant side effect of doing this is that the bare Git repository size is being increased by the zip archive side every time it is added, removed or modified. It's time to put a stop to this. The patch implements an `ensurepip.bundle` module that is meant to be called through `runpy` to download the Pip wheel and place it into the same location as before. It removes the wheel file from the Git repository and prevents re-adding it by defining a new `.gitignore` configuration file. The idea is that the builders of CPython are supposed to invoke the following command during the build time: ```console $ python -m ensurepip.bundle ``` This command will verify the existing wheel's SHA-256 hash and, if it does not match, or doesn't exist, it will proceed to download the artifact from PyPI. It will confirm its SHA-256 hash before placing it into the `Lib/ensurepip/_bundled/` directory. Every single line added or modified as a part of this change is also covered with tests. Every new module has 100% coverage. The only uncovered lines under `Lib/ensurepip/` are the ones that are absolutely unrelated to this effort. Resolves python#80789. Ref: https://bugs.python.org/issue36608.
Prior to this patch, Pip wheels were stored in the Git repository of CPython. Git is optimized for text but these artifacts are binary. So the unpleasant side effect of doing this is that the bare Git repository size is being increased by the zip archive side every time it is added, removed or modified. It's time to put a stop to this. The patch implements an `ensurepip.bundle` module that is meant to be called through `runpy` to download the Pip wheel and place it into the same location as before. It removes the wheel file from the Git repository and prevents re-adding it by defining a new `.gitignore` configuration file. The idea is that the builders of CPython are supposed to invoke the following command during the build time: ```console $ python -m ensurepip.bundle ``` This command will verify the existing wheel's SHA-256 hash and, if it does not match, or doesn't exist, it will proceed to download the artifact from PyPI. It will confirm its SHA-256 hash before placing it into the `Lib/ensurepip/_bundled/` directory. Every single line added or modified as a part of this change is also covered with tests. Every new module has 100% coverage. The only uncovered lines under `Lib/ensurepip/` are the ones that are absolutely unrelated to this effort. Resolves python#80789. Ref: https://bugs.python.org/issue36608.
Prior to this patch, Pip wheels were stored in the Git repository of CPython. Git is optimized for text but these artifacts are binary. So the unpleasant side effect of doing this is that the bare Git repository size is being increased by the zip archive side every time it is added, removed or modified. It's time to put a stop to this. The patch implements an `ensurepip.bundle` module that is meant to be called through `runpy` to download the Pip wheel and place it into the same location as before. It removes the wheel file from the Git repository and prevents re-adding it by defining a new `.gitignore` configuration file. The idea is that the builders of CPython are supposed to invoke the following command during the build time: ```console $ python -m ensurepip.bundle ``` This command will verify the existing wheel's SHA-256 hash and, if it does not match, or doesn't exist, it will proceed to download the artifact from PyPI. It will confirm its SHA-256 hash before placing it into the `Lib/ensurepip/_bundled/` directory. Every single line added or modified as a part of this change is also covered with tests. Every new module has 100% coverage. The only uncovered lines under `Lib/ensurepip/` are the ones that are absolutely unrelated to this effort. Resolves python#80789. Ref: https://bugs.python.org/issue36608.
Prior to this patch, Pip wheels were stored in the Git repository of CPython. Git is optimized for text but these artifacts are binary. So the unpleasant side effect of doing this is that the bare Git repository size is being increased by the zip archive side every time it is added, removed or modified. It's time to put a stop to this. The patch implements an `ensurepip.bundle` module that is meant to be called through `runpy` to download the Pip wheel and place it into the same location as before. It removes the wheel file from the Git repository and prevents re-adding it by defining a new `.gitignore` configuration file. The idea is that the builders of CPython are supposed to invoke the following command during the build time: ```console $ python -m ensurepip.bundle ``` This command will verify the existing wheel's SHA-256 hash and, if it does not match, or doesn't exist, it will proceed to download the artifact from PyPI. It will confirm its SHA-256 hash before placing it into the `Lib/ensurepip/_bundled/` directory. Every single line added or modified as a part of this change is also covered with tests. Every new module has 100% coverage. The only uncovered lines under `Lib/ensurepip/` are the ones that are absolutely unrelated to this effort. Resolves python#80789. Ref: https://bugs.python.org/issue36608.
Prior to this patch, Pip wheels were stored in the Git repository of CPython. Git is optimized for text but these artifacts are binary. So the unpleasant side effect of doing this is that the bare Git repository size is being increased by the zip archive side every time it is added, removed or modified. It's time to put a stop to this. The patch implements an `ensurepip.bundle` module that is meant to be called through `runpy` to download the Pip wheel and place it into the same location as before. It removes the wheel file from the Git repository and prevents re-adding it by defining a new `.gitignore` configuration file. The idea is that the builders of CPython are supposed to invoke the following command during the build time: ```console $ python -m ensurepip.bundle ``` This command will verify the existing wheel's SHA-256 hash and, if it does not match, or doesn't exist, it will proceed to download the artifact from PyPI. It will confirm its SHA-256 hash before placing it into the `Lib/ensurepip/_bundled/` directory. Every single line added or modified as a part of this change is also covered with tests. Every new module has 100% coverage. The only uncovered lines under `Lib/ensurepip/` are the ones that are absolutely unrelated to this effort. Resolves python#80789. Ref: https://bugs.python.org/issue36608.
Prior to this patch, Pip wheels were stored in the Git repository of CPython. Git is optimized for text but these artifacts are binary. So the unpleasant side effect of doing this is that the bare Git repository size is being increased by the zip archive side every time it is added, removed or modified. It's time to put a stop to this. The patch implements an `ensurepip.bundle` module that is meant to be called through `runpy` to download the Pip wheel and place it into the same location as before. It removes the wheel file from the Git repository and prevents re-adding it by defining a new `.gitignore` configuration file. The idea is that the builders of CPython are supposed to invoke the following command during the build time: ```console $ python -m ensurepip.bundle ``` This command will verify the existing wheel's SHA-256 hash and, if it does not match, or doesn't exist, it will proceed to download the artifact from PyPI. It will confirm its SHA-256 hash before placing it into the `Lib/ensurepip/_bundled/` directory. Every single line added or modified as a part of this change is also covered with tests. Every new module has 100% coverage. The only uncovered lines under `Lib/ensurepip/` are the ones that are absolutely unrelated to this effort. Resolves python#80789. Ref: https://bugs.python.org/issue36608.
Prior to this patch, Pip wheels were stored in the Git repository of CPython. Git is optimized for text but these artifacts are binary. So the unpleasant side effect of doing this is that the bare Git repository size is being increased by the zip archive side every time it is added, removed or modified. It's time to put a stop to this. The patch implements an `ensurepip.bundle` module that is meant to be called through `runpy` to download the Pip wheel and place it into the same location as before. It removes the wheel file from the Git repository and prevents re-adding it by defining a new `.gitignore` configuration file. The idea is that the builders of CPython are supposed to invoke the following command during the build time: ```console $ python -m ensurepip.bundle ``` This command will verify the existing wheel's SHA-256 hash and, if it does not match, or doesn't exist, it will proceed to download the artifact from PyPI. It will confirm its SHA-256 hash before placing it into the `Lib/ensurepip/_bundled/` directory. Every single line added or modified as a part of this change is also covered with tests. Every new module has 100% coverage. The only uncovered lines under `Lib/ensurepip/` are the ones that are absolutely unrelated to this effort. Resolves python#80789. Ref: https://bugs.python.org/issue36608.
Prior to this patch, Pip wheels were stored in the Git repository of CPython. Git is optimized for text but these artifacts are binary. So the unpleasant side effect of doing this is that the bare Git repository size is being increased by the zip archive side every time it is added, removed or modified. It's time to put a stop to this. The patch implements an `ensurepip.bundle` module that is meant to be called through `runpy` to download the Pip wheel and place it into the same location as before. It removes the wheel file from the Git repository and prevents re-adding it by defining a new `.gitignore` configuration file. The idea is that the builders of CPython are supposed to invoke the following command during the build time: ```console $ python -m ensurepip.bundle ``` This command will verify the existing wheel's SHA-256 hash and, if it does not match, or doesn't exist, it will proceed to download the artifact from PyPI. It will confirm its SHA-256 hash before placing it into the `Lib/ensurepip/_bundled/` directory. Every single line added or modified as a part of this change is also covered with tests. Every new module has 100% coverage. The only uncovered lines under `Lib/ensurepip/` are the ones that are absolutely unrelated to this effort. Resolves python#80789. Ref: https://bugs.python.org/issue36608.
Prior to this patch, Pip wheels were stored in the Git repository of CPython. Git is optimized for text but these artifacts are binary. So the unpleasant side effect of doing this is that the bare Git repository size is being increased by the zip archive side every time it is added, removed or modified. It's time to put a stop to this. The patch implements an `ensurepip.bundle` module that is meant to be called through `runpy` to download the Pip wheel and place it into the same location as before. It removes the wheel file from the Git repository and prevents re-adding it by defining a new `.gitignore` configuration file. The idea is that the builders of CPython are supposed to invoke the following command during the build time: ```console $ python -m ensurepip.bundle ``` This command will verify the existing wheel's SHA-256 hash and, if it does not match, or doesn't exist, it will proceed to download the artifact from PyPI. It will confirm its SHA-256 hash before placing it into the `Lib/ensurepip/_bundled/` directory. Every single line added or modified as a part of this change is also covered with tests. Every new module has 100% coverage. The only uncovered lines under `Lib/ensurepip/` are the ones that are absolutely unrelated to this effort. Resolves python#80789. Ref: https://bugs.python.org/issue36608.
Prior to this patch, Pip wheels were stored in the Git repository of CPython. Git is optimized for text but these artifacts are binary. So the unpleasant side effect of doing this is that the bare Git repository size is being increased by the zip archive side every time it is added, removed or modified. It's time to put a stop to this. The patch implements an `ensurepip.bundle` module that is meant to be called through `runpy` to download the Pip wheel and place it into the same location as before. It removes the wheel file from the Git repository and prevents re-adding it by defining a new `.gitignore` configuration file. The idea is that the builders of CPython are supposed to invoke the following command during the build time: ```console $ python -m ensurepip.bundle ``` This command will verify the existing wheel's SHA-256 hash and, if it does not match, or doesn't exist, it will proceed to download the artifact from PyPI. It will confirm its SHA-256 hash before placing it into the `Lib/ensurepip/_bundled/` directory. Every single line added or modified as a part of this change is also covered with tests. Every new module has 100% coverage. The only uncovered lines under `Lib/ensurepip/` are the ones that are absolutely unrelated to this effort. Resolves python#80789. Ref: https://bugs.python.org/issue36608.
Prior to this patch, Pip wheels were stored in the Git repository of CPython. Git is optimized for text but these artifacts are binary. So the unpleasant side effect of doing this is that the bare Git repository size is being increased by the zip archive side every time it is added, removed or modified. It's time to put a stop to this. The patch implements an `ensurepip.bundle` module that is meant to be called through `runpy` to download the Pip wheel and place it into the same location as before. It removes the wheel file from the Git repository and prevents re-adding it by defining a new `.gitignore` configuration file. The idea is that the builders of CPython are supposed to invoke the following command during the build time: ```console $ python -m ensurepip.bundle ``` This command will verify the existing wheel's SHA-256 hash and, if it does not match, or doesn't exist, it will proceed to download the artifact from PyPI. It will confirm its SHA-256 hash before placing it into the `Lib/ensurepip/_bundled/` directory. Every single line added or modified as a part of this change is also covered with tests. Every new module has 100% coverage. The only uncovered lines under `Lib/ensurepip/` are the ones that are absolutely unrelated to this effort. Resolves python#80789. Ref: https://bugs.python.org/issue36608.
Prior to this patch, Pip wheels were stored in the Git repository of CPython. Git is optimized for text but these artifacts are binary. So the unpleasant side effect of doing this is that the bare Git repository size is being increased by the zip archive side every time it is added, removed or modified. It's time to put a stop to this. The patch implements an `ensurepip.bundle` module that is meant to be called through `runpy` to download the Pip wheel and place it into the same location as before. It removes the wheel file from the Git repository and prevents re-adding it by defining a new `.gitignore` configuration file. The idea is that the builders of CPython are supposed to invoke the following command during the build time: ```console $ python -m ensurepip.bundle ``` This command will verify the existing wheel's SHA-256 hash and, if it does not match, or doesn't exist, it will proceed to download the artifact from PyPI. It will confirm its SHA-256 hash before placing it into the `Lib/ensurepip/_bundled/` directory. Every single line added or modified as a part of this change is also covered with tests. Every new module has 100% coverage. The only uncovered lines under `Lib/ensurepip/` are the ones that are absolutely unrelated to this effort. Resolves python#80789. Ref: https://bugs.python.org/issue36608.
Prior to this patch, Pip wheels were stored in the Git repository of CPython. Git is optimized for text but these artifacts are binary. So the unpleasant side effect of doing this is that the bare Git repository size is being increased by the zip archive side every time it is added, removed or modified. It's time to put a stop to this. The patch implements an `ensurepip.bundle` module that is meant to be called through `runpy` to download the Pip wheel and place it into the same location as before. It removes the wheel file from the Git repository and prevents re-adding it by defining a new `.gitignore` configuration file. The idea is that the builders of CPython are supposed to invoke the following command during the build time: ```console $ python -m ensurepip.bundle ``` This command will verify the existing wheel's SHA-256 hash and, if it does not match, or doesn't exist, it will proceed to download the artifact from PyPI. It will confirm its SHA-256 hash before placing it into the `Lib/ensurepip/_bundled/` directory. Every single line added or modified as a part of this change is also covered with tests. Every new module has 100% coverage. The only uncovered lines under `Lib/ensurepip/` are the ones that are absolutely unrelated to this effort. Resolves python#80789. Ref: https://bugs.python.org/issue36608.
Prior to this patch, Pip wheels were stored in the Git repository of CPython. Git is optimized for text but these artifacts are binary. So the unpleasant side effect of doing this is that the bare Git repository size is being increased by the zip archive side every time it is added, removed or modified. It's time to put a stop to this. The patch implements an `ensurepip.bundle` module that is meant to be called through `runpy` to download the Pip wheel and place it into the same location as before. It removes the wheel file from the Git repository and prevents re-adding it by defining a new `.gitignore` configuration file. The idea is that the builders of CPython are supposed to invoke the following command during the build time: ```console $ python -m ensurepip.bundle ``` This command will verify the existing wheel's SHA-256 hash and, if it does not match, or doesn't exist, it will proceed to download the artifact from PyPI. It will confirm its SHA-256 hash before placing it into the `Lib/ensurepip/_bundled/` directory. Every single line added or modified as a part of this change is also covered with tests. Every new module has 100% coverage. The only uncovered lines under `Lib/ensurepip/` are the ones that are absolutely unrelated to this effort. Resolves python#80789. Ref: https://bugs.python.org/issue36608.
@pradyunsg should this issue get newer labels for |
I discussed this at some length at the core developers sprint this week (including some of current RMs). The main benefit of doing this is that we can avoid committing a ~2 MB wheel1, on a quarterly basis for pip releases, due to a limitation of git + binary blobs. Given that we no longer vendor a setuptools wheel, which evolves at a faster cadence than pip, the size growth rate as well as the rate of change isn't particularly high. The costs of this are (i) every one who tries to build CPython for the first time and run tests would need to perform this download, (ii) the CPython release process needs to be amended to include a downloaded wheel as part of the release tarball, (iii) it's unclear how/when this downloaded wheels should be deleted/removed and how that interacts with existing Based on the additional side-effects and work that this would cause, I'm gonna say that this isn't a big deal for now. We can revisit this if there is a strong(er) argument against committing the wheels into the repository to justify the additional side-effects on the development and release processes that it would have. Footnotes
|
Would it perhaps be viable to include pip as an (unpacked) sdist in the ensurepip source tree, and build it during the CPython build process? The repo bloat should be much smaller that way. (You'd also need to include pip's build dependencies, but those don't need to be updated frequently.) |
@AA-Turner @pradyunsg WDYT about the suggestion above? Could also be an unpacked wheel ( |
Co-authored-by: [email protected] Co-authored-by: Pradyun Gedam <[email protected]> Co-authored-by: Adam Turner <[email protected]>
…ython#109245) Co-authored-by: [email protected] Co-authored-by: Pradyun Gedam <[email protected]> Co-authored-by: Adam Turner <[email protected]>
ensurepip
#12791Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
Linked PRs
ensurepip
wheels at build time #109130ensurepip
infra for many wheels #109245The text was updated successfully, but these errors were encountered: