From 421e9c0739257321277f5b80b2fff18d8a48af91 Mon Sep 17 00:00:00 2001 From: Benjamin Mako Hill Date: Thu, 13 Aug 2026 12:00:42 -0700 Subject: [PATCH] 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 (cherry picked from commit 28406563bcdb7b2f31412e511ea30f66eb3620b5) --- pyproject.toml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index fcaebb0..6fa3795 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,6 +39,18 @@ build-backend = "hatchling.build" [tool.hatch.build.targets.wheel] 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] dev = [ "ipython>=8.18.1",