From cfb437e72052ab65bc8d3d0748827c65c6d894bb Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Wed, 20 Jun 2012 07:46:43 -0700 Subject: Skip argparse when injecting requirements. Python 2.7 doesn't need argparse. Although pip installs are fine installing it, listing the requirement in install_requires causes havoc for distro installs which do not explicitly install argparse for 2.7 as a package. Fixes bug 1013953 Change-Id: I0275d02e15c8fd2e63b88213ac32f6dd18e2fd26 --- keystoneclient/openstack/common/setup.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/keystoneclient/openstack/common/setup.py b/keystoneclient/openstack/common/setup.py index 429ba35..6b34417 100644 --- a/keystoneclient/openstack/common/setup.py +++ b/keystoneclient/openstack/common/setup.py @@ -22,6 +22,7 @@ Utilities with minimum-depends for use in setup.py import os import re import subprocess +import sys from setuptools.command import sdist @@ -76,6 +77,10 @@ def parse_requirements(requirements_files=['requirements.txt', # -f lines are for index locations, and don't get used here elif re.match(r'\s*-f\s+', line): pass + # argparse is part of the standard library starting with 2.7 + # adding it to the requirements list screws distro installs + elif line == 'argparse' and sys.version_info >= (2, 7): + pass else: requirements.append(line) -- cgit v1.2.1