Skip to content

Commit c0b1ceb

Browse files
committed
Use a wrapper script to bypass check-manifest if not under git
Related to comment in #2051
1 parent 5717c71 commit c0b1ceb

2 files changed

Lines changed: 22 additions & 2 deletions

File tree

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 & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,14 @@ commands=
4444

4545

4646
[testenv:linting]
47-
basepython = python2.7
4847
deps =
4948
flake8
5049
# pygments required by rst-lint
5150
pygments
5251
restructuredtext_lint
5352
check-manifest
5453
commands =
55-
check-manifest
54+
{envpython} scripts/check-manifest.py
5655
flake8 pytest.py _pytest testing
5756
rst-lint CHANGELOG.rst HOWTORELEASE.rst README.rst
5857

0 commit comments

Comments
 (0)