python
data_error
ai_generated
true
warning: no previously-included files matching '*.pyc' found under directory '*' warning: no files found matching '*.json' under directory 'data'
ID: python/setuptools-manifest-in-missing-files
80%Fix Rate
82%Confidence
0Evidence
2024-10-11First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 3.8 | active | — | — | — |
| 3.9 | active | — | — | — |
| 3.10 | active | — | — | — |
| 3.11 | active | — | — | — |
| 3.12 | active | — | — | — |
Root Cause
MANIFEST.in references files or globs that do not exist in the source tree, so the sdist silently omits data files the package needs at runtime.
generic中文
MANIFEST.in 引用了源码树中不存在的文件或通配符,导致 sdist 静默遗漏包运行时需要的数据文件。
Workarounds
-
90% success
Verify paths exist relative to the project root and correct MANIFEST.in, e.g. `recursive-include src/pkg/data *.json`. Rebuild with `python -m build`.
-
85% success
Prefer `[tool.setuptools.package-data]` in pyproject.toml to declare data files instead of relying on MANIFEST.in.
Dead Ends
Common approaches that don't work:
-
70% fail
The resulting sdist lacks data files, causing runtime FileNotFoundError for users.
-
65% fail
If the paths are wrong, additional globs produce more warnings without including files.