| 1 |
check-manifest |
| 2 |
============== |
| 3 |
|
| 4 |
|buildstatus|_ |coverage|_ |
| 5 |
|
| 6 |
Are you a Python developer? Have you uploaded packages to the Python Package |
| 7 |
Index? Have you accidentally uploaded *broken* packages with some files |
| 8 |
missing? If so, check-manifest is for you. |
| 9 |
|
| 10 |
Quick start |
| 11 |
----------- |
| 12 |
|
| 13 |
:: |
| 14 |
|
| 15 |
$ pip install check-manifest |
| 16 |
|
| 17 |
$ cd ~/src/mygreatpackage |
| 18 |
$ check-manifest |
| 19 |
|
| 20 |
You can ask the script to help you update your MANIFEST.in:: |
| 21 |
|
| 22 |
$ check-manifest -u -v |
| 23 |
listing source files under version control: 6 files and directories |
| 24 |
building an sdist: check-manifest-0.7.tar.gz: 4 files and directories |
| 25 |
lists of files in version control and sdist do not match! |
| 26 |
missing from sdist: |
| 27 |
tests.py |
| 28 |
tox.ini |
| 29 |
suggested MANIFEST.in rules: |
| 30 |
include *.py |
| 31 |
include tox.ini |
| 32 |
updating MANIFEST.in |
| 33 |
|
| 34 |
$ cat MANIFEST.in |
| 35 |
include *.rst |
| 36 |
|
| 37 |
# added by check_manifest.py |
| 38 |
include *.py |
| 39 |
include tox.ini |
| 40 |
|
| 41 |
|
| 42 |
Command-line reference |
| 43 |
---------------------- |
| 44 |
|
| 45 |
:: |
| 46 |
|
| 47 |
$ check-manifest --help |
| 48 |
usage: check-manifest [-h] [--version] [-v] [-c] [-u] [-p PYTHON] |
| 49 |
[--ignore patterns] |
| 50 |
[source_tree] |
| 51 |
|
| 52 |
Check a Python MANIFEST.in file for completeness |
| 53 |
|
| 54 |
positional arguments: |
| 55 |
source_tree location for the source tree (default: .) |
| 56 |
|
| 57 |
optional arguments: |
| 58 |
-h, --help show this help message and exit |
| 59 |
--version show program's version number and exit |
| 60 |
-v, --verbose more verbose output (default: False) |
| 61 |
-c, --create create a MANIFEST.in if missing (default: False) |
| 62 |
-u, --update append suggestions to MANIFEST.in (implies --create) |
| 63 |
(default: False) |
| 64 |
-p PYTHON, --python PYTHON |
| 65 |
use this Python interpreter for running setup.py sdist |
| 66 |
(default: /home/mg/.venv/bin/python) |
| 67 |
--ignore patterns ignore files/directories matching these comma- |
| 68 |
separated patterns (default: None) |
| 69 |
--ignore-bad-ideas patterns |
| 70 |
ignore bad idea files/directories matching these |
| 71 |
comma-separated patterns (default: []) |
| 72 |
|
| 73 |
|
| 74 |
Configuration |
| 75 |
------------- |
| 76 |
|
| 77 |
You can configure check-manifest to ignore certain file patterns using |
| 78 |
a ``[tool.check-manifest]`` section in your ``pyproject.toml`` file or |
| 79 |
a ``[check-manifest]`` section in either ``setup.cfg`` or |
| 80 |
``tox.ini``. Examples:: |
| 81 |
|
| 82 |
# pyproject.toml |
| 83 |
[tool.check-manifest] |
| 84 |
ignore = [".travis.yml"] |
| 85 |
|
| 86 |
# setup.cfg or tox.ini |
| 87 |
[check-manifest] |
| 88 |
ignore = |
| 89 |
.travis.yml |
| 90 |
|
| 91 |
Note that lists are newline separated in the ``setup.cfg`` and |
| 92 |
``tox.ini`` files. |
| 93 |
|
| 94 |
The following options are recognized: |
| 95 |
|
| 96 |
ignore |
| 97 |
A list of filename patterns that will be ignored by check-manifest. |
| 98 |
Use this if you want to keep files in your version control system |
| 99 |
that shouldn't be included in your source distributions. The |
| 100 |
default ignore list is :: |
| 101 |
|
| 102 |
PKG-INFO |
| 103 |
*.egg-info |
| 104 |
*.egg-info/* |
| 105 |
setup.cfg |
| 106 |
.hgtags |
| 107 |
.hgsigs |
| 108 |
.hgignore |
| 109 |
.gitignore |
| 110 |
.bzrignore |
| 111 |
.gitattributes |
| 112 |
.github/* |
| 113 |
.travis.yml |
| 114 |
Jenkinsfile |
| 115 |
*.mo |
| 116 |
|
| 117 |
ignore-default-rules |
| 118 |
If set to ``true``, your ``ignore`` patterns will replace the default |
| 119 |
ignore list instead of adding to it. |
| 120 |
|
| 121 |
ignore-bad-ideas |
| 122 |
A list of filename patterns that will be ignored by |
| 123 |
check-manifest's generated files check. Use this if you want to |
| 124 |
keep generated files in your version control system, even though |
| 125 |
it is generally a bad idea. |
| 126 |
|
| 127 |
|
| 128 |
Version control integration |
| 129 |
--------------------------- |
| 130 |
|
| 131 |
With `pre-commit <https://pre-commit.com>`_, check-manifest can be part of your |
| 132 |
git-workflow. Add the following to your ``.pre-commit-config.yaml``. |
| 133 |
|
| 134 |
.. code-block:: yaml |
| 135 |
|
| 136 |
repos: |
| 137 |
- repo: https://github.com/mgedmin/check-manifest |
| 138 |
rev: "0.51" |
| 139 |
hooks: |
| 140 |
- id: check-manifest |
| 141 |
|
| 142 |
If you are running pre-commit without a network, you can utilize |
| 143 |
``args: [--no-build-isolation]`` to prevent a ``pip install`` reaching out to |
| 144 |
PyPI. This makes ``python -m build`` ignore your ``build-system.requires``, |
| 145 |
so you'll want to list them all in ``additional_dependencies``. |
| 146 |
|
| 147 |
.. code-block:: yaml |
| 148 |
|
| 149 |
repos: |
| 150 |
- repo: https://github.com/mgedmin/check-manifest |
| 151 |
rev: "0.51" |
| 152 |
hooks: |
| 153 |
- id: check-manifest |
| 154 |
args: [--no-build-isolation] |
| 155 |
additional_dependencies: [setuptools, wheel, setuptools-scm] |
| 156 |
|
| 157 |
|
| 158 |
.. |buildstatus| image:: https://github.com/mgedmin/check-manifest/actions/workflows/build.yml/badge.svg?branch=master |
| 159 |
.. _buildstatus: https://github.com/mgedmin/check-manifest/actions |
| 160 |
|
| 161 |
.. |coverage| image:: https://coveralls.io/repos/mgedmin/check-manifest/badge.svg?branch=master |
| 162 |
.. _coverage: https://coveralls.io/r/mgedmin/check-manifest |