diff setup.py @ 109:204cac15c06a

If sphinx isn't available, doctests aren't run (but unit tests are).
author Atul Varma <varmaa@toolness.com>
date Sun, 16 Aug 2009 20:48:11 +0000
parents 7f3a91323a88
children ac8ca0ee7760
line wrap: on
line diff
--- a/setup.py	Sun Aug 16 13:37:13 2009 -0700
+++ b/setup.py	Sun Aug 16 20:48:11 2009 +0000
@@ -23,10 +23,9 @@
 
 # This code is run if we're executed as a pavement script by paver.
 
-import os
 import subprocess
 import shutil
-import sys
+import errno
 import webbrowser
 import urllib
 import urllib2
@@ -238,10 +237,18 @@
 
     print "Running doctests."
 
-    retval = subprocess.call(["sphinx-build",
-                              "-b", "doctest",
-                              os.path.join("docs", "src"),
-                              DOCTEST_OUTPUT_DIR],
-                             env = new_env)
+    try:
+        retval = subprocess.call(["sphinx-build",
+                                  "-b", "doctest",
+                                  os.path.join("docs", "src"),
+                                  DOCTEST_OUTPUT_DIR],
+                                 env = new_env)
+    except OSError, e:
+        if e.errno == errno.ENOENT:
+            print "Sphinx not found, skipping doctests."
+            retval = 0
+        else:
+            raise
+
     if retval:
         sys.exit(retval)