Imported Upstream version 5.1.2 upstream/5.1.2
authorJinWang An <jinwang.an@samsung.com>
Mon, 28 Dec 2020 04:46:41 +0000 (13:46 +0900)
committerJinWang An <jinwang.an@samsung.com>
Mon, 28 Dec 2020 04:46:41 +0000 (13:46 +0900)
12 files changed:
AUTHORS
ChangeLog
PKG-INFO
pbr.egg-info/PKG-INFO
pbr.egg-info/SOURCES.txt
pbr/hooks/files.py
pbr/packaging.py
pbr/tests/test_files.py
pbr/tests/test_packaging.py
releasenotes/notes/fix-global-replace-of-src-prefix-in-glob-eb850b94ca96993e.yaml [new file with mode: 0644]
releasenotes/notes/ignore-find-links-07cf54f465aa33a6.yaml [new file with mode: 0644]
setup.cfg

diff --git a/AUTHORS b/AUTHORS
index f88695f4629d0d9802864f4815d91b25e8aa67f2..760e464cc0ae43460cf85e11e4b5391cc448826a 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -126,6 +126,7 @@ Vasudev Kamath <kamathvasudev@gmail.com>
 Vincent Untz <vuntz@suse.com>
 Vishvananda Ishaya <vishvananda@gmail.com>
 Wei Tie <nuaafe@gmail.com>
+Will Szumski <will@stackhpc.com>
 YAMAMOTO Takashi <yamamoto@valinux.co.jp>
 Yaguang Tang <heut2008@gmail.com>
 Yuriy Taraday <yorik.sar@gmail.com>
index ecfe49bf266672c6be40e330518ab7de42d856b5..aedea6d07c2c387ea4c58e56c252fb26b6d101fa 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,13 @@
 CHANGES
 =======
 
+5.1.2
+-----
+
+* Ignore --find-links in requirements file
+* Do not globally replace path prefix
+* Change openstack-dev to openstack-discuss
+
 5.1.1
 -----
 
index 4c12c9a7aad302b089a53d8d5b807b2a61dbc66c..2527e6d89a14c8ee1208084c5bdf76fde2313ef7 100644 (file)
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,14 +1,14 @@
 Metadata-Version: 2.1
 Name: pbr
-Version: 5.1.1
+Version: 5.1.2
 Summary: Python Build Reasonableness
 Home-page: https://docs.openstack.org/pbr/latest/
 Author: OpenStack
-Author-email: openstack-dev@lists.openstack.org
+Author-email: openstack-discuss@lists.openstack.org
 License: UNKNOWN
+Project-URL: Documentation, https://docs.openstack.org/pbr/
 Project-URL: Source Code, https://git.openstack.org/cgit/openstack-dev/pbr/
 Project-URL: Bug Tracker, https://bugs.launchpad.net/pbr/
-Project-URL: Documentation, https://docs.openstack.org/pbr/
 Description: Introduction
         ============
         
index 4c12c9a7aad302b089a53d8d5b807b2a61dbc66c..2527e6d89a14c8ee1208084c5bdf76fde2313ef7 100644 (file)
@@ -1,14 +1,14 @@
 Metadata-Version: 2.1
 Name: pbr
-Version: 5.1.1
+Version: 5.1.2
 Summary: Python Build Reasonableness
 Home-page: https://docs.openstack.org/pbr/latest/
 Author: OpenStack
-Author-email: openstack-dev@lists.openstack.org
+Author-email: openstack-discuss@lists.openstack.org
 License: UNKNOWN
+Project-URL: Documentation, https://docs.openstack.org/pbr/
 Project-URL: Source Code, https://git.openstack.org/cgit/openstack-dev/pbr/
 Project-URL: Bug Tracker, https://bugs.launchpad.net/pbr/
-Project-URL: Documentation, https://docs.openstack.org/pbr/
 Description: Introduction
         ============
         
index fd66c5712ab5435d943d4aaa64838a18e72dca87..4d5239dfc9c504b727c9dcb13687e842f702824d 100644 (file)
@@ -95,6 +95,8 @@ playbooks/legacy/pbr-installation-upstream-devstack/post.yaml
 playbooks/legacy/pbr-installation-upstream-devstack/run.yaml
 releasenotes/notes/deprecate-pyN-requirements-364655c38fa5b780.yaml
 releasenotes/notes/deprecate-testr-nose-integration-56e3e11248d946fc.yaml
+releasenotes/notes/fix-global-replace-of-src-prefix-in-glob-eb850b94ca96993e.yaml
+releasenotes/notes/ignore-find-links-07cf54f465aa33a6.yaml
 releasenotes/notes/long-descr-content-type-f9a1003acbb8740f.yaml
 releasenotes/notes/remove-command-hooks-907d9c2325f306ca.yaml
 releasenotes/notes/support-vcs-uris-with-subdirectories-20ad68b6138f72ca.yaml
