summaryrefslogtreecommitdiff
path: root/pbr/packaging.py
diff options
context:
space:
mode:
authorMatthew Montgomery <matthew@signed8bit.com>2017-05-17 15:44:24 -0500
committerMatthew Montgomery <matthew@signed8bit.com>2017-05-18 08:51:35 -0500
commit2a0f2e589c1f6375e3d2093619dcbedb1aa3284d (patch)
tree3fcca2613b56586c4298bd620fcd916a04cf7a93 /pbr/packaging.py
parentc02406601a7d7c453c77318ff5b5af6d760e80ae (diff)
downloadpbr-2a0f2e589c1f6375e3d2093619dcbedb1aa3284d.tar.gz
Ignore index URL lines in requirements.txt files
Currently if an index is specified by either -i, --index-url or --extra-index-url, the following error may be encountered when setup is run. Invalid requirement, parse error at "u'-i https'" This patch ignores those lines in a requirements.txt file durning parsing. Closes-Bug: #1394999 Change-Id: Ie03f54ca7a7edad7a26fa1721f7b26532b65e760
Diffstat (limited to 'pbr/packaging.py')
-rw-r--r--pbr/packaging.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/pbr/packaging.py b/pbr/packaging.py
index a3527c9..105a010 100644
--- a/pbr/packaging.py
+++ b/pbr/packaging.py
@@ -102,6 +102,10 @@ def parse_requirements(requirements_files=None, strip_markers=False):
if (not line.strip()) or line.startswith('#'):
continue
+ # Ignore index URL lines
+ if re.match(r'^\s*(-i|--index-url|--extra-index-url).*', line):
+ continue
+
# Handle nested requirements files such as:
# -r other-requirements.txt
if line.startswith('-r'):