Anthony Young <sleepsonthefloor@gmail.com>
Antoine Musso <hashar@free.fr>
Attila Fazekas <afazekas@redhat.com>
+Ben Greiner <code@bnavigator.de>
Ben Nemec <bnemec@redhat.com>
Bhuvan Arumugam <bhuvan@apache.org>
Brandon LeBlanc <brandon@leblanc.codes>
CHANGES
=======
+5.8.1
+-----
+
+* Add release note about missing pbr.json fix
+* Avoid recursive calls into SetupTools entrypoint
+* remove explicit mock
+* Don't test with setuptools local distutils
+* Use context blocks for open() calls in packaging
+
5.8.0
-----
Metadata-Version: 2.1
Name: pbr
-Version: 5.8.0
+Version: 5.8.1
Summary: Python Build Reasonableness
Home-page: https://docs.openstack.org/pbr/latest/
Author: OpenStack
Metadata-Version: 2.1
Name: pbr
-Version: 5.8.0
+Version: 5.8.1
Summary: Python Build Reasonableness
Home-page: https://docs.openstack.org/pbr/latest/
Author: OpenStack
releasenotes/notes/fix-handling-of-spaces-in-data-files-glob-0fe0c398d70dfea8.yaml
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/ignore-find-links-07cf54f465aa33a6.yaml
releasenotes/notes/long-descr-content-type-f9a1003acbb8740f.yaml
releasenotes/notes/pep517-support-89189ce0bab15845.yaml
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.
not work well with distributions that do use a `Distribution` subclass.
"""
+ # Distribution.finalize_options() is what calls this method. That means
+ # there is potential for recursion here. Recursion seems to be an issue
+ # 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:
+ return
+ in_use = True
+
if not value:
return
if isinstance(value, string_type):
msg = 'Unknown distribution option: %s' % repr(key)
warnings.warn(msg)
- # Distribution.finalize_options() is what calls this method. That means
- # there is potential for recursion here. Recursion seems to be an issue
- # particularly when using PEP517 build-system configs without
- # setup_requires in setup.py. We can avoid the recursion by setting
- # dist.pbr to a None value as the corresponding entrypoint (this function)
- # will only be called on a non None value.
- setattr(dist, "pbr", None)
-
# Re-finalize the underlying Distribution
try:
super(dist.__class__, dist).finalize_options()
else:
log.info("[pbr] Reusing existing SOURCES.txt")
self.filelist = egg_info.FileList()
- for entry in open(manifest_filename, 'r').read().split('\n'):
- self.filelist.append(entry)
+ with open(manifest_filename, 'r') as fil:
+ for entry in fil.read().split('\n'):
+ self.filelist.append(entry)
def _from_git(distribution):
pkg_metadata = {}
for filename in pkg_metadata_filenames:
try:
- pkg_metadata_file = open(filename, 'r')
- except (IOError, OSError):
- continue
- try:
- pkg_metadata = email.message_from_file(pkg_metadata_file)
- except email.errors.MessageError:
+ with open(filename, 'r') as pkg_metadata_file:
+ pkg_metadata = email.message_from_file(pkg_metadata_file)
+ except (IOError, OSError, email.errors.MessageError):
continue
# Check to make sure we're in our own dir
import textwrap
import fixtures
-import mock
+try:
+ from unittest import mock
+except ImportError:
+ import mock
import pkg_resources
import six
import testscenarios
wheel_file.extractall(self.extracted_wheel_dir)
wheel_file.close()
+ def test_metadata_directory_has_pbr_json(self):
+ # Build the path to the scripts directory
+ pbr_json = os.path.join(
+ self.extracted_wheel_dir, 'pbr_testpackage-0.0.dist-info/pbr.json')
+ self.assertTrue(os.path.exists(pbr_json))
+
def test_data_directory_has_wsgi_scripts(self):
# Build the path to the scripts directory
scripts_dir = os.path.join(
# License for the specific language governing permissions and limitations
# under the License.
-import mock
+try:
+ from unittest import mock
+except ImportError:
+ import mock
from pbr import pbr_json
from pbr.tests import base
--- /dev/null
+---
+fixes:
+ - |
+ Packages generated with the 5.8.0 release of PBR failed to incorporate
+ pbr.json metadata files. This is now corrected. Users can rebuild packages
+ with newer PBR if they want that missing metadata generated.
fixtures>=3.0.0 # Apache-2.0/BSD
hacking>=1.1.0,<4.0.0;python_version>='3.6' # Apache-2.0
mock>=2.0.0,<4.0.0;python_version=='2.7' # BSD
-mock>=2.0.0;python_version>='3.6' # BSD
six>=1.12.0 # MIT
stestr>=2.1.0,<3.0;python_version=='2.7' # Apache-2.0
stestr>=2.1.0;python_version>='3.0' # Apache-2.0
usedevelop = True
basepython = python3
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 =
+ SETUPTOOLS_USE_DISTUTILS=stdlib
OS_STDOUT_CAPTURE={env:OS_STDOUT_CAPTURE:1}
OS_STDERR_CAPTURE={env:OS_STDERR_CAPTURE:1}
OS_TEST_TIMEOUT={env:OS_TEST_TIMEOUT:60}
commands = {posargs}
[testenv:cover]
+# TODO(fungi): drop distutils override once logging improves in Setuptools
+# https://github.com/pypa/setuptools/issues/3038
setenv =
+ SETUPTOOLS_USE_DISTUTILS=stdlib
PYTHON=coverage run --source pbr --parallel-mode
commands =
stestr run {posargs}