Skip to content

Commit 1c9bf89

Browse files
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 <mikel@olasagasti.info>
1 parent 0cf8151 commit 1c9bf89

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

MANIFEST.in

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ exclude *.yml *.yaml
22
exclude .coveragerc
33
exclude .git-blame-ignore-revs
44
exclude example example/* snap snap/*
5+
prune .devcontainer
6+
prune .github
7+
exclude .gitignore
8+
exclude .mailmap
59
exclude Makefile
610
exclude codespell.1.include
711
exclude pyproject-codespell.precommit-toml

pyproject.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,17 @@ requires = ["setuptools>=77", "setuptools_scm[toml]>=6.2, != 8.0.0"]
7070
[tool.setuptools_scm]
7171
write_to = "codespell_lib/_version.py"
7272

73+
[tool.setuptools]
74+
include-package-data = false
75+
7376
[tool.setuptools.packages.find]
77+
include = ["codespell_lib", "codespell_lib.*"]
7478
exclude = [
7579
"dist",
7680
"snap",
81+
"tools",
82+
"example",
83+
"codespell_lib.tests*",
7784
]
7885

7986
[tool.setuptools.package-data]

0 commit comments

Comments
 (0)