Commit c530436
fix(build): pin hatchling <1.32 to fix twine check CI failure (#1095)
Fixes #1096
## Problem
The `Run twine check` CI step fails on all PRs (e.g. run
[31887608422](https://github.com/testcontainers/testcontainers-python/actions/runs/31887608422/job/95019090461?pr=1090)
on #1090) with:
```
Checking dist/testcontainers-4.15.0-py3-none-any.whl: ERROR InvalidDistribution: Invalid distribution metadata: '2.5' is not a valid metadata version
```
## Root cause
`hatchling>=1.32` started emitting `Metadata-Version: 2.5` in built
wheel/sdist metadata. The pinned `twine` (6.2.0, via `packaging`)
doesn't yet recognize `2.5` as valid and rejects the distribution. This
is unrelated to any specific PR's diff — it's an unpinned build-backend
version issue. See pypa/twine#1327.
## Fix
Pin `hatchling` to `>=1.26,<1.32` in `pyproject.toml`'s `[build-system]`
so it keeps emitting `Metadata-Version: 2.4`, compatible with the
current twine/packaging toolchain.
## Verification
Ran locally:
```
uv build && uv run twine check dist/*
```
Wheel METADATA now shows `Metadata-Version: 2.4`, and both wheel and
sdist pass `twine check` (`PASSED`).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 6536a34d-6afa-4f02-81ed-89dc72586d041 parent 53ded4d commit c530436
1 file changed
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
166 | 166 | | |
167 | 167 | | |
168 | 168 | | |
169 | | - | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
170 | 172 | | |
171 | 173 | | |
172 | 174 | | |
| |||
0 commit comments