summaryrefslogtreecommitdiff
path: root/pbr/packaging.py
diff options
context:
space:
mode:
authorWei Tie <nuaafe@gmail.com>2018-08-08 18:03:31 -0700
committerWei Tie <nuaafe@gmail.com>2018-08-23 10:46:56 -0700
commitbca35333bcc1102040158ca97f2aac3bd932430b (patch)
tree3b2844a7f3d548e05cc483f965841c1beda94778 /pbr/packaging.py
parent033c1bdee80e8d141da01385a5104f84df41208f (diff)
downloadpbr-bca35333bcc1102040158ca97f2aac3bd932430b.tar.gz
Support subdirectory in the url
Pip supports git+https://foo.com/zipball#egg=bar&subdirectory=baz when setup.py is not at the root directory of the project [1]. This commit keeps pbr function in this case. [1] https://pip.pypa.io/en/latest/reference/pip_install/#vcs-support Change-Id: I70dac755caacc89859a8646c090b69800401bbc0 Closes-Bug: 1786306 Signed-off-by: Wei Tie <nuaafe@gmail.com>
Diffstat (limited to 'pbr/packaging.py')
-rw-r--r--pbr/packaging.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/pbr/packaging.py b/pbr/packaging.py
index 8656a6c..bb0ec6b 100644
--- a/pbr/packaging.py
+++ b/pbr/packaging.py
@@ -137,13 +137,15 @@ def parse_requirements(requirements_files=None, strip_markers=False):
# such as:
# -e git://github.com/openstack/nova/master#egg=nova
# -e git://github.com/openstack/nova/master#egg=nova-1.2.3
+ # -e git+https://foo.com/zipball#egg=bar&subdirectory=baz
if re.match(r'\s*-e\s+', line):
- line = 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
+ # git+https://foo.com/zipball#egg=bar&subdirectory=baz
elif re.match(r'\s*(https?|git(\+(https|ssh))?):', line):
- line = re.sub(r'\s*(https?|git(\+(https|ssh))?):.*#egg=(.*)$',
+ line = re.sub(r'\s*(https?|git(\+(https|ssh))?):.*#egg=([^&]+).*$',
egg_fragment, line)
# -f lines are for index locations, and don't get used here
elif re.match(r'\s*-f\s+', line):