You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by to...@apache.org on 2013/08/01 14:41:15 UTC

[4/8] git commit: Add argparse dependency for Python < 2.6 and >= 3.1 and <= 3.2.

Add argparse dependency for Python < 2.6 and >= 3.1 and <= 3.2.


Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/cde33ec3
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/cde33ec3
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/cde33ec3

Branch: refs/heads/trunk
Commit: cde33ec3e5bd20387ff0ffa703c70afba9fdf334
Parents: 5660b33
Author: Tomaz Muraus <to...@tomaz.me>
Authored: Mon Jul 29 21:36:15 2013 +0200
Committer: Tomaz Muraus <to...@apache.org>
Committed: Thu Aug 1 14:30:03 2013 +0200

----------------------------------------------------------------------
 libcloud/utils/py3.py |  4 ++++
 setup.py              | 11 +++++++++--
 2 files changed, 13 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/cde33ec3/libcloud/utils/py3.py
----------------------------------------------------------------------
diff --git a/libcloud/utils/py3.py b/libcloud/utils/py3.py
index 206324e..1c44c27 100644
--- a/libcloud/utils/py3.py
+++ b/libcloud/utils/py3.py
@@ -28,6 +28,7 @@ PY2 = False
 PY25 = False
 PY27 = False
 PY3 = False
+PY31 = False
 PY32 = False
 
 if sys.version_info >= (2, 0) and sys.version_info < (3, 0):
@@ -42,6 +43,9 @@ if sys.version_info >= (2, 7) and sys.version_info <= (2, 8):
 if sys.version_info >= (3, 0):
     PY3 = True
 
+if sys.version_info >= (3, 1) and sys.version_info < (3, 2):
+    PY31 = True
+
 if sys.version_info >= (3, 2) and sys.version_info < (3, 3):
     PY32 = True
 

http://git-wip-us.apache.org/repos/asf/libcloud/blob/cde33ec3/setup.py
----------------------------------------------------------------------
diff --git a/setup.py b/setup.py
index fc82122..2bbeba7 100644
--- a/setup.py
+++ b/setup.py
@@ -31,7 +31,7 @@ except ImportError:
 
 import libcloud.utils.misc
 from libcloud.utils.dist import get_packages, get_data_files
-from libcloud.utils.py3 import unittest2_required
+from libcloud.utils.py3 import unittest2_required, PY31, PY32
 
 libcloud.utils.misc.SHOW_DEPRECATION_WARNING = False
 
@@ -229,6 +229,13 @@ class CoverageCommand(Command):
         cov.save()
         cov.html_report()
 
+if pre_python26:
+    dependencies = ['ssl', 'simplejson', 'argparse']
+elif PY31 or PY32:
+    dependencies = ['argparse']
+else:
+    dependencies = []
+
 
 setup(
     name='apache-libcloud',
@@ -238,7 +245,7 @@ setup(
                 ' and documentation, please see http://libcloud.apache.org',
     author='Apache Software Foundation',
     author_email='dev@libcloud.apache.org',
-    requires=([], ['ssl', 'simplejson'],)[pre_python26],
+    requires=dependencies,
     packages=get_packages('libcloud'),
     package_dir={
         'libcloud': 'libcloud',