#can you show the configuration?
1 messages · Page 1 of 1 (latest)
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.build]
sources = ["src"]
[project]
name = "example-4a6eaaab-a"
version = "1.0.0"
dependencies = ["example-4a6eaaab-b>=1.0.0"]
requires-python = ">=3.7"
description = ""
okay a few things
[tool.hatch.build] should be used very rarely, the new docs page about building discourages global config. it has caused so many issues in the past, I just implemented it originally because I thought it might be useful. bad idea
right now you aren't specifying any inclusion patterns so at least for the wheel, this is happening: https://hatch.pypa.io/latest/plugins/builder/wheel/#default-file-selection
configure this explicitly instead: https://hatch.pypa.io/latest/config/build/#packages
same result, but faster
hm yeah the sources config was leftover from me doing something really dumb, I can remove that
I'm building wheels and sdists, I found it confusing that the hatch makes me configure them both separately?
I mean, they are separate artifacts
I guess but the files in my package don't tend to change between them
Anyway, I'm doing
[tool.hatch.build.targets.wheel]
packages = ["src/{{ module-name }}"]
[tool.hatch.build.targets.sdist]
packages = ["src/{{ module-name }}"]
it's slightly faster
do not do that for the source distribution!
Oh?
[...] the shipped path will be collapsed to only include the final component.
I honestly don't know what that means haha
for source distributions just use include/exclude/only-include
it means that your source distribution will have a top level module not the src
so then when a wheel gets built from the source distribution it will break
I see that's no good, a warning admonition there in the docs would be good
helpful*
We're still on the order of ~1s for packaging these three projects
I need to generate hundreds of wheels in my test suite
I'll look into some parallelism next
[tool.hatch.build.targets.wheel]
packages = ["src/{{ module-name }}"]
[tool.hatch.build.targets.sdist]
only-include = ["src/{{ module-name }}"]
that should be your config
the next thing you can do is just install Hatchling, then do hatchling build
assuming you have no other build-time dependencies
i.e. all build environments require just Hatchling
Yeah there are no other build dependencies
then that will be way faster yeah
Ooo yeah that's better now down to 0.3s
if you are comfortable publishing your benchmarks somewhere I would gladly showcase that on the "Why Hatch?" page in the section comparing backends
I'd be happy to if I get to a point where it's worth sharing!
It might not be worth the hassle (for my use-case) to compare to other build backends at all
Since hatchling seems clearly fast
I just compare to setuptools on that page for now, so if you have that really that's okay