summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMonty Taylor <mordred@inaugust.com>2013-10-30 21:05:33 +0000
committerMonty Taylor <mordred@inaugust.com>2013-11-14 06:22:30 -0500
commit007156c3472e18fdea5d538545b9e9b42810ddfe (patch)
tree378022c9aa0a55dfe0b18dbdc950c4cf9cc81431
parentefe5028569cfb045d54383adb3cb65646e07dee4 (diff)
downloadpbr-007156c3472e18fdea5d538545b9e9b42810ddfe.tar.gz
Communicate to user when we skip a requirement
We skip several requirements on python >= 2.6 because they are only needed on 2.6 but there is no good way to express that in requirements.txt. This can be confusing to users, because they may not be expecting such a thing and may think something broke. Print a message to the info log to that the user can see that we chose to not install their non-needed requirement. Change-Id: I11de12351123bbf406f77cf402feeab0e5dff26b
-rw-r--r--pbr/packaging.py20
1 files changed, 11 insertions, 9 deletions
diff --git a/pbr/packaging.py b/pbr/packaging.py
index a90482c..ca301fa 100644
--- a/pbr/packaging.py
+++ b/pbr/packaging.py
@@ -159,24 +159,26 @@ def parse_requirements(requirements_files=None):
# -e git://github.com/openstack/nova/master#egg=nova
# -e git://github.com/openstack/nova/master#egg=nova-1.2.3
if re.match(r'\s*-e\s+', line):
- requirements.append(re.sub(r'\s*-e\s+.*#egg=(.*)$',
- egg_fragment,
- line))
+ line = re.sub(r'\s*-e\s+.*#egg=(.*)$', egg_fragment, line)
# such as:
# http://github.com/openstack/nova/zipball/master#egg=nova
# http://github.com/openstack/nova/zipball/master#egg=nova-1.2.3
elif re.match(r'\s*https?:', line):
- requirements.append(re.sub(r'\s*https?:.*#egg=(.*)$',
- egg_fragment,
- line))
+ line = re.sub(r'\s*https?:.*#egg=(.*)$', egg_fragment, line)
# -f lines are for index locations, and don't get used here
elif re.match(r'\s*-f\s+', line):
- pass
+ line = None
+ reason = 'Index Location'
elif (project_name and
project_name in BROKEN_ON_27 and sys.version_info >= (2, 7)):
- pass
- else:
+ line = None
+ reason = 'Python 2.6 only dependency'
+
+ if line is not None:
requirements.append(line)
+ else:
+ log.info(
+ '[pbr] Excluding %s: %s' % (project_name, reason))
return requirements