-
Notifications
You must be signed in to change notification settings - Fork 121
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
Build wheel from sdist (optionally?) #257
Comments
This is mentioned in PEP 517 as a possibility, under § build-sdist:
My opinion is that this should be the default behaviour in build, if pip should be able to build wheels from published sdists. I'm lukewarm about allowing wheels to be built in the absence of an sdist as it's bound to catch someone off-guard - I think that |
|
pip is so burdened with backwards compatibility people get unreasonably mad when something "breaks" for them. I would hope new tools like |
I think the best way to proceed is to switch the default behavior to this -- build a sdist and then a wheel from that sdist. The |
Wait are you proposing that: |
Yes, I was envisioning something like this.
I don't know, it may not be supper clear. We would have more in depth documentation in the website, explaining why this behavior is, we can even have the link there. |
For me, that would be surprising behavior. I personally view the |
Why would it be surprising if it's documented? I think the description of My reasoning behind this design is that the tool should have the recommended behavior by default, while still being accessible for advanced users (that is a big part of this tool). Instead of telling users to I suggest you take a look at the other side (advances users). Having So if we are implementing this, I think it should be the default behavior. I also think this option should be mutually exclusive from |
Documenting surprising behavior just moves the moment of surprise for users that read the docs in detail first.
Having
I don't know my way around all the nuances but those particular comments didn't seem to form strong arguments. |
Where did you read that the recommended behavior is to build a wheel from a sdist rather than from the source tree? 🤔 I don't think that's true. pip itself builds a wheel from the source tree and not the sdist. I think what we want is |
I don't know if it's recommended anywhere, but I'd consider it good practice that for published sdists the wheel is built from the sdist for consistency with the published wheel. With all of the nuances surrounding packaging data in setuptools in particular, it's not hard to imagine that a source-tree build might produce a very different output. |
See my comment above. pip wants to build wheel against sdist and is working toward the goal, it just can’t right now. |
@gaborbernat, yes, I should have used more words. It seems there is some feeling that building the wheel from the sdist is a good thing to do generally. This is not the same as an 'official consensus' (however that might be defined) that wheels ought only be built from sdists. Sorry I jumped ahead there. But, if it is concluded that just @gaborbernat, you have switched between |
Either one :-) no strong feelings. At the moment I'm more in favor of |
Like I said, I believe the
I have a pretty strong position on this. The project should abstract such low-level details, while still being as close to the low-level mechanism as possible. I don't want CLI breakage if Python decides to move to another backend mechanism. In this light, I think these two options,
I think we should figure all this out before introducing anything. I am gonna open a discourse thread. |
On a similar vein, is My use case is to build the sdist in one environment in CI (eg |
I want to document another clear use case. Various Linux distro packagers rely on sdists from PyPI specifically to produce things like RPMs so it'd make a lot of sense if it could be done as seamlessly as possible. |
As explained above, I think So what I am leaning to is simply making this the default behavior, instead of implying |
@FFY00 do I understand correctly that it would be possible to pass the tarball path instead of the source dir path and the rest of the UI would preserve its look&feel? |
I was not thinking about that, but we can indeed do it, but it will only be valid for |
Fixes pypa#257 Signed-off-by: Filipe Laíns <[email protected]>
Fixes pypa#257 Signed-off-by: Filipe Laíns <[email protected]>
Fixes pypa#257 Signed-off-by: Filipe Laíns <[email protected]>
Fixes pypa#257 Signed-off-by: Filipe Laíns <[email protected]>
Fixes pypa#257 Signed-off-by: Filipe Laíns <[email protected]>
Fixes pypa#257 Signed-off-by: Filipe Laíns <[email protected]>
Fixes #257 Signed-off-by: Filipe Laíns <[email protected]>
The proposal is to build the wheel from an sdist rather than directly from the source. Perhaps optionally, perhaps only when both
--sdist
and--wheel
are specified, perhaps always. Presently I have this implemented in towncrier as below.It was suggested that perhaps this would be a useful feature for build to provide itself. See more context and discussion below.
twisted/towncrier#323 (comment)
Following Trio's lead, I implemented package builds for towncrier such that first an sdist is built and then a wheel is built from that sdist. Following that, those two files are distributed throughout the CI tests and checks and (upcoming) automated publishing. The latter bit makes sure that the specific wheel to be published is what is being tested. The former bit makes sure that the sdist is able to generate a functional wheel. I don't mean this to test that build and wheel and so on work correctly, but rather to test that the package being built is setup properly such that it will result in a functional sdist. Twisted #10103 was shared as an example issue that this workflow would have caught.
The text was updated successfully, but these errors were encountered: