Checks for Python MANIFEST.in
Finds mistakes in MANIFEST.in, the template setuptools uses to decide which extra files go into a source distribution (sdist), and shows what each line actually selects — while you edit, without building anything.
A typo in MANIFEST.in does not stop a build. setuptools prints a warning such as warning: no files found matching 'docs/*.rst' somewhere in a long build log, skips the line, and you find out later that a data file is missing from the release. This extension puts those warnings on the line where they happen.
Features
- Syntax colouring for
MANIFEST.in files: commands, comments, folder arguments, * ? ** wildcards and [...] sets, \ line continuations.
- Problems on the right line, worked out with setuptools' own rules:
- unknown commands (
includ, Include, recursive_include, …) — setuptools skips these lines — with a "did you mean" fix;
- wrong number of arguments (
recursive-include needs a folder and at least one pattern; graft and prune take exactly one folder), with setuptools' exact message;
- patterns that match no files, reported with the wording setuptools prints (
warning: no files found matching ..., ... under directory ..., ... anywhere in distribution, no directories found matching ..., no previously-included files ...), plus a hint when the reason is common: include docs names a folder (use graft docs), the folder of a recursive-include does not exist, graft was given a file;
- path problems:
\ used as a folder separator (works on Windows only), absolute paths, .., trailing /, and a \ at the very end of the file;
- two surprising setuptools behaviours: in
include a ** folder matches exactly one level (not any depth), and in exclude-type lines [a-c] matches only a, - and c.
- Hover on any line: how many files it adds or removes, the first file names (20 by default), how many files the template selects after that line, and for multi-pattern lines the count per pattern.
- Quick fixes: remove a line (or one pattern) that matches nothing, change an unknown command to the suggested one, replace
\ with /, remove a trailing /, split graft a b into two lines.
- Completion: commands at the start of a line; folder names for the folder argument of
recursive-include, recursive-exclude, graft and prune; files and folders for include and exclude (type / to go one level deeper).
- Command "MANIFEST.in: Show files selected by template": opens a new, unsaved document listing the final set of files the template selects — every line applied in order, then the pruning sdist does afterwards (
build/, VCS folders, .tox/.nox/.venv at the top), sorted the way setuptools sorts its manifest.
How it matches files
The matching code is a port of the parts of setuptools that read MANIFEST.in: the line reader (distutils.text_file.TextFile: comments, \#, \ continuation), the argument checks, setuptools.glob (used by include, recursive-include, graft; hidden files are matched), Python's fnmatch, and translate_pattern (used by exclude, global-*, recursive-exclude, prune; * does not cross /, ** matches any number of folders). It was checked against the real setuptools 84.2.1 on Python 3.13: the test suite contains file trees and templates whose expected results (file list after every line, warnings, errors, final list) were recorded by running setuptools itself.
The project folder is the folder that contains the MANIFEST.in, as for setuptools. Only file and folder names are read; file contents are never read, nothing is run and nothing is sent anywhere.
Exclude-type lines (exclude, recursive-exclude, global-exclude, prune) are only reported when no file in the project matches them. A line like prune tests may legitimately remove files that setuptools adds on its own (package sources, files tracked by setuptools-scm), so it is not reported just because the earlier lines did not add those files.
Usage
Open any MANIFEST.in. Problems appear in the editor and in the Problems panel; hover a line to see its files; use the light bulb for fixes; run MANIFEST.in: Show files selected by template from the Command Palette to see the whole list. Results update as you type and when files are created or deleted in the project.
If you also have the older "Python MANIFEST.in" grammar extension (language id python-manifest-template), the checks work in files of either language, because they are attached to the file name MANIFEST.in. This extension's own language id is manifest-in.
Settings
| Setting |
Default |
Meaning |
manifestIn.ignoredFolders |
.git, node_modules, .venv, venv, .tox, .nox, caches, … |
Folder names (or simple */? patterns) that are not searched, at any depth. Lines pointing into them are never reported as matching nothing. |
manifestIn.ignoreVirtualenvs |
true |
Also skip any folder that contains pyvenv.cfg. |
manifestIn.maxFiles |
50000 |
Stop reading the project after this many files; "matches nothing" checks are then turned off. |
manifestIn.unmatchedInclude |
warning |
error, warning, information or off for include-type patterns that match no files. |
manifestIn.unmatchedExclude |
warning |
The same for exclude-type patterns that match no project file. |
manifestIn.hoverFileLimit |
20 |
How many file names a hover lists. |
Limitations
- This is a static check. It does not run setuptools,
setup.py, or your build backend.
- The "files selected" list contains only what
MANIFEST.in selects. setuptools also adds default files that do not depend on the template — README*, setup.py, setup.cfg, pyproject.toml, package and module sources, license files, files referenced by the configuration, and files from SCM plugins such as setuptools-scm — and those are not in the list.
- Matching follows Linux and macOS rules (
/ is the only separator, names are case-sensitive). On Windows setuptools also accepts \ and ignores case, so results there can differ; a \ in a pattern is flagged for that reason.
- Folders in
manifestIn.ignoredFolders and virtual environments are not searched, although setuptools would search them.
- Files outside the project folder (absolute paths,
..) are not looked up.
- Very old setuptools/distutils versions behaved differently in a few corner cases (for example on Windows they rejected trailing
/); messages mention this where it matters.
Privacy
No network access, no telemetry, no processes are started. The extension reads file names in the folder that holds your MANIFEST.in, and nothing else.
Disclaimer
This is an unofficial extension. It is not affiliated with, endorsed by, or maintained by setuptools, the Python Packaging Authority (PyPA), or the Python Software Foundation. "setuptools" is used only to describe what the extension checks.
This extension was built with the help of AI (Claude by Anthropic) and tested with automated tests, including tests against the real setuptools and tests in a real VS Code.
License
MIT
| |