libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From je...@apache.org
Subject svn commit: r1055277 - /incubator/libcloud/trunk/setup.py
Date Wed, 05 Jan 2011 02:53:55 GMT
Author: jerry
Date: Wed Jan  5 02:53:55 2011
New Revision: 1055277

URL: http://svn.apache.org/viewvc?rev=1055277&view=rev
Log:
Provide dependency hints for <2.6, much like test/secrets.py-dist hint

Modified:
    incubator/libcloud/trunk/setup.py

Modified: incubator/libcloud/trunk/setup.py
URL: http://svn.apache.org/viewvc/incubator/libcloud/trunk/setup.py?rev=1055277&r1=1055276&r2=1055277&view=diff
==============================================================================
--- incubator/libcloud/trunk/setup.py (original)
+++ incubator/libcloud/trunk/setup.py Wed Jan  5 02:53:55 2011
@@ -38,10 +38,27 @@ class TestCommand(Command):
     def run(self):
         secrets = pjoin(self._dir, 'test', 'secrets.py')
         if not os.path.isfile(secrets):
-          print "Missing %s" % (secrets)
-          print "Maybe you forgot to copy it from -dist:"
-          print "  cp test/secrets.py-dist test/secrets.py"
-          sys.exit(1)
+            print "Missing %s" % (secrets)
+            print "Maybe you forgot to copy it from -dist:"
+            print "  cp test/secrets.py-dist test/secrets.py"
+            sys.exit(1)
+
+        pre_python26 = (sys.version_info[0] == 2
+                        and sys.version_info[1] < 6)
+        if pre_python26:
+            missing = []
+            # test for dependencies
+            try:
+                import simplejson
+            except ImportError:
+                missing.append("simplejson")
+
+            try:
+                import ssl
+            except ImportError:
+                missing.append("ssl")
+            print "Missing dependencies: %s" % ", ".join(missing)
+            sys.exit(1)
 
         testfiles = []
         for t in glob(pjoin(self._dir, 'test', 'test_*.py')):



Mime
View raw message