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
gh-95299: Stop installing setuptools as a part of ensurepip and venv #101039
base: main
Are you sure you want to change the base?
Conversation
Hmm... @vstinner @encukou any opinions on what I should do with That test has an implicit assumption that Notably, some leading questions that affect what direction I could take for updating that test:
|
This avoids meddling with `sys.argv` and removes reliance on careful control over the arguments passed to the script.
17a121e
to
32b3ccc
Compare
Since it's cheap to revert commits/remove them from a PR, and nice to have a code change to discuss details over, I've gone ahead and pushed a change that assumes that the answer to the questions I raised above is yes, yes and yes. :) Mentioning a GitHub UI thing that I find very useful (and non-initutive): you can click "force-pushed" on the event above to see what changed in the force pushes between the hashes that GitHub lists in the from ... to ... at the end of the event. |
This allows the "package" to be built using regular Python packaging workflows instead of relying on `setuptools` being present in the virtual environment.
This is no longer necessary since newer versions of pip are able to operate in environments that do not contain setuptools.
32b3ccc
to
6939d48
Compare
Co-authored-by: Hugo van Kemenade <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes seem reasonable to me, though I'm only the code owner for the venv and test_venv bits.
IMO, that would be best. Relatedly, I've been thinking how to handle Anyway, if that sounds like more than you signed up for, go ahead with Setuptools. |
I spent some time today looking into this after my work day, and I've not figured out the details in a portable manner. I'd prefer if this could be tackled in a follow up instead. :) |
This PR removes the bundled setuptools wheel from ensurepip, and stops installing setuptools in environments created by venv.
I based this PR off of my understanding of venv and ensurepip, and using the following search to locate all the relevant bits of code + ensuring that tests are happy locally.
In this PR, I've intentionally not touched the example in https://docs.python.org/3.12/library/venv.html#an-example-of-extending-envbuilder. That example is largely outdated and is likely better served being updated in a dedicated PR for it.