check-manifest
check-manifest copied to clipboard
Warn if manifest has lines that don't do anything
It would be nice if check-manifest also warned you if MANIFEST.in has lines that "don't do anything" (i.e. lines that match no files being included). The presence of such lines means that MANIFEST.in can be simplified, or perhaps that files are missing from source control that should be there.
I'd accept such a pull request. I'm unlikely to find time to work on this myself.
It looks like one prerequisite to doing this is enhancing _get_ignore_from_manifest()
to return the include
lines and not just the exclude
lines. Once that is in place, it should be straightforward.
The suggestions in this feature request can note not just unneeded includes but also unneeded excludes.
Unneeded excludes tend to produce warnings during pip install time, so warning about them seems like a good idea.
I'm waiting for the pull request :)
I started working on it to see how much time it would take. :)
I will see if I have some time later this week, but not today.
This is complicated by the fact that a line like prune docs/_build
might appear not to be doing anything if you don't have a docs/_build
directory at the moment (like after a clean checkout), but it will be doing something important if you happen to run make -C docs html
and build your Sphinx documentation.
That seems acceptable to me given that the proposal is for a warning rather than an error. For example, if there is a warning that docs/_build
doesn't exist, I think the user could surmise that the documents haven't been built.
BTW I would be very interested in seeing concrete examples of situations where you missed such warnings!
I'll let you know if I encounter any in the future. It's been a while since I filed this, so I can't remember the particular files unfortunately.
I have a concrete example.
Upon refactoring linters' configuration for the Resolwe project, the .pep8rc
file was deleted, however, it remained in the MANIFEST.in
file as include .pep8rc .pylintrc tox.ini
on line 9.
As mentioned in this issue report, this remained uncaught by the check-manifest
tool so it remained unnoticed until a developer spotted it and removed it.
Thank you, that is a useful example.