From 314fa34b75307c51a1eaf7c9eab9033b2cdc2d48 Mon Sep 17 00:00:00 2001 From: Bhuvan Arumugam Date: Fri, 1 Jun 2012 23:52:38 -0700 Subject: [PATCH] Auto generate AUTHORS file for python-cinderclient component. Bug: 976267 Now that git commits are gated by CLA, we shouldn't enforce committers to add an entry in AUTHORS file. The AUTHORS file should be generated automatically, based on git commits. This commit fixes the problem. * AUTHORS Remove this file. * .gitignore Add AUTHORS file. * cinderclient/shell.py pep8 fix. Change-Id: I4e3c4524fc71a11f11b48fcb6abb99e6c7f33e90 --- .gitignore | 1 + AUTHORS | 0 cinderclient/openstack/common/setup.py | 17 +++++++++++++++++ cinderclient/shell.py | 2 +- 4 files changed, 19 insertions(+), 1 deletion(-) delete mode 100644 AUTHORS diff --git a/.gitignore b/.gitignore index 28d20be52..22e02ac76 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ cover .idea *.swp *~ +AUTHORS build dist python_novaclient.egg-info diff --git a/AUTHORS b/AUTHORS deleted file mode 100644 index e69de29bb..000000000 diff --git a/cinderclient/openstack/common/setup.py b/cinderclient/openstack/common/setup.py index 50c59db38..79b5a62bc 100644 --- a/cinderclient/openstack/common/setup.py +++ b/cinderclient/openstack/common/setup.py @@ -61,9 +61,19 @@ def parse_requirements(requirements_files=['requirements.txt', 'tools/pip-requires']): requirements = [] for line in get_reqs_from_files(requirements_files): + # For the requirements list, we need to inject only the portion + # after egg= so that distutils knows the package it's looking for + # such as: + # -e git://github.com/openstack/nova/master#egg=nova if re.match(r'\s*-e\s+', line): requirements.append(re.sub(r'\s*-e\s+.*#egg=(.*)$', r'\1', line)) + # such as: + # http://github.com/openstack/nova/zipball/master#egg=nova + elif re.match(r'\s*https?:', line): + requirements.append(re.sub(r'\s*https?:.*#egg=(.*)$', r'\1', + line)) + # -f lines are for index locations, and don't get used here elif re.match(r'\s*-f\s+', line): pass else: @@ -75,11 +85,18 @@ def parse_requirements(requirements_files=['requirements.txt', def parse_dependency_links(requirements_files=['requirements.txt', 'tools/pip-requires']): dependency_links = [] + # dependency_links inject alternate locations to find packages listed + # in requirements for line in get_reqs_from_files(requirements_files): + # skip comments and blank lines if re.match(r'(\s*#)|(\s*$)', line): continue + # lines with -e or -f need the whole line, minus the flag if re.match(r'\s*-[ef]\s+', line): dependency_links.append(re.sub(r'\s*-[ef]\s+', '', line)) + # lines that are only urls can go in unmolested + elif re.match(r'\s*https?:', line): + dependency_links.append(line) return dependency_links diff --git a/cinderclient/shell.py b/cinderclient/shell.py index 25d55363b..3b05b15c9 100644 --- a/cinderclient/shell.py +++ b/cinderclient/shell.py @@ -69,7 +69,7 @@ class OpenStackCinderShell(object): parser = CinderClientArgumentParser( prog='cinder', description=__doc__.strip(), - epilog='See "cinder help COMMAND" '\ + epilog='See "cinder help COMMAND" ' 'for help on a specific command.', add_help=False, formatter_class=OpenStackHelpFormatter,