-
Couldn't load subscription status.
- Fork 3.2k
Use flit-core to build pip distributions
#13473
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
Conversation
73c1394 to
dc6553e
Compare
flit-core to build pip distributions
a4deea0 to
5f97a96
Compare
|
|
|
+1 from me |
|
A couple of minor points here.
Footnotes
|
|
+1 assuming that downstream is OK with it. This also reduces the time it takes to build pip from source (1.6s to 1s, locally with flit/setuptools cached via |
FWIW, the next session for building release artifacts does so in a clean temporary working checkout: Line 345 in 4bb2bcb
|
b998dca to
324e84f
Compare
flit-core to build pip distributionsflit-core to build pip distributions
|
Somehow I've got all tests passing without too much difficulty and there is general positive feedback, so I am removing PoC and draft status from PR. I do think this PR should be open for at least a couple of weeks to get maintainer feedback or anyone else watching pip closely. |
|
I compared 1 the generated wheel in this PR and main, and the difference that stands out is the various LICENCE files that are added in Otherwise this looks good and I'm ok with the change to flit-core. Footnotes
|
That's actually a flit bug (in my opinion, anyway...); I noticed it myself yesterday: pypa/flit#749. |
|
I should mention that updating So if someone is dependent on importing pip in |
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.
So if someone is dependent on importing pip in .pth based editable installs it may no longer work?
It seems like flit-core uses an .pth file for its build_editable implementation anyway, but honestly, I'm not worried about breaking users that are depending specifically on how our build backend implements editable installs. I'm not entirely sure why the freeze test needed to be updated, but I'm going to guess that the order in which the .pth files are executed changed, causing the mock file to execute before the pip source got added to sys.path.
It's mildly annoying that flit decided that the duplicate license files are not a bug (pypa/flit#749), but I'm not going to block this change on it.
I asked the flit team whether they had any objections to us switching over to their backend. No real issues: pypa/flit#751.
Anyway, with my RM hat on, I'm only going to consider merging this if every other maintainer is on board. And even then, I feel that would be possibly premature. We have ~2.5 weeks before pip 25.2 which is not a lot of time.
I also think that if this is merged it would be better at the beginning of a release cycle, not at the end. |
|
+1 from me on merging, but I agree let’s do it at the start of a release cycle. |
0402526 to
28abeb5
Compare
28abeb5 to
41352df
Compare
|
Okay, I've cleaned up the commits of this PR, which were quite messy as this started off as an experimental PR.
This also seems to be a limitation of flit? Adding it to the exclude pattern does not remove it. |
|
Unless anyone objects I'm going to merge this in a few days. |
| "docs/**/*.rst", | ||
| ] | ||
| exclude = [ | ||
| "src/pip/_vendor/**/*.pyi", |
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.
Why excluding this from the sdist?
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.
That pattern was added in #4545
It's probably not doing anything anymore? I'll take a look later and remove it if redundant.
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.
Vendoring generates stub files for packages which don't include a py.typed: https://github.com/pradyunsg/vendoring/blob/1.2.0/src/vendoring/tasks/stubs.py#L43-L52
Which puts pyi files here: https://github.com/pypa/pip/tree/25.2/src/pip/_vendor
What's interesting about this, is it doesn't seem to work, at least mypy doesn't find the correct type hints for requests: #13476
I will try and investigate this, but I think the solution will be that we need to update vendoring to stop doing this, or do something more useful?
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.
Vendoring does have some config that allows us to remove or rename these type stub files, which I may take advantage of in a different PR: https://github.com/pypa/pip/blob/25.2/pyproject.toml#L182
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.
Thanks for the investigation. This does not sound blocking for this PR anyway.
Co-authored-by: Stéphane Bidoul <stephane.bidoul@acsone.eu>
|
Thanks all, I've merged so it's hopefully well verified before 25.3. I'm happy to revert if we find an intractable issue. |
Fixes #13472
This is a very quick attempt to make a PR to switch to
flit-coreas pip's build back end, and if there is any missing features pip requires.There is no plan to merge, at least until, or if, there is agreement among the maintainers.