56.14. python3-hatchling-1.32.4
Hatch's PEP 517 backend, which bootstraps itself — scikit-build-core builds with it
| Version | 1.32.4, release 1 |
| Shelf | python — The python3 interpreter, tkinter, and Python build, packaging and extension tooling |
| Phase | 30_foundation (Build Foundation), 49 of 127 in build order |
| Licence | MIT |
| Homepage | https://pypi.org/project/hatchling/ |
| Build time | 0.1 SBU |
| Installed size | 717.2 KiB in 144 files |
| Recipe | ports/core/python/python3-hatchling/kpkgbuild |
About
hatchling is the build backend of the Hatch project: a project declaring build-backend = "hatchling.build" is built by it, with plugins for version sources, build hooks and file selection.
Much of 30_foundation’s Python block is its closure. Its run-time dependencies are python3-packaging, python3-pathspec, python3-pluggy, python3-tomlkit and python3-trove-classifiers, and those in turn need flit_core, setuptools-scm, poetry-core and calver to build. With it in place, python3-hatch-vcs, python3-sphinx’s closure and, in later phases, python3-scikit-build-core, the Jupyter modules, calibre, deluge, khal and radicale can be built.
Sources
python3-hatchling-1.32.4.tar.gz(56.7 KiB)
sha256c4468f73144c054d2aab4ef0f0378c43b9878bf07f8ffd6b79690e970d375f07
upstream: https://files.pythonhosted.org/packages/source/h/hatchling/hatchling-1.32.4.tar.gz
archive copy: sources-3/python--python3-hatchling-1.32.4.tar.gz
Dependencies
Depends on: python3, python3-pip, python3-packaging, python3-pathspec, python3-pluggy, python3-tomlkit, python3-trove-classifiers.
Required by (38): calibre, deluge, gnuhealth, jupyterlab, khal, python3-astropy-iers-data, python3-attrs, python3-beautifulsoup4, python3-cattrs, python3-colorama, python3-comm, python3-cssselect, python3-hatch-jupyter-builder, python3-hatch-nodejs-version, python3-hatch-tryton, python3-hatch-vcs, python3-incremental, python3-ipykernel, python3-jsonschema, python3-jsonschema-specifications, python3-jupyter-client, python3-jupyter-core, python3-jupyterlab-pygments, python3-lsp-ruff, python3-lsp-server, python3-nbconvert, python3-obd, python3-referencing, python3-scikit-build-core, python3-soupsieve, python3-sphinx, python3-twisted, python3-urllib3, radicale, spyder, tryton, vdirsyncer, yt-dlp.
Installation
From the repository root, inside the build container, this is the line kdosbuild runs for the port:
script/chroot/exec.sh bash -c 'source script/phases/30_foundation/phase.env && kpkg install python3-hatchling'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/python/python3-hatchling.
1. Verify every declared source. Each file a sha256 = line names, found in the port directory or in /var/cache/kpkg/sources, must hash to its line; a mismatch stops the build before anything is unpacked.
cd /ports/core/python/python3-hatchling
echo 'c4468f73144c054d2aab4ef0f0378c43b9878bf07f8ffd6b79690e970d375f07 python3-hatchling-1.32.4.tar.gz' | sha256sum -c -
2. Unpack. The work directory is emptied and the first source is unpacked into $SRC with its top directory stripped; any later tarball lands unstripped beside it in $SRC_ROOT, and a file that is not a tarball is copied into $SRC.
SRC_ROOT=/var/cache/kpkg/work/python3-hatchling
SRC=$SRC_ROOT/python3-hatchling-1.32.4
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf python3-hatchling-1.32.4.tar.gz -C "$SRC" --strip-components=1
Every config.guess and config.sub older than automake’s is then replaced with automake’s, so a configure script recognises the musl target.
3. Build. build.sh is sourced in a subshell under set -e, from $SRC, with name, version, release and the five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:
pip3 install --ignore-installed --no-deps --no-index --no-build-isolation --root=$PKG --prefix=/usr .
The switches, and why each is set:
--no-build-isolation— Build in the build root’s own Python environment rather than in a temporary one that pip fills. hatchling builds itself: itspyproject.tomldeclares no build requirement and nameshatchling.ouroboros, from the source’s ownsrc, as the backend. That module reports hatchling’s run-time dependencies as its build requirements. With no isolation, pip installs none of them, so they must already be in the build root, whichdependssees to.
The common switches of each build system are explained in the Flag glossary.
4. Package. kpkg removes libtool archives, the info directory index, mimeinfo.cache and every fonts.dir from $PKG, copies the source’s licence files into /usr/share/licenses/python3-hatchling, prunes what the image does not ship, lints the tree and rolls it reproducibly:
tar --sort=name --format=gnu --numeric-owner --owner=0 --group=0 \
--mtime=@$SOURCE_DATE_EPOCH \
--use-compress-program='xz -9 -T0 --block-size=32MiB --no-adjust' \
-cf python3-hatchling-1.32.4-1.tar.xz -C "$PKG" .
5. Adopt. kpkgadd installs the package’s files over the root, refusing a path another package owns, records the file list in /var/lib/kpkg/db/python3-hatchling, and runs the triggers its paths call for.
Contents
Installed programs: hatchling.
Installed directories: /usr/lib/python3.14/site-packages/hatchling, /usr/lib/python3.14/site-packages/hatchling-1.32.4.dist-info, /usr/share/licenses/python3-hatchling.