You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using include on build targets, I end up with different files included in the final wheel depending on if the build is made with hatch build or through another tool (e.g. build or uv build).
With hatch build, wheel.py is included in the wheel, but when invoking build backend through build (or uv build), it is not.
If I update include in [tool.hatch.build.targets.sdist] to include wheel.py, like so:
[tool.hatch.build.targets.sdist]
include = ["sdist.py", "sdist_wheel.py", "wheel.py"]
then when building with build (or uv build), the wheel will include wheel.py.
So it looks like when using another build backend, files included in the wheel that are not also in the sdist are not included.
The text was updated successfully, but these errors were encountered:
mkniewallner
changed the title
Different file included in wheels between hatch build and build from other tools
Different files included in wheels between hatch build and build from other tools
Jan 2, 2025
The behavior you are seeing is coming from the fact that python -m build builds an sdist and then builds a wheel from this sdist. Other tools like hatch, pip, and tox support building a wheel directly from the source code, skipping the sdist, so files not included in the sdist can still appear in the wheel.
Using
include
on build targets, I end up with different files included in the final wheel depending on if the build is made withhatch build
or through another tool (e.g.build
oruv build
).Minimal reproducing example from the repository above:
hatch
:build
(same result foruv build
):With
hatch build
,wheel.py
is included in the wheel, but when invoking build backend throughbuild
(oruv build
), it is not.If I update
include
in[tool.hatch.build.targets.sdist]
to includewheel.py
, like so:then when building with
build
(oruv build
), the wheel will includewheel.py
.So it looks like when using another build backend, files included in the wheel that are not also in the sdist are not included.
The text was updated successfully, but these errors were encountered: