summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2019-01-22 21:04:45 +0000
committerGerrit Code Review <review@openstack.org>2019-01-22 21:04:45 +0000
commit7909c7afd31debbc64786c891cacdd39a9932eb8 (patch)
tree0995280c8d05326dcd179fbc2f646a27cb7e0e11
parenta9b31113b76bde3debc696c1ce71aa7dd594faa3 (diff)
parentbc4193b183bb58c56cb3b46c04b763aebba09c54 (diff)
downloadpbr-7909c7afd31debbc64786c891cacdd39a9932eb8.tar.gz
Merge "Ignore --find-links in requirements file"5.1.2
-rw-r--r--pbr/packaging.py3
-rw-r--r--pbr/tests/test_packaging.py10
-rw-r--r--releasenotes/notes/ignore-find-links-07cf54f465aa33a6.yaml6
3 files changed, 14 insertions, 5 deletions
diff --git a/pbr/packaging.py b/pbr/packaging.py
index 77a4b22..baffdb2 100644
--- a/pbr/packaging.py
+++ b/pbr/packaging.py
@@ -118,7 +118,8 @@ def parse_requirements(requirements_files=None, strip_markers=False):
continue
# Ignore index URL lines
- if re.match(r'^\s*(-i|--index-url|--extra-index-url).*', line):
+ if re.match(r'^\s*(-i|--index-url|--extra-index-url|--find-links).*',
+ line):
continue
# Handle nested requirements files such as:
diff --git a/pbr/tests/test_packaging.py b/pbr/tests/test_packaging.py
index d19dd05..853844f 100644
--- a/pbr/tests/test_packaging.py
+++ b/pbr/tests/test_packaging.py
@@ -531,11 +531,13 @@ class ParseRequirementsTest(base.BaseTestCase):
tempdir = tempfile.mkdtemp()
requirements = os.path.join(tempdir, 'requirements.txt')
with open(requirements, 'w') as f:
- f.write('-i https://myindex.local')
- f.write(' --index-url https://myindex.local')
- f.write(' --extra-index-url https://myindex.local')
+ f.write('-i https://myindex.local\n')
+ f.write(' --index-url https://myindex.local\n')
+ f.write(' --extra-index-url https://myindex.local\n')
+ f.write('--find-links https://myindex.local\n')
+ f.write('arequirement>=1.0\n')
result = packaging.parse_requirements([requirements])
- self.assertEqual([], result)
+ self.assertEqual(['arequirement>=1.0'], result)
def test_nested_requirements(self):
tempdir = tempfile.mkdtemp()
diff --git a/releasenotes/notes/ignore-find-links-07cf54f465aa33a6.yaml b/releasenotes/notes/ignore-find-links-07cf54f465aa33a6.yaml
new file mode 100644
index 0000000..0d10a26
--- /dev/null
+++ b/releasenotes/notes/ignore-find-links-07cf54f465aa33a6.yaml
@@ -0,0 +1,6 @@
+---
+fixes:
+ - |
+ PBR now ignores ``--find-links`` in requirements files. This option is not
+ a valid ``install_requires`` entry for setuptools and thus breaks
+ PBR-based installs.