eucalyptus / calyptos

Tool for Managing Eucalyptus
BSD 2-Clause "Simplified" License
5 stars 14 forks source link

setup.py should not attempt to install argparse on python >= 2.7 #30

Closed gholms closed 9 years ago

gholms commented 9 years ago

The argparse module is part of the python standard library beginning with python 2.7. When run on a system with that version, setup.py still wants to download and install argparse despite that. The install_requires list should probably be defined in an if statement earlier in the file to prevent that from happening.

mbacchi commented 9 years ago

I'm looking to correct this using environment markers such as below. This works on 2.7 (in a virtualenv) but I see it still installs argparse due to another package requiring it apparently. (it installs argparse 1.3.0 whereas below I ask for 1.2.2).

diff --git a/setup.py b/setup.py
index 39146ef..a145ff7 100644
--- a/setup.py
+++ b/setup.py
@@ -5,6 +5,8 @@ from distutils.command.sdist import sdist
 import os.path
 import subprocess
 import glob
+import multiprocessing
+import sys

 from setuptools import setup, find_packages

@@ -87,8 +89,9 @@ setup(
     packages=find_packages(),
     test_suite='nose.collector',
     tests_require=['nose'],
-    install_requires=['fabric', 'PyYaml', 'argparse', 'stevedore', 'sphinx',
-                      'pbr >= 0.10.7', 'six >= 1.9.0'],
+    setup_requires=['pbr==0.11.0'] + (['argparse<=1.2.2'] if sys.version_info[:2] == (2, 6) else []),
+    install_requires=['pbr==0.11.0', 'fabric', 'PyYaml', 'stevedore<1.4.0', 'sphinx']
+                     + (['argparse<=1.2.2'] if sys.version_info[:2] == (2, 6) else []),
     scripts=['bin/calyptos'],
     classifiers=[
         'Development Status :: 5 - Production/Stable',
viglesiasce commented 9 years ago

Fixed here: e4b95c646bcd9f85338192aab86d735fa52d19e1