diff options
-rw-r--r-- | setup.py | 25 |
1 files changed, 20 insertions, 5 deletions
@@ -26,13 +26,27 @@ import subprocess import cmdtestlib +try: + import markdown +except ImportError: + markdown_version = None +else: + if (hasattr(markdown, 'extensions') and + hasattr(markdown.extensions, 'Extension')): + markdown_version = True + else: + markdown_version = False + class GenerateManpage(build): def run(self): build.run(self) print 'building manpages' - for x in ['cmdtest', 'yarn']: + cmds = ['cmdtest'] + if markdown_version: + cmds.append('yarn') + for x in cmds: with open('%s.1' % x, 'w') as f: subprocess.check_call(['python', x, '--generate-manpage=%s.1.in' % x, @@ -59,10 +73,11 @@ class Check(Command): pass def run(self): - subprocess.check_call( - ['python', '-m', 'CoverageTestRunner', - '--ignore-missing-from', 'without-tests']) - os.remove('.coverage') + if markdown_version: + subprocess.check_call( + ['python', '-m', 'CoverageTestRunner', + '--ignore-missing-from', missing_from]) + os.remove('.coverage') subprocess.check_call(['./cmdtest', 'echo-tests']) subprocess.check_call(['./cmdtest', 'sort-tests']) |