Merge pull request #2053 from nicoddemus/check-manifest-script

Use a wrapper script to bypass check-manifest if not under git
This commit is contained in:
Bruno Oliveira 2016-11-12 12:12:54 -02:00 committed by GitHub
commit 5185f2a6ae
3 changed files with 24 additions and 1 deletions

View File

@ -9,6 +9,8 @@ include HOWTORELEASE.rst
include tox.ini include tox.ini
include setup.py include setup.py
recursive-include scripts *.py
include .coveragerc include .coveragerc
recursive-include bench *.py recursive-include bench *.py

21
scripts/check-manifest.py Normal file
View File

@ -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)

View File

@ -52,7 +52,7 @@ deps =
restructuredtext_lint restructuredtext_lint
check-manifest check-manifest
commands = commands =
check-manifest {envpython} scripts/check-manifest.py
flake8 pytest.py _pytest testing flake8 pytest.py _pytest testing
rst-lint CHANGELOG.rst HOWTORELEASE.rst README.rst rst-lint CHANGELOG.rst HOWTORELEASE.rst README.rst