-
Couldn't load subscription status.
- Fork 31
Add sdist_backend setting, default to PEP 517 #577
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
0cedb86 to
09c01fb
Compare
Fromager now defaults to PEP 571 hooks to create sdists. This re-generates the metadata of sdists, too. Fresh metadata solves problems like core metadata violation with Hatchling < 1.26. - Packages with `build_dir` option use old `tarball` method by default. - Packages with `mesonpy` build backend use old `tarball` method. `meson dist` currently only works with Git or Mercurial repos. - Packages with `build_sdist` hook are not affected. - `build_options.sdist_backend: tarball` restores the previous behavior. Signed-off-by: Christian Heimes <[email protected]>
It sounds like you're doing sdist -> sdist? That's not a thing, no packaging standard guarantees that that will work, and I know of multiple reasons it cannot work reliably. |
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.
Yes this looks like it assumes sdist -> sdist should work, and that's false. There are a lot of projects that for example rely on generating a file from VCS with versioning info. That should only ever be run once, roundtripping when starting from an sdist may lose the info or change a git commit hash to "unknown".
I think this is probably going to introduce more problems than it solves. Maybe doing it only when there's a known issue with existing metadata in the sdist is better?
|
|
||
| class SDistBackend(enum.StrEnum): | ||
| # build sdist with PEP 517 hook | ||
| PEP517 = "pep571" |
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.
🙃 typo, but PEP 571 is the manylinux2010 PEP so could be a deep feature too
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.
ouch :)
|
|
||
|
|
||
| # meson dist currently only works with Git or Mercurial repos | ||
| # affects NumPy and projects with https://mesonbuild.com/meson-python/ |
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.
If Meson doesn't work with an alternative VCS, it won't be used. I don't think Fromager should worry about this.
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.
I need to clarify this comment or remove BUILD_BACKEND_FORCE_TARBALL again. The meson dist command expects a VCS checkout. It does not support sdist -> sdist.
|
Other reason: a |
Oh, that's too bad. Back to the drawing board! I was able to build all the wheels in our set with the new code. I have not verified that the wheels were built correctly, though. |
I'd expect most problems to be subtle, like metadata changing or a generated file going missing. |
|
Closing this PR because building sdist from sdist is not a supported case. |
Fromager now defaults to PEP 571 hooks to create sdists. This re-generates the metadata of sdists, too. Fresh metadata solves problems like core metadata violation with Hatchling < 1.26.
build_diroption use oldtarballmethod by default.mesonpybuild backend use oldtarballmethod.meson distcurrently only works with Git or Mercurial repos.build_sdisthook are not affected.build_options.sdist_backend: tarballrestores the previous behavior.