summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2015-09-26 15:56:29 +0300
committerLars Wirzenius <liw@liw.fi>2015-09-26 15:56:29 +0300
commitbf91f20962206f73b4f0587887dcda4bc75efac0 (patch)
tree33c2bcc4f8dbd5ca06352324645bb88507453db1
parent122028302eda53b9d7dca49616ff340ee88da8b7 (diff)
downloadobnam-bf91f20962206f73b4f0587887dcda4bc75efac0.tar.gz
Run pep8 conditionally depending on its version
-rwxr-xr-xsetup.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/setup.py b/setup.py
index a913274b..3c3a9e0b 100755
--- a/setup.py
+++ b/setup.py
@@ -249,7 +249,14 @@ class Check(Command):
print "no .git, no nitpick for you"
def check_with_pep8(self):
- cliapp.runcmd(['pep8', 'obnamlib'], stdout=None, stderr=None)
+ output = cliapp.runcmd(['pep8', '--version'])
+ parts = output.strip().split('.')
+ # pep8 version 1.5.7 is in Debian jessie. Previous versions
+ # give bad warnings about whitespace around some operators,
+ # and later versions don't. So we only run pep8 if it's new
+ # enough.
+ if parts >= (1,5,7):
+ cliapp.runcmd(['pep8', 'obnamlib'], stdout=None, stderr=None)
def check_with_pylint(self):
cliapp.runcmd(