Skip to content

Commit cabc631

Browse files
authored
🐛 fix(build): match hatchling floor to python-requires (#94)
Installing python-discovery from source on Python 3.8 or 3.9 fails at the build step with `No matching distribution found for hatchling>=1.28`, reported in #92. The build pin `hatchling>=1.28` requires Python `>=3.10`, yet the project declares `requires-python = ">=3.8"` and tests against 3.8/3.9, so pip cannot find a backend when it builds the sdist on those interpreters. Nothing needs that specific floor; it landed during the standalone rewrite in #28. An environment marker splits the requirement so interpreters below 3.10 pull `hatchling>=1.27`, the last release supporting `<3.10`, while 3.10 and newer keep `hatchling>=1.28`. Published wheels ship prebuilt and skip the backend, so they stay unchanged. This restores source builds on the older interpreters the package already supports.
1 parent 952c6e5 commit cabc631

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

docs/changelog/92.packaging.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Constrain the ``hatchling`` build requirement per Python version so sdist builds resolve a compatible backend on the
2+
declared ``>=3.8`` floor - ``hatchling>=1.28`` dropped Python 3.9, leaving 3.8/3.9 unbuildable from source - by
3+
:user:`gaborbernat`.

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
build-backend = "hatchling.build"
33
requires = [
44
"hatch-vcs>=0.5",
5-
"hatchling>=1.28",
5+
"hatchling>=1.27; python_version<'3.10'",
6+
"hatchling>=1.28; python_version>='3.10'",
67
]
78

89
[project]

0 commit comments

Comments
 (0)