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
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>
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>
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
* 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
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
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
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"
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
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
# 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:
"""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)
# 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):
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):
# 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=[]
[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
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
+[options]
+python_requires = >=2.6
+
[files]
packages =
pbr
[tox]
-minversion = 3.1
+minversion = 3.18.0
envlist = pep8,py27,py37,docs
ignore_basepython_conflict = True
commands = pre-commit run -a
[testenv:docs]
-whitelist_externals = rm
+allowlist_externals = rm
deps =
-r{toxinidir}/doc/requirements.txt
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