keep local files out of the source distribution

With no sdist target configured, hatchling walked the whole working tree
and included whatever it found. The resulting 8.9MB sdist carried 448
files from a virtualenv left in the repository root, plus .claude/ and
.gitmodules, while omitting the test dumps -- those are gitignored, so
the tests it did ship could not have run.

List the sdist contents explicitly. It is now 40KB of source, README and
COPYING, and both it and the wheel pass twine check. Tests run from a
clone rather than from the sdist, so test/ is deliberately excluded.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
(cherry picked from commit 28406563bcdb7b2f31412e511ea30f66eb3620b5)
This commit is contained in:
2026-08-13 12:00:42 -07:00
parent a68a596bf4
commit 421e9c0739

View File

@@ -39,6 +39,18 @@ build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel] [tool.hatch.build.targets.wheel]
packages = ["src/wikiq"] packages = ["src/wikiq"]
# Without an explicit list hatchling walks the whole working tree, which sweeps
# in any local virtualenv and editor state while still omitting the test dumps,
# since those are gitignored. Tests run from a clone of the repository rather
# than from the sdist.
[tool.hatch.build.targets.sdist]
include = [
"src/wikiq",
"README.md",
"COPYING",
"pyproject.toml",
]
[dependency-groups] [dependency-groups]
dev = [ dev = [
"ipython>=8.18.1", "ipython>=8.18.1",