Imported Upstream version 5.9.0 upstream/5.9.0
authorDongHun Kwak <dh0128.kwak@samsung.com>
Mon, 18 Jul 2022 01:15:43 +0000 (10:15 +0900)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Mon, 18 Jul 2022 01:15:43 +0000 (10:15 +0900)
.pre-commit-config.yaml
AUTHORS
ChangeLog
PKG-INFO
doc/source/user/using.rst
pbr.egg-info/PKG-INFO
pbr/version.py
pyproject.toml.future
setup.cfg
tox.ini

index 2f6ad7b8e2c926ecc430c7f2c5c4c3151f39fc04..319697bc4f9796998a6c715b7f138404020af397 100644 (file)
@@ -9,7 +9,7 @@ default_language_version:
 
 repos:
   - repo: https://github.com/pre-commit/pre-commit-hooks
-    rev: ebc15addedad713c86ef18ae9632c88e187dd0af  # v3.1.0
+    rev: 9136088a246768144165fcc3ecc3d31bb686920a # v3.3.0
     hooks:
       - id: trailing-whitespace
       # Replaces or checks mixed line ending
diff --git a/AUTHORS b/AUTHORS
index c43d177ba4535b0a33442b695cf565853d943fde..d771f1ede97b0c83914b17eb8b960c74aa3b3294 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -60,6 +60,7 @@ Jason Kölker <jason@koelker.net>
 Jason R. Coombs <jaraco@jaraco.com>
 Jay Pipes <jaypipes@gmail.com>
 Jeremy Stanley <fungi@yuggoth.org>
+Jiri Podivin <jpodivin@redhat.com>
 Joe D'Andrea <jdandrea@research.att.com>
 Joe Gordon <joe.gordon0@gmail.com>
 Joe Gordon <jogo@cloudscaling.com>
@@ -150,6 +151,8 @@ melissaml <ma.lei@99cloud.net>
 nizam <abdul.nizamuddin@nectechnologies.in>
 qingszhao <zhao.daqing@99cloud.net>
 weiweigu <gu.weiwei@zte.com.cn>
+wu.shiming <wushiming@yovole.com>
 xuanyandong <xuanyandong@inspur.com>
+yangyawei <yangyawei@inspur.com>
 zhangyangyang <zhangyangyang@unionpay.com>
 zhangyanxian <zhang.yanxian@zte.com.cn>
index 0b05c7532f558bc0176dfdc3a736e51151512ecb..b429d1338f39451f70bb989ef5c8ad1cb59647fc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,11 +1,20 @@
 CHANGES
 =======
 
+5.9.0
+-----
+
+* Future-proofing pyproject.toml
+* Use importlib-metadata for runtime package version lookups
+* Drop wheel from pyproject.toml examples
+* Changed minversion in tox to 3.18.0
+
 5.8.1
 -----
 
 * Add release note about missing pbr.json fix
 * Avoid recursive calls into SetupTools entrypoint
+* setup.cfg: Replace dashes with underscores
 * remove explicit mock
 * Don't test with setuptools local distutils
 * Use context blocks for open() calls in packaging
@@ -24,6 +33,7 @@ CHANGES
 * PBR package testing improvements
 * Run python3.9 test jobs
 * Retire django-openstack-auth
+* Upgrade the pre-commit-hooks version
 * Correct comment for 'D1\_D2\_SETUP\_ARGS'
 
 5.6.0
index 584766208ec4198a896fce8cb597ded9ce43883b..ce4212c67e5adc689cb0ef8d4695d4a5e6a1144a 100644 (file)
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: pbr
-Version: 5.8.1
+Version: 5.9.0
 Summary: Python Build Reasonableness
 Home-page: https://docs.openstack.org/pbr/latest/
 Author: OpenStack
@@ -9,51 +9,7 @@ License: UNKNOWN
 Project-URL: Bug Tracker, https://bugs.launchpad.net/pbr/
 Project-URL: Documentation, https://docs.openstack.org/pbr/
 Project-URL: Source Code, https://opendev.org/openstack/pbr
-Description: Introduction
-        ============
-        
-        .. image:: https://img.shields.io/pypi/v/pbr.svg
-            :target: https://pypi.python.org/pypi/pbr/
-            :alt: Latest Version
-        
-        .. image:: https://img.shields.io/pypi/dm/pbr.svg
-            :target: https://pypi.python.org/pypi/pbr/
-            :alt: Downloads
-        
-        PBR is a library that injects some useful and sensible default behaviors
-        into your setuptools run. It started off life as the chunks of code that
-        were copied between all of the `OpenStack`_ projects. Around the time that
-        OpenStack hit 18 different projects each with at least 3 active branches,
-        it seemed like a good time to make that code into a proper reusable library.
-        
-        PBR is only mildly configurable. The basic idea is that there's a decent
-        way to run things and if you do, you should reap the rewards, because then
-        it's simple and repeatable. If you want to do things differently, cool! But
-        you've already got the power of Python at your fingertips, so you don't
-        really need PBR.
-        
-        PBR builds on top of the work that `d2to1`_ started to provide for declarative
-        configuration. `d2to1`_ is itself an implementation of the ideas behind
-        `distutils2`_. Although `distutils2`_ is now abandoned in favor of work towards
-        `PEP 426`_ and Metadata 2.0, declarative config is still a great idea and
-        specifically important in trying to distribute setup code as a library
-        when that library itself will alter how the setup is processed. As Metadata
-        2.0 and other modern Python packaging PEPs come out, PBR aims to support
-        them as quickly as possible.
-        
-        * License: Apache License, Version 2.0
-        * Documentation: https://docs.openstack.org/pbr/latest/
-        * Source: https://opendev.org/openstack/pbr
-        * Bugs: https://bugs.launchpad.net/pbr
-        * Release Notes: https://docs.openstack.org/pbr/latest/user/releasenotes.html
-        * ChangeLog: https://docs.openstack.org/pbr/latest/user/history.html
-        
-        .. _d2to1: https://pypi.python.org/pypi/d2to1
-        .. _distutils2: https://pypi.python.org/pypi/Distutils2
-        .. _PEP 426: http://legacy.python.org/dev/peps/pep-0426/
-        .. _OpenStack: https://www.openstack.org/
-        
-        
+Description: Python Build Reasonableness
 Platform: UNKNOWN
 Classifier: Development Status :: 5 - Production/Stable
 Classifier: Environment :: Console
index 21aa99be37d7a490820e84c0fe61490ba8ed6b95..11cdbf254b4dad58b4c4a817e6c7554425d40e56 100644 (file)
@@ -41,12 +41,12 @@ PBR can be configured as a PEP517 build-system in ``pyproject.toml``. This
 currently continues to rely on setuptools which means you need the above
 ``setup.py`` file to be present. The main benefits to using a
 ``pyproject.toml`` file with PBR are that you can control the versions of
-PBR, setuptools, and wheel that are used avoiding easy_install invocation.
+PBR and setuptools that are used avoiding easy_install invocation.
 Your build-system block in ``pyproject.toml`` will need to look something
 like this::
 
     [build-system]
-    requires = ["pbr>=5.7.0", "setuptools>=36.6.0", "wheel"]
+    requires = ["pbr>=5.7.0", "setuptools>=36.6.0"]
     build-backend = "pbr.build"
 
 
index 584766208ec4198a896fce8cb597ded9ce43883b..ce4212c67e5adc689cb0ef8d4695d4a5e6a1144a 100644 (file)
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: pbr
-Version: 5.8.1
+Version: 5.9.0
 Summary: Python Build Reasonableness
 Home-page: https://docs.openstack.org/pbr/latest/
 Author: OpenStack
@@ -9,51 +9,7 @@ License: UNKNOWN
 Project-URL: Bug Tracker, https://bugs.launchpad.net/pbr/
 Project-URL: Documentation, https://docs.openstack.org/pbr/
 Project-URL: Source Code, https://opendev.org/openstack/pbr
-Description: Introduction
-        ============
-        
-        .. image:: https://img.shields.io/pypi/v/pbr.svg
-            :target: https://pypi.python.org/pypi/pbr/
-            :alt: Latest Version
-        
-        .. image:: https://img.shields.io/pypi/dm/pbr.svg
-            :target: https://pypi.python.org/pypi/pbr/
-            :alt: Downloads
-        
-        PBR is a library that injects some useful and sensible default behaviors
-        into your setuptools run. It started off life as the chunks of code that
-        were copied between all of the `OpenStack`_ projects. Around the time that
-        OpenStack hit 18 different projects each with at least 3 active branches,
-        it seemed like a good time to make that code into a proper reusable library.
-        
-        PBR is only mildly configurable. The basic idea is that there's a decent
-        way to run things and if you do, you should reap the rewards, because then
-        it's simple and repeatable. If you want to do things differently, cool! But
-        you've already got the power of Python at your fingertips, so you don't
-        really need PBR.
-        
-        PBR builds on top of the work that `d2to1`_ started to provide for declarative
-        configuration. `d2to1`_ is itself an implementation of the ideas behind
-        `distutils2`_. Although `distutils2`_ is now abandoned in favor of work towards
-        `PEP 426`_ and Metadata 2.0, declarative config is still a great idea and
-        specifically important in trying to distribute setup code as a library
-        when that library itself will alter how the setup is processed. As Metadata
-        2.0 and other modern Python packaging PEPs come out, PBR aims to support
-        them as quickly as possible.
-        
-        * License: Apache License, Version 2.0
-        * Documentation: https://docs.openstack.org/pbr/latest/
-        * Source: https://opendev.org/openstack/pbr
-        * Bugs: https://bugs.launchpad.net/pbr
-        * Release Notes: https://docs.openstack.org/pbr/latest/user/releasenotes.html
-        * ChangeLog: https://docs.openstack.org/pbr/latest/user/history.html
-        
-        .. _d2to1: https://pypi.python.org/pypi/d2to1
-        .. _distutils2: https://pypi.python.org/pypi/Distutils2
-        .. _PEP 426: http://legacy.python.org/dev/peps/pep-0426/
-        .. _OpenStack: https://www.openstack.org/
-        
-        
+Description: Python Build Reasonableness
 Platform: UNKNOWN
 Classifier: Development Status :: 5 - Production/Stable
 Classifier: Environment :: Console
index 46c6020705c1d8a35252ea9b7bdc1b89fc5dad07..658928eaa3867a2d6359e1bf17034ce5c275eefa 100644 (file)
 #    under the License.
 
 """
-Utilities for consuming the version from pkg_resources.
+Utilities for consuming the version from importlib-metadata.
 """
 
 import itertools
 import operator
 import sys
 
+try:
+    import importlib_metadata
+    use_importlib = True
+except ImportError:
+    use_importlib = False
+
 
 def _is_int(string):
     try:
@@ -431,12 +437,15 @@ class VersionInfo(object):
         """Obtain a version from pkg_resources or setup-time logic if missing.
 
         This will try to get the version of the package from the pkg_resources
+        This will try to get the version of the package from the
         record associated with the package, and if there is no such record
+        importlib_metadata record associated with the package, and if there
         falls back to the logic sdist would use.
+
+        is no such record falls back to the logic sdist would use.
         """
-        # Lazy import because pkg_resources is costly to import so defer until
-        # we absolutely need it.
         import pkg_resources
+
         try:
             requirement = pkg_resources.Requirement.parse(self.package)
             provider = pkg_resources.get_provider(requirement)
@@ -447,6 +456,25 @@ class VersionInfo(object):
             # installed into anything. Revert to setup-time logic.
             from pbr import packaging
             result_string = packaging.get_version(self.package)
+
+        return SemanticVersion.from_pip_string(result_string)
+
+    def _get_version_from_importlib_metadata(self):
+        """Obtain a version from importlib or setup-time logic if missing.
+
+        This will try to get the version of the package from the
+        importlib_metadata record associated with the package, and if there
+        is no such record falls back to the logic sdist would use.
+        """
+        try:
+            distribution = importlib_metadata.distribution(self.package)
+            result_string = distribution.version
+        except importlib_metadata.PackageNotFoundError:
+            # The most likely cause for this is running tests in a tree
+            # produced from a tarball where the package itself has not been
+            # installed into anything. Revert to setup-time logic.
+            from pbr import packaging
+            result_string = packaging.get_version(self.package)
         return SemanticVersion.from_pip_string(result_string)
 
     def release_string(self):
@@ -459,7 +487,12 @@ class VersionInfo(object):
     def semantic_version(self):
         """Return the SemanticVersion object for this version."""
         if self._semantic is None:
-            self._semantic = self._get_version_from_pkg_resources()
+            # TODO(damami): simplify this once Python 3.8 is the oldest
+            # we support
+            if use_importlib:
+                self._semantic = self._get_version_from_importlib_metadata()
+            else:
+                self._semantic = self._get_version_from_pkg_resources()
         return self._semantic
 
     def version_string(self):
index 1989dfdb7de2e5051c336f9501c5978d98cc1aa5..56fbd2c4d17e2ad2e2f10aee84550f5cb8453549 100644 (file)
@@ -4,6 +4,9 @@
 # once we are more confident it works generally.
 
 [build-system]
-requires = ["setuptools>=36.6.0", "wheel"]
+requires = ["setuptools>=36.6.0"]
 build-backend = "pbr.build"
 backend-path = ["."]
+
+[tools.setuptools]
+py-modules=[]
index 141fc7fe25a78f0fed3ebe2c633497e3ec17ec41..5226b3e2844d75d6203bfa27a5ad4afea3e5102d 100644 (file)
--- a/setup.cfg
+++ b/setup.cfg
@@ -1,18 +1,16 @@
 [metadata]
 name = pbr
 author = OpenStack
-author-email = openstack-discuss@lists.openstack.org
-summary = Python Build Reasonableness
-description-file = 
-       README.rst
-description-content-type = text/x-rst; charset=UTF-8
-home-page = https://docs.openstack.org/pbr/latest/
+author_email = openstack-discuss@lists.openstack.org
+description = Python Build Reasonableness
+long_description = file: README.rst
+long_description_content_type = text/x-rst; charset=UTF-8
+url = https://docs.openstack.org/pbr/latest/
 project_urls = 
        Bug Tracker = https://bugs.launchpad.net/pbr/
        Documentation = https://docs.openstack.org/pbr/
        Source Code = https://opendev.org/openstack/pbr
-python-requires = >=2.6
-classifier = 
+classifiers = 
        Development Status :: 5 - Production/Stable
        Environment :: Console
        Environment :: OpenStack
@@ -28,6 +26,9 @@ classifier =
        Programming Language :: Python :: 3.6
        Programming Language :: Python :: 3.7
 
+[options]
+python_requires = >=2.6
+
 [files]
 packages = 
        pbr
diff --git a/tox.ini b/tox.ini
index e158f90fa23d7ef764beca88ec6a4e7166e7dbfe..b3173d65cf4548763c2ac109408627c3072621f7 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -1,5 +1,5 @@
 [tox]
-minversion = 3.1
+minversion = 3.18.0
 envlist = pep8,py27,py37,docs
 ignore_basepython_conflict = True
 
@@ -24,7 +24,7 @@ commands = stestr run --suppress-attachments {posargs}
 commands = pre-commit run -a
 
 [testenv:docs]
-whitelist_externals = rm
+allowlist_externals = rm
 deps =
   -r{toxinidir}/doc/requirements.txt
 commands =
@@ -33,7 +33,7 @@ commands =
   sphinx-build -W -b html doc/source doc/build/html {posargs}
 
 [testenv:releasenotes]
-whitelist_externals = rm
+allowlist_externals = rm
 deps = {[testenv:docs]deps}
 commands =
   rm -rf releasenotes/build