From 25a3a81c3fcaa5326062b439352fcca9eab14e35 Mon Sep 17 00:00:00 2001 From: Mikel Olasagasti Uranga Date: Sun, 12 Apr 2026 18:41:00 +0200 Subject: [PATCH] fix(packaging): prevent unwanted files and tests from being installed Refine package discovery and manifest exclusions to clean up both wheels and source distributions (sdists): - Dev-only paths like `tools/` and `example/` are not installed in wheels. - The `codespell_lib.tests` subpackage is excluded from the wheel. - Only files explicitly listed in `package-data` are bundled in wheels. - Dev metadata (.github, .devcontainer, .gitignore, .mailmap) is pruned from sdists. Signed-off-by: Mikel Olasagasti Uranga --- MANIFEST.in | 10 +++++++--- pyproject.toml | 7 +++++++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/MANIFEST.in b/MANIFEST.in index 36e8cf9628..90c44a95a9 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,7 +1,11 @@ -exclude *.yml *.yaml +exclude *.yml exclude .coveragerc exclude .git-blame-ignore-revs -exclude example example/* snap snap/* -exclude Makefile +prune example +prune snap +prune .devcontainer +prune .github +exclude .gitignore +exclude .mailmap exclude codespell.1.include exclude pyproject-codespell.precommit-toml diff --git a/pyproject.toml b/pyproject.toml index 58bc385343..efc9eaf104 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -70,10 +70,17 @@ requires = ["setuptools>=77", "setuptools_scm[toml]>=6.2, != 8.0.0"] [tool.setuptools_scm] write_to = "codespell_lib/_version.py" +[tool.setuptools] +include-package-data = false + [tool.setuptools.packages.find] +include = ["codespell_lib", "codespell_lib.*"] exclude = [ "dist", "snap", + "tools", + "example", + "codespell_lib.tests*", ] [tool.setuptools.package-data]