summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2015-09-28 19:52:50 +0300
committerLars Wirzenius <liw@liw.fi>2015-09-28 19:52:50 +0300
commitf77c134e4c2cfa3967534bc107ebcacd8785e8df (patch)
tree0773b02d49272c449fa21f2a3af825276314ed23
parent7120bb1c3df3e034060ed922b21dd49a13508b84 (diff)
downloadobnam-f77c134e4c2cfa3967534bc107ebcacd8785e8df.tar.gz
Run pylint only if >= 1.3.1, and fix same for pep8
-rwxr-xr-xsetup.py20
1 files changed, 16 insertions, 4 deletions
diff --git a/setup.py b/setup.py
index 3c3a9e0b..7d5768d1 100755
--- a/setup.py
+++ b/setup.py
@@ -255,13 +255,25 @@ class Check(Command):
# 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):
+ if parts >= ['1', '5', '7']:
+ print 'running pep8'
cliapp.runcmd(['pep8', 'obnamlib'], stdout=None, stderr=None)
+ else:
+ print 'not running pep8'
def check_with_pylint(self):
- cliapp.runcmd(
- ['pylint', '--rcfile=pylint.conf', 'obnamlib'],
- stdout=None, stderr=None)
+ output = cliapp.runcmd(['pylint', '--version'])
+ parts = output.splitlines()[0].split('.')
+ # pylint version 1.3.1 is in Debian jessie. Previous versions
+ # do not know all the things in the pylint.conf file we use,
+ # so we only run pylint if it's new enough.
+ if parts >= ['pylint 1', '3', '1,']:
+ print 'running pylint'
+ cliapp.runcmd(
+ ['pylint', '--rcfile=pylint.conf', 'obnamlib'],
+ stdout=None, stderr=None)
+ else:
+ print 'not running pylint', parts
def check_sources_for_nitpicks(self, sources):
cliapp.runcmd(['./nitpicker'] + sources, stdout=None, stderr=None)