Skip to content

Commit 5185f2a

Browse files
authored
Merge pull request #2053 from nicoddemus/check-manifest-script
Use a wrapper script to bypass check-manifest if not under git
2 parents 71b6833 + 351395b commit 5185f2a

3 files changed

Lines changed: 24 additions & 1 deletion

File tree

MANIFEST.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ include HOWTORELEASE.rst
99
include tox.ini
1010
include setup.py
1111

12+
recursive-include scripts *.py
13+
1214
include .coveragerc
1315

1416
recursive-include bench *.py

scripts/check-manifest.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
"""
2+
Script used by tox.ini to check the manifest file if we are under version control, or skip the
3+
check altogether if not.
4+
5+
"check-manifest" will needs a vcs to work, which is not available when testing the package
6+
instead of the source code (with ``devpi test`` for example).
7+
"""
8+
9+
from __future__ import print_function
10+
11+
import os
12+
import subprocess
13+
import sys
14+
15+
16+
if os.path.isdir('.git'):
17+
sys.exit(subprocess.call('check-manifest', shell=True))
18+
else:
19+
print('No .git directory found, skipping checking the manifest file')
20+
sys.exit(0)
21+

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ deps =
5252
restructuredtext_lint
5353
check-manifest
5454
commands =
55-
check-manifest
55+
{envpython} scripts/check-manifest.py
5656
flake8 pytest.py _pytest testing
5757
rst-lint CHANGELOG.rst HOWTORELEASE.rst README.rst
5858

0 commit comments

Comments
 (0)