diff --git a/MANIFEST.in b/MANIFEST.in index 0c5bfd552..24b4cfc9b 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -9,6 +9,8 @@ include HOWTORELEASE.rst include tox.ini include setup.py +recursive-include scripts *.py + include .coveragerc recursive-include bench *.py diff --git a/scripts/check-manifest.py b/scripts/check-manifest.py new file mode 100644 index 000000000..5911a84fe --- /dev/null +++ b/scripts/check-manifest.py @@ -0,0 +1,21 @@ +""" +Script used by tox.ini to check the manifest file if we are under version control, or skip the +check altogether if not. + +"check-manifest" will needs a vcs to work, which is not available when testing the package +instead of the source code (with ``devpi test`` for example). +""" + +from __future__ import print_function + +import os +import subprocess +import sys + + +if os.path.isdir('.git'): + sys.exit(subprocess.call('check-manifest', shell=True)) +else: + print('No .git directory found, skipping checking the manifest file') + sys.exit(0) + diff --git a/tox.ini b/tox.ini index 17fe0e3e4..efa3ad2f1 100644 --- a/tox.ini +++ b/tox.ini @@ -52,7 +52,7 @@ deps = restructuredtext_lint check-manifest commands = - check-manifest + {envpython} scripts/check-manifest.py flake8 pytest.py _pytest testing rst-lint CHANGELOG.rst HOWTORELEASE.rst README.rst