Skip to content

Can't build with uncommited changes since 0.17.x #704

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

Closed
gregersn opened this issue Nov 10, 2024 · 4 comments
Closed

Can't build with uncommited changes since 0.17.x #704

gregersn opened this issue Nov 10, 2024 · 4 comments

Comments

@gregersn
Copy link

This might be as expected, but it really breaks my workflow.

With 0.16.0 I could run python -m build with uncommited changes, and my project would build fine, with those changes.
With 0.17.x this no longer works.

I understand that this is for more predictability and reproducibility, but for the workflow, I can no longer check if everything builds without commiting changes.

Took a few hours of testing before I found out that the new version of meson-python was what caused my problems.

And from what I can gather from the documentation and changelog that was not something I could deduce from them.
Changelog says: "Do not include uncommitted changes when creating source distributions."
Documentation says, that to build a source distribution: python -m build --sdist .
And from what I understand, I am not creating a source distribution.

@eli-schwartz
Copy link
Member

For what it's worth, python -m build defaults to building both source distributions and wheels.

$ python -m build --help

[...]

    By default, a source distribution (sdist) is built from {srcdir}
    and a binary distribution (wheel) is built from the sdist.
    This is recommended as it will ensure the sdist can be used
    to build wheels.

    Pass -s/--sdist and/or -w/--wheel to build a specific distribution.
    If you do this, the default behavior will be disabled, and all
    artifacts will be built from {srcdir} (even if you combine
    -w/--wheel with -s/--sdist, the wheel will be built from {srcdir}).

[...]

@gregersn
Copy link
Author

@eli-schwartz Thank you, that was very useful to know. And absolutely my bad for not checking that part.

@rgommers
Copy link
Contributor

@gregersn does that solve your problem and can we close this? You can still build a wheel with uncommitted changes; sdists are for releases so the rationale for the change is to make sdist generation more reproducible and harder to accidentally get wrong.

@gregersn
Copy link
Author

@rgommers Yes, it does solve it. Could be nice to have the -w/--wheel option added to the documentation to avoid confusion, but for me this is solved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants