Imported Upstream version 5.11.1 upstream upstream/5.11.1
authorTizenOpenSource <tizenopensrc@samsung.com>
Thu, 28 Dec 2023 09:15:31 +0000 (18:15 +0900)
committerTizenOpenSource <tizenopensrc@samsung.com>
Thu, 28 Dec 2023 09:15:31 +0000 (18:15 +0900)
17 files changed:
.zuul.yaml
AUTHORS
CONTRIBUTING.rst
ChangeLog
PKG-INFO
pbr.egg-info/PKG-INFO
pbr.egg-info/SOURCES.txt
pbr/core.py
pbr/packaging.py
pbr/tests/test_integration.py
pbr/tests/test_packaging.py
pbr/tests/test_util.py
pbr/version.py
releasenotes/notes/fix-symbols-leading-spaces-f68928d75a8f0997.yaml [new file with mode: 0644]
setup.cfg
tools/integration.sh
tox.ini

index 87fccb4e7dae95f4b4955706a4b613cfdb96e641..3d0908f1b7f54a33b35d3a98bc5e0fcfbf9b036f 100644 (file)
     vars:
       pbr_pip_version: 'git+https://github.com/pypa/pip.git#egg=pip'
 
+- job:
+    name: pbr-installation-openstack-focal
+    parent: pbr-installation-openstack
+    nodeset: ubuntu-focal
+    description: |
+      Run pbr integration testing on older Ubuntu which allows us
+      to test compatibility with older versions of pip and setuptools.
+
 - project:
     templates:
       - lib-forward-testing
         - openstack-tox-py38
         - openstack-tox-py39
         - pbr-installation-openstack
+        - pbr-installation-openstack-focal
         - pbr-installation-openstack-pip-dev
         - tempest-full:
             override-checkout: stable/train
         - openstack-tox-py38
         - openstack-tox-py39
         - pbr-installation-openstack
+        - pbr-installation-openstack-focal
         - pbr-installation-openstack-pip-dev
         - tempest-full:
             override-checkout: stable/train
diff --git a/AUTHORS b/AUTHORS
index d771f1ede97b0c83914b17eb8b960c74aa3b3294..d2b3c3733dc861d9fc7f05a5362975bf62cce50f 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -20,6 +20,7 @@ Cao Xuan Hoang <hoangcx@vn.fujitsu.com>
 Chang Bo Guo <guochbo@cn.ibm.com>
 ChangBo Guo(gcb) <eric.guo@easystack.cn>
 Chris Dent <cdent@anticdent.org>
+Chris Dohmen <chris.dohmen@sciencelogic.com>
 Christian Berendt <berendt@b1-systems.de>
 Chuck Short <chuck.short@canonical.com>
 Clark Boylan <clark.boylan@gmail.com>
@@ -145,6 +146,7 @@ cbjchen@cn.ibm.com <cbjchen@cn.ibm.com>
 dineshbhor <dinesh.bhor@nttdata.com>
 jiansong <jian.song@easystack.cn>
 lifeless <robertc@robertcollins.net>
+ljhuang <huang.liujie@99cloud.net>
 manchandavishal <manchandavishal143@gmail.com>
 melanie witt <melwitt@yahoo-inc.com>
 melissaml <ma.lei@99cloud.net>
index 33adff52d4fd319268598b4a33a37b9ba4d9cd0b..798ef48d5264a3ecd1285c5f32ca056bc4ba9061 100644 (file)
@@ -9,6 +9,11 @@ the workflow documented at:
 
    https://docs.opendev.org/opendev/infra-manual/latest/developers.html#development-workflow
 
+Release notes are managed through the tool
+`reno <https://pypi.org/project/reno/>`_. This tool will create
+a new file under the directory ``releasenotes`` that should
+be checked in with the code changes.
+
 Pull requests submitted through GitHub will be ignored.
 
 Bugs should be filed on Launchpad, not GitHub:
index b429d1338f39451f70bb989ef5c8ad1cb59647fc..1e92d7f2bd05a72813c0b9d9bb11a197f58a1988 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,28 @@
 CHANGES
 =======
 
+5.11.1
+------
+
+* Run PBR integration on Ubuntu Focal too
+* Remove numpy dependencies
+* Tie recursion calls to Dist object, not module
+* Update tox.ini to work with tox 4
+
+5.11.0
+------
+
+* Fix symbol identification in multiline message
+* Replace deprecated readfp method with read\_file
+
+5.10.0
+------
+
+* Specify Changelog procedure
+* Allow leading spaces when determining symbols
+* Use stdlib importlib.metadata where possible
+* Adding python classifiers py38 & py39
+
 5.9.0
 -----
 
index ce4212c67e5adc689cb0ef8d4695d4a5e6a1144a..24563efb0cb17874f17a63e62e78fc4e2385ab0a 100644 (file)
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: pbr
-Version: 5.9.0
+Version: 5.11.1
 Summary: Python Build Reasonableness
 Home-page: https://docs.openstack.org/pbr/latest/
 Author: OpenStack
@@ -25,5 +25,7 @@ Classifier: Programming Language :: Python :: 3
 Classifier: Programming Language :: Python :: 3.5
 Classifier: Programming Language :: Python :: 3.6
 Classifier: Programming Language :: Python :: 3.7
+Classifier: Programming Language :: Python :: 3.8
+Classifier: Programming Language :: Python :: 3.9
 Requires-Python: >=2.6
 Description-Content-Type: text/x-rst; charset=UTF-8
index ce4212c67e5adc689cb0ef8d4695d4a5e6a1144a..24563efb0cb17874f17a63e62e78fc4e2385ab0a 100644 (file)
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: pbr
-Version: 5.9.0
+Version: 5.11.1
 Summary: Python Build Reasonableness
 Home-page: https://docs.openstack.org/pbr/latest/
 Author: OpenStack
@@ -25,5 +25,7 @@ Classifier: Programming Language :: Python :: 3
 Classifier: Programming Language :: Python :: 3.5
 Classifier: Programming Language :: Python :: 3.6
 Classifier: Programming Language :: Python :: 3.7
+Classifier: Programming Language :: Python :: 3.8
+Classifier: Programming Language :: Python :: 3.9
 Requires-Python: >=2.6
 Description-Content-Type: text/x-rst; charset=UTF-8
index 484ac6358c7ad66335a1fd168ce7532036e6bd0d..17351f76f2a4362c26681b958f6eac4b9d3980f2 100644 (file)
@@ -103,6 +103,7 @@ releasenotes/notes/fix-handling-of-spaces-in-data-files-glob-0fe0c398d70dfea8.ya
 releasenotes/notes/fix-keywords-as-cfg-list-6cadc5141429d7f5.yaml
 releasenotes/notes/fix-mapping-value-explode-with-equal-sign-41bf822fa4dd0e68.yaml
 releasenotes/notes/fix-pep517-metadata-regression-bc287e60e45b2732.yaml
+releasenotes/notes/fix-symbols-leading-spaces-f68928d75a8f0997.yaml
 releasenotes/notes/ignore-find-links-07cf54f465aa33a6.yaml
 releasenotes/notes/long-descr-content-type-f9a1003acbb8740f.yaml
 releasenotes/notes/pep517-support-89189ce0bab15845.yaml
index a801737a9560229dbbf71f13372a48d3de2404fa..fb592f8ad0040a5f0144be41d55e3041b7972016 100644 (file)
@@ -61,11 +61,6 @@ else:
     integer_types = (int, long)  # noqa
 
 
-# We use this canary to detect whether the module has already been called,
-# in order to avoid recursion
-in_use = False
-
-
 def pbr(dist, attr, value):
     """Implements the actual pbr setup() keyword.
 
@@ -91,10 +86,9 @@ def pbr(dist, attr, value):
     # particularly when using PEP517 build-system configs without
     # setup_requires in setup.py. We can avoid the recursion by setting
     # this canary so we don't repeat ourselves.
-    global in_use
-    if in_use:
+    if hasattr(dist, '_pbr_initialized'):
         return
-    in_use = True
+    dist._pbr_initialized = True
 
     if not value:
         return
index 8577b53291b324825e6490f8c3fbf97c00b00e76..474d0130e61a3a4cf7933c82a3517024548de858 100644 (file)
@@ -692,12 +692,14 @@ def _get_increment_kwargs(git_dir, tag):
     # git log output affecting out ability to have working sem ver headers.
     changelog = git._run_git_command(['log', '--pretty=%B', version_spec],
                                      git_dir)
-    header_len = len('sem-ver:')
-    commands = [line[header_len:].strip() for line in changelog.split('\n')
-                if line.lower().startswith('sem-ver:')]
     symbols = set()
-    for command in commands:
-        symbols.update([symbol.strip() for symbol in command.split(',')])
+    header = 'sem-ver:'
+    for line in changelog.split("\n"):
+        line = line.lower().strip()
+        if not line.lower().strip().startswith(header):
+            continue
+        new_symbols = line[len(header):].strip().split(",")
+        symbols.update([symbol.strip() for symbol in new_symbols])
 
     def _handle_symbol(symbol, symbols, impact):
         if symbol in symbols:
index 25473b05d8d7202332694b9bbb6ec7126cfb1ff6..2f5c0ab922abf9200d7fc7af5a575dfe6907e666 100644 (file)
@@ -210,20 +210,24 @@ class TestMarkersPip(base.BaseTestCase):
 
     scenarios = [
         ('pip-latest', {'modules': ['pip']}),
-        ('setuptools-Bionic', {
-            'modules': ['pip==9.0.1', 'setuptools==39.0.1']}),
-        ('setuptools-Stretch', {
-            'modules': ['pip==9.0.1', 'setuptools==33.1.1']}),
-        ('setuptools-EL8', {'modules': ['pip==9.0.3', 'setuptools==39.2.0']}),
-        ('setuptools-Buster', {
-            'modules': ['pip==18.1', 'setuptools==40.8.0']}),
-        ('setuptools-Focal', {
-            'modules': ['pip==20.0.2', 'setuptools==45.2.0']}),
+        (
+            'setuptools-Bullseye',
+            {'modules': ['pip==20.3.4', 'setuptools==52.0.0']},
+        ),
+        (
+            'setuptools-Focal',
+            {'modules': ['pip==20.0.2', 'setuptools==45.2.0']},
+        ),
+        (
+            'setuptools-Jammy',
+            {'modules': ['pip==22.0.2', 'setuptools==59.6.0']},
+        ),
     ]
 
     @testtools.skipUnless(
         os.environ.get('PBR_INTEGRATION', None) == '1',
-        'integration tests not enabled')
+        'integration tests not enabled',
+    )
     def test_pip_versions(self):
         pkgs = {
             'test_markers':
@@ -260,21 +264,33 @@ class TestMarkersPip(base.BaseTestCase):
             allow_fail=False)[0])
 
 
-class TestLTSSupport(base.BaseTestCase):
-
-    # These versions come from the versions installed from the 'virtualenv'
-    # command from the 'python-virtualenv' package.
-    scenarios = [
+# Handle collections.abc moves in python breaking old pip
+# These versions come from the versions installed from the 'virtualenv'
+# command from the 'python-virtualenv' package.
+if sys.version_info[0:3] < (3, 10, 0):
+    lts_scenarios = [
         ('Bionic', {'modules': ['pip==9.0.1', 'setuptools==39.0.1']}),
         ('Stretch', {'modules': ['pip==9.0.1', 'setuptools==33.1.1']}),
         ('EL8', {'modules': ['pip==9.0.3', 'setuptools==39.2.0']}),
         ('Buster', {'modules': ['pip==18.1', 'setuptools==40.8.0']}),
         ('Focal', {'modules': ['pip==20.0.2', 'setuptools==45.2.0']}),
     ]
+else:
+    lts_scenarios = [
+        ('Bullseye', {'modules': ['pip==20.3.4', 'setuptools==52.0.0']}),
+        ('Focal', {'modules': ['pip==20.0.2', 'setuptools==45.2.0']}),
+        ('Jammy', {'modules': ['pip==22.0.2', 'setuptools==59.6.0']}),
+    ]
+
+
+class TestLTSSupport(base.BaseTestCase):
+
+    scenarios = lts_scenarios
 
     @testtools.skipUnless(
         os.environ.get('PBR_INTEGRATION', None) == '1',
-        'integration tests not enabled')
+        'integration tests not enabled',
+    )
     def test_lts_venv_default_versions(self):
         venv = self.useFixture(
             test_packaging.Venv('setuptools', modules=self.modules))
index c92ea9bc9cc25c3b49ba2945f38d56e6b6916b3c..c719d1e2dfbf560b6dded9088a044c40f5d41e7f 100644 (file)
@@ -672,6 +672,53 @@ class TestVersions(base.BaseTestCase):
         version = packaging._get_version_from_git()
         self.assertThat(version, matchers.StartsWith('2.0.0.dev1'))
 
+    def test_multi_inline_symbols_no_space(self):
+        self.repo.commit()
+        self.repo.tag('1.2.3')
+        self.repo.commit('Sem-ver: feature,api-break')
+        version = packaging._get_version_from_git()
+        self.assertThat(version, matchers.StartsWith('2.0.0.dev1'))
+
+    def test_multi_inline_symbols_spaced(self):
+        self.repo.commit()
+        self.repo.tag('1.2.3')
+        self.repo.commit('Sem-ver: feature, api-break')
+        version = packaging._get_version_from_git()
+        self.assertThat(version, matchers.StartsWith('2.0.0.dev1'))
+
+    def test_multi_inline_symbols_reversed(self):
+        self.repo.commit()
+        self.repo.tag('1.2.3')
+        self.repo.commit('Sem-ver: api-break,feature')
+        version = packaging._get_version_from_git()
+        self.assertThat(version, matchers.StartsWith('2.0.0.dev1'))
+
+    def test_leading_space(self):
+        self.repo.commit()
+        self.repo.tag('1.2.3')
+        self.repo.commit('   sem-ver: api-break')
+        version = packaging._get_version_from_git()
+        self.assertThat(version, matchers.StartsWith('2.0.0.dev1'))
+
+    def test_leading_space_multiline(self):
+        self.repo.commit()
+        self.repo.tag('1.2.3')
+        self.repo.commit(
+            (
+                '   Some cool text\n'
+                '   sem-ver: api-break'
+            )
+        )
+        version = packaging._get_version_from_git()
+        self.assertThat(version, matchers.StartsWith('2.0.0.dev1'))
+
+    def test_leading_characters_symbol_not_found(self):
+        self.repo.commit()
+        self.repo.tag('1.2.3')
+        self.repo.commit('  ssem-ver: api-break')
+        version = packaging._get_version_from_git()
+        self.assertThat(version, matchers.StartsWith('1.2.4.dev1'))
+
     def test_tagged_version_has_tag_version(self):
         self.repo.commit()
         self.repo.tag('1.2.3')
index f372d6590d29b5dd34e508038cf25c932c6912a8..b25d0c77be6de31b22481ea9e50e8fea3d3665eb 100644 (file)
@@ -27,12 +27,13 @@ from pbr import util
 
 def config_from_ini(ini):
     config = {}
+    ini = textwrap.dedent(six.u(ini))
     if sys.version_info >= (3, 2):
         parser = configparser.ConfigParser()
+        parser.read_file(io.StringIO(ini))
     else:
         parser = configparser.SafeConfigParser()
-    ini = textwrap.dedent(six.u(ini))
-    parser.readfp(io.StringIO(ini))
+        parser.readfp(io.StringIO(ini))
     for section in parser.sections():
         config[section] = dict(parser.items(section))
     return config
index 658928eaa3867a2d6359e1bf17034ce5c275eefa..37c7a9f5dcf79683a0a8d7de05f3e163605d2c18 100644 (file)
@@ -22,11 +22,16 @@ import itertools
 import operator
 import sys
 
-try:
-    import importlib_metadata
+# TODO(stephenfin): Remove this once we drop support for Python < 3.8
+if sys.version_info >= (3, 8):
+    from importlib import metadata as importlib_metadata
     use_importlib = True
-except ImportError:
-    use_importlib = False
+else:
+    try:
+        import importlib_metadata
+        use_importlib = True
+    except ImportError:
+        use_importlib = False
 
 
 def _is_int(string):
diff --git a/releasenotes/notes/fix-symbols-leading-spaces-f68928d75a8f0997.yaml b/releasenotes/notes/fix-symbols-leading-spaces-f68928d75a8f0997.yaml
new file mode 100644 (file)
index 0000000..f15c9ee
--- /dev/null
@@ -0,0 +1,5 @@
+---
+fixes:
+  - |
+    Fix an issue where symbols that were indented
+    would produce an incorrect version.
\ No newline at end of file
index 5226b3e2844d75d6203bfa27a5ad4afea3e5102d..f0c4e9d8336840e53b97a677f37230528a248167 100644 (file)
--- a/setup.cfg
+++ b/setup.cfg
@@ -25,6 +25,8 @@ classifiers =
        Programming Language :: Python :: 3.5
        Programming Language :: Python :: 3.6
        Programming Language :: Python :: 3.7
+       Programming Language :: Python :: 3.8
+       Programming Language :: Python :: 3.9
 
 [options]
 python_requires = >=2.6
index 13480f9f83bb76fb5a148a6aa2410bb5b000ee25..f0ed0f294547599fb983788c70bb5a0489d8cc82 100644 (file)
@@ -32,15 +32,8 @@ REPODIR=${REPODIR:-$BASE/openstack}
 sudo apt-get update
 sudo apt-get install -y --force-yes libvirt-dev libxml2-dev libxslt-dev libmysqlclient-dev libpq-dev libnspr4-dev pkg-config libsqlite3-dev libffi-dev libldap2-dev libsasl2-dev ccache libkrb5-dev liberasurecode-dev libjpeg-dev libsystemd-dev libnss3-dev libssl-dev
 
-# FOR numpy / pyyaml
-# The source list has been removed from our apt config so rather than
-# installing deps via apt-get build-dep <PKG> we install the lists provied
-# by apt-cache showsrc <PKG>
-
-# Numpy
-sudo apt-get install -y --force-yes cython debhelper gfortran libblas-dev liblapack-dev python-all-dbg python-all-dev python-nose python-tz python3-all-dbg python3-all-dev python3-nose python3-tz
-#pyyaml
-sudo apt-get install -y --force-yes debhelper python-all-dev python-all-dbg python3-all-dev python3-all-dbg libyaml-dev cython cython-dbg quilt
+# FOR pyyaml
+sudo apt-get install -y --force-yes debhelper python3-all-dev python3-all-dbg libyaml-dev cython3 cython3-dbg quilt
 
 # And use ccache explitly
 export PATH=/usr/lib/ccache:$PATH
diff --git a/tox.ini b/tox.ini
index b3173d65cf4548763c2ac109408627c3072621f7..73300242cd470c404fed07297d6c877f1a89e648 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -1,12 +1,17 @@
 [tox]
 minversion = 3.18.0
-envlist = pep8,py27,py37,docs
-ignore_basepython_conflict = True
+envlist = pep8,py3,docs
 
 [testenv]
-usedevelop = True
-basepython = python3
-passenv = PBR_INTEGRATION PIPFLAGS PIPVERSION PBRVERSION REPODIR WHEELHOUSE PROJECTS
+usedevelop = true
+passenv =
+  PBR_INTEGRATION
+  PIPFLAGS
+  PIPVERSION
+  PBRVERSION
+  REPODIR
+  WHEELHOUSE
+  PROJECTS
 # TODO(fungi): drop distutils override once logging improves in Setuptools
 #              https://github.com/pypa/setuptools/issues/3038
 setenv =
@@ -24,7 +29,8 @@ commands = stestr run --suppress-attachments {posargs}
 commands = pre-commit run -a
 
 [testenv:docs]
-allowlist_externals = rm
+allowlist_externals =
+  rm
 deps =
   -r{toxinidir}/doc/requirements.txt
 commands =
@@ -33,7 +39,8 @@ commands =
   sphinx-build -W -b html doc/source doc/build/html {posargs}
 
 [testenv:releasenotes]
-allowlist_externals = rm
+allowlist_externals =
+  rm
 deps = {[testenv:docs]deps}
 commands =
   rm -rf releasenotes/build