index 48bf9e31f26c6c2a77c49053d4a8f205fe804326..750ac32c642e8ce758345fc48adf32392c525574 100644 (file)
@@ -58,8 +58,12 @@ class FilesConfig(base.BaseConfig):
                 if not target.endswith(os.path.sep):
                     target += os.path.sep
                 for (dirpath, dirnames, fnames) in os.walk(source_prefix):
-                    finished.append(
-                        "%s = " % dirpath.replace(source_prefix, target))
+                    # As source_prefix is always matched, using replace with a
+                    # a limit of one is always going to replace the path prefix
+                    # and not accidentally replace some text in the middle of
+                    # the path
+                    new_prefix = dirpath.replace(source_prefix, target, 1)
+                    finished.append("%s = " % new_prefix)
                     finished.extend(
                         [" %s" % os.path.join(dirpath, f) for f in fnames])
             else:
index 77a4b226eadcd3a1abc6ab9dd6f760e6617237fa..baffdb21e070fb91c907747270d0e7a1bb281c24 100644 (file)
@@ -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:
index e60b6ca7b6e00b4a1de539c4b4e2bc78bc01c921..ed67f7bc633c26caea66a2bbc672907700f4b661 100644 (file)
@@ -35,15 +35,20 @@ class FilesConfigTest(base.BaseTestCase):
             ])
         self.useFixture(pkg_fixture)
         pkg_etc = os.path.join(pkg_fixture.base, 'etc')
+        pkg_ansible = os.path.join(pkg_fixture.base, 'ansible',
+                                   'kolla-ansible', 'test')
         pkg_sub = os.path.join(pkg_etc, 'sub')
         subpackage = os.path.join(
             pkg_fixture.base, 'fake_package', 'subpackage')
         os.makedirs(pkg_sub)
         os.makedirs(subpackage)
+        os.makedirs(pkg_ansible)
         with open(os.path.join(pkg_etc, "foo"), 'w') as foo_file:
             foo_file.write("Foo Data")
         with open(os.path.join(pkg_sub, "bar"), 'w') as foo_file:
             foo_file.write("Bar Data")
+        with open(os.path.join(pkg_ansible, "baz"), 'w') as baz_file:
+            baz_file.write("Baz Data")
         with open(os.path.join(subpackage, "__init__.py"), 'w') as foo_file:
             foo_file.write("# empty")
 
@@ -76,3 +81,19 @@ class FilesConfigTest(base.BaseTestCase):
         self.assertIn(
             '\netc/pbr/ = \n etc/foo\netc/pbr/sub = \n etc/sub/bar',
             config['files']['data_files'])
+
+    def test_data_files_globbing_source_prefix_in_directory_name(self):
+        # We want to test that the string, "docs", is not replaced in a
+        # subdirectory name, "sub-docs"
+        config = dict(
+            files=dict(
+                data_files="\n  share/ansible = ansible/*"
+            )
+        )
+        files.FilesConfig(config, 'fake_package').run()
+        self.assertIn(
+            '\nshare/ansible/ = '
+            '\nshare/ansible/kolla-ansible = '
+            '\nshare/ansible/kolla-ansible/test = '
+            '\n ansible/kolla-ansible/test/baz',
+            config['files']['data_files'])
index d19dd05bfc5b8beceb76e06d7aedf79913f8ac13..853844f49d2557c1e0fa506de4427345273cf2a2 100644 (file)
@@ -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/fix-global-replace-of-src-prefix-in-glob-eb850b94ca96993e.yaml b/releasenotes/notes/fix-global-replace-of-src-prefix-in-glob-eb850b94ca96993e.yaml
new file mode 100644 (file)
index 0000000..b2895aa
--- /dev/null
@@ -0,0 +1,9 @@
+---
+fixes:
+  - |
+    Fixes a bug where the directory names of items specified in ``data_files``
+    could be renamed if the source prefix glob was contained within the
+    directory name. See `bug 1810804
+    <https://bugs.launchpad.net/pbr/+bug/1810804>`_ for details. For more
+    information on ``data_files``, see the `distutils documentation
+    <https://docs.python.org/2/distutils/setupscript.html#installing-additional-files>`_.
diff --git a/releasenotes/notes/ignore-find-links-07cf54f465aa33a6.yaml b/releasenotes/notes/ignore-find-links-07cf54f465aa33a6.yaml
new file mode 100644 (file)
index 0000000..0d10a26
--- /dev/null
@@ -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.
index ac88d23892d2cf3e14e9fdfd7c43be57e9a605c1..e4e58e6ac4c44eef6f5e0d8bb4d8a8f62cf7d487 100644 (file)
--- a/setup.cfg
+++ b/setup.cfg
@@ -1,7 +1,7 @@
 [metadata]
 name = pbr
 author = OpenStack
-author-email = openstack-dev@lists.openstack.org
+author-email = openstack-discuss@lists.openstack.org
 summary = Python Build Reasonableness
 description-file = 
        README.rst