summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2013-08-04 09:30:58 +0100
committerLars Wirzenius <liw@liw.fi>2013-08-04 09:30:58 +0100
commitac488ec7c4a686ead0d652645019f8096efcc301 (patch)
tree5f931bbe846da281147f50029012ec869eece144
parent7146230e5061beb258241d077d5b79f545195ccc (diff)
downloadobnam-ac488ec7c4a686ead0d652645019f8096efcc301.tar.gz
Only run yarn tests when yarn's available
-rw-r--r--setup.py23
1 files changed, 21 insertions, 2 deletions
diff --git a/setup.py b/setup.py
index 56ee378a..cc9872c6 100644
--- a/setup.py
+++ b/setup.py
@@ -27,6 +27,23 @@ import sys
import tempfile
+# We need to know whether we can run yarn. We do this by checking
+# the python-markdown version: if it's new enough, we assume yarn
+# is available, and if it isn't, yarn won't be available since it
+# won't work with old versions (e.g., the one in Debian squeeze.)
+
+try:
+ import markdown
+except ImportError:
+ got_yarn = False
+else:
+ if (hasattr(markdown, 'extensions') and
+ hasattr(markdown.extensions, 'Extension')):
+ got_yarn = True
+ else:
+ got_yarn = False
+
+
def runcmd(*args, **kwargs):
try:
subprocess.check_call(*args, **kwargs)
@@ -99,8 +116,10 @@ class Check(Command):
if local and fast:
print "run black box tests"
runcmd(['cmdtest', 'tests'])
- runcmd(
- ['yarn', '-s', 'yarns/obnam.sh'] + glob.glob('yarns/*.yarn'))
+ if got_yarn:
+ runcmd(
+ ['yarn', '-s', 'yarns/obnam.sh'] +
+ glob.glob('yarns/*.yarn'))
num_clients = '2'
num_generations = '16'