Skip to content

build: replace hatchling with the uv_build backend - #77

Open
vdusek wants to merge 2 commits into
masterfrom
chore/uv-0.12-and-uv-build-backend
Open

build: replace hatchling with the uv_build backend#77
vdusek wants to merge 2 commits into
masterfrom
chore/uv-0.12-and-uv-build-backend

Conversation

@vdusek

@vdusek vdusek commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Switches the build backend from hatchling to uv_build, replacing [tool.hatch.build.targets.sdist] with [tool.uv.build-backend]. Only CHANGELOG.md and CONTRIBUTING.md need an explicit source-include - the module, pyproject.toml, README, and LICENSE are in the sdist by default.

License metadata moves to PEP 639: license = "Apache-2.0" plus license-files = ["LICENSE"]. That part is required, not cosmetic: uv_build ships LICENSE inside the wheel only when it is declared via license-files, and uv rejects license-files combined with the legacy license = { file = ... } table.

The License :: OSI Approved :: Apache Software License classifier is dropped because PEP 639 deprecates license classifiers in favor of License-Expression, which now carries the same information ("Using license classifier in the Classifier Core Metadata field is deprecated and replaced by the more precise License-Expression field"). See also the core metadata spec. uv warns about the classifier on every build.

Verified by building sdist + wheel before and after: the wheel contents are identical, and the metadata differs only in License-Expression: Apache-2.0 replacing the inlined license text. The sdist drops .gitignore and gains pyproject.toml.orig (uv 0.12 writes a TOML 1.0-compatible pyproject.toml into the sdist and keeps the original alongside it). uv.lock is unchanged.

Part of the same sweep as apify/crawlee-python#2098, apify/apify-sdk-python#1067, and apify/apify-client-python#980.

✍️ Drafted by Claude Code

Also migrates the license metadata to PEP 639 (`license` as an SPDX expression plus
`license-files`), which is what uv_build reads to ship LICENSE inside the wheel. The
resulting wheel is content-identical to the hatchling one.
@vdusek vdusek added t-tooling Issues with this label are in the ownership of the tooling team. adhoc Ad-hoc unplanned task added during the sprint. labels Jul 29, 2026
@vdusek vdusek self-assigned this Jul 29, 2026
@github-actions github-actions Bot added this to the 146th sprint - Tooling team milestone Jul 29, 2026
@vdusek
vdusek marked this pull request as ready for review July 29, 2026 06:50
@vdusek
vdusek requested a review from janbuchar July 29, 2026 06:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

adhoc Ad-hoc unplanned task added during the sprint. t-tooling Issues with this label are in the ownership of the tooling team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants