From f77c134e4c2cfa3967534bc107ebcacd8785e8df Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Mon, 28 Sep 2015 19:52:50 +0300 Subject: Run pylint only if >= 1.3.1, and fix same for pep8 --- setup.py | 20 ++++++++++++++++---- 1 file 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) -- cgit v1.2.1