Skip to content

Commit aca223e

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 2dd2d21 commit aca223e

2 files changed

Lines changed: 14 additions & 3 deletions

File tree

MANIFEST.in

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1-
exclude *.yml *.yaml
1+
exclude *.yml
22
exclude .coveragerc
33
exclude .git-blame-ignore-revs
4-
exclude example example/* snap snap/*
5-
exclude Makefile
4+
prune example
5+
prune snap
6+
prune .devcontainer
7+
prune .github
8+
exclude .gitignore
9+
exclude .mailmap
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)