From 5f725aa613fc49b27842677a7bcfbc84423086a3 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Sat, 31 May 2014 16:29:18 +0100 Subject: Run pep8 in "setup.py check" --- setup.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'setup.py') diff --git a/setup.py b/setup.py index 6e794cc..03c643d 100644 --- a/setup.py +++ b/setup.py @@ -32,11 +32,13 @@ class Check(Command): user_options = [ ('unit-tests', 'u', 'run unit tests?'), ('yarns', 'y', 'run yarn tests locally?'), + ('pep8', '8', 'run pep8 on the source?'), ] def set_all_options(self, new_value): self.unit_tests = new_value self.yarns = new_value + self.pep8 = new_value def initialize_options(self): self.set_all_options(False) @@ -44,7 +46,8 @@ class Check(Command): def finalize_options(self): any_set = ( self.unit_tests or - self.yarns) + self.yarns or + self.pep8) if not any_set: self.set_all_options(True) @@ -55,6 +58,9 @@ class Check(Command): if self.yarns: self.run_yarns() + if self.pep8: + self.run_pep8() + def run_unit_tests(self): cliapp.runcmd( ['python', '-m', 'CoverageTestRunner', @@ -67,6 +73,9 @@ class Check(Command): ['yarn'] + glob.glob('yarns/*.yarn'), stdout=None, stderr=None) + def run_pep8(self): + cliapp.runcmd(['pep8', 'distixlib'], stdout=None, stderr=None) + setup(name='distix', version=distixlib.version.version_string, -- cgit v1.2.1