{"action":"created","issue":{"url":"https://api.github.com/repos/eucalyptus/calyptos/issues/30","labels_url":"https://api.github.com/repos/eucalyptus/calyptos/issues/30/labels{/name}","comments_url":"https://api.github.com/repos/eucalyptus/calyptos/issues/30/comments","events_url":"https://api.github.com/repos/eucalyptus/calyptos/issues/30/events","html_url":"https://github.com/eucalyptus/calyptos/issues/30","id":97168911,"number":30,"title":"setup.py should not attempt to install argparse on python >= 2.7","user":{"login":"gholms","id":92943,"avatar_url":"https://avatars.githubusercontent.com/u/92943?v=3","gravatar_id":"","url":"https://api.github.com/users/gholms","html_url":"https://github.com/gholms","followers_url":"https://api.github.com/users/gholms/followers","following_url":"https://api.github.com/users/gholms/following{/other_user}","gists_url":"https://api.github.com/users/gholms/gists{/gist_id}","starred_url":"https://api.github.com/users/gholms/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gholms/subscriptions","organizations_url":"https://api.github.com/users/gholms/orgs","repos_url":"https://api.github.com/users/gholms/repos","events_url":"https://api.github.com/users/gholms/events{/privacy}","received_events_url":"https://api.github.com/users/gholms/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-24T23:34:21Z","updated_at":"2015-07-31T15:47:31Z","closed_at":null,"body":"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."},"comment":{"url":"https://api.github.com/repos/eucalyptus/calyptos/issues/comments/126729593","html_url":"https://github.com/eucalyptus/calyptos/issues/30#issuecomment-126729593","issue_url":"https://api.github.com/repos/eucalyptus/calyptos/issues/30","id":126729593,"user":{"login":"mbacchi","id":6763301,"avatar_url":"https://avatars.githubusercontent.com/u/6763301?v=3","gravatar_id":"","url":"https://api.github.com/users/mbacchi","html_url":"https://github.com/mbacchi","followers_url":"https://api.github.com/users/mbacchi/followers","following_url":"https://api.github.com/users/mbacchi/following{/other_user}","gists_url":"https://api.github.com/users/mbacchi/gists{/gist_id}","starred_url":"https://api.github.com/users/mbacchi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbacchi/subscriptions","organizations_url":"https://api.github.com/users/mbacchi/orgs","repos_url":"https://api.github.com/users/mbacchi/repos","events_url":"https://api.github.com/users/mbacchi/events{/privacy}","received_events_url":"https://api.github.com/users/mbacchi/received_events","type":"User","site_admin":false},"created_at":"2015-07-31T15:47:31Z","updated_at":"2015-07-31T15:47:31Z","body":"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).\r\n\r\ndiff --git a/setup.py b/setup.py\r\nindex 39146ef..a145ff7 100644\r\n--- a/setup.py\r\n+++ b/setup.py\r\n@@ -5,6 +5,8 @@ from distutils.command.sdist import sdist\r\n import os.path\r\n import subprocess\r\n import glob\r\n+import multiprocessing\r\n+import sys\r\n \r\n from setuptools import setup, find_packages\r\n \r\n@@ -87,8 +89,9 @@ setup(\r\n     packages=find_packages(),\r\n     test_suite='nose.collector',\r\n     tests_require=['nose'],\r\n-    install_requires=['fabric', 'PyYaml', 'argparse', 'stevedore', 'sphinx',\r\n-                      'pbr >= 0.10.7', 'six >= 1.9.0'],\r\n+    setup_requires=['pbr==0.11.0'] + (['argparse<=1.2.2'] if sys.version_info[:2] == (2, 6) else []),\r\n+    install_requires=['pbr==0.11.0', 'fabric', 'PyYaml', 'stevedore<1.4.0', 'sphinx']\r\n+                     + (['argparse<=1.2.2'] if sys.version_info[:2] == (2, 6) else []),\r\n     scripts=['bin/calyptos'],\r\n     classifiers=[\r\n         'Development Status :: 5 - Production/Stable',\r\n"}}