Imported Upstream version 5.0.0 upstream/5.0.0
authorJinWang An <jinwang.an@samsung.com>
Mon, 28 Dec 2020 04:46:30 +0000 (13:46 +0900)
committerJinWang An <jinwang.an@samsung.com>
Mon, 28 Dec 2020 04:46:30 +0000 (13:46 +0900)
17 files changed:
.zuul.yaml
ChangeLog
PKG-INFO
doc/source/index.rst
doc/source/user/features.rst
doc/source/user/using.rst
lower-constraints.txt
pbr.egg-info/PKG-INFO
pbr.egg-info/SOURCES.txt
pbr/core.py
pbr/packaging.py
pbr/tests/test_hooks.py
pbr/tests/test_packaging.py
releasenotes/notes/long-descr-content-type-f9a1003acbb8740f.yaml [new file with mode: 0644]
setup.cfg
test-requirements.txt
tox.ini

index 0541e40e9a2064a2cf878dde52587db92b2d59c7..df57d8d9545e54f76db17dd7a6b75ab99222ffe8 100644 (file)
 
 - project:
     templates:
+      - lib-forward-testing
+      - lib-forward-testing-python3
+      - openstack-cover-jobs
+      - openstack-lower-constraints-jobs
       - openstack-python-jobs
       - openstack-python35-jobs
       - openstack-python36-jobs
-      - lib-forward-testing
-      - lib-forward-testing-python3
-      - publish-openstack-docs-pti
       - periodic-stable-jobs
+      - publish-openstack-docs-pti
     check:
       jobs:
-        - openstack-tox-lower-constraints
         - pbr-installation-devstack
         - pbr-installation-upstream-devstack
     gate:
       jobs:
-        - openstack-tox-lower-constraints
         - pbr-installation-devstack
         - pbr-installation-upstream-devstack
-    post:
-      jobs:
-        - openstack-tox-cover
index 4f3640d5e4760cec5ee5724dc399fd100e8bd3fc..c431e964b89258d37f3f6c23a179f2e6aa64b6ab 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,10 +1,20 @@
 CHANGES
 =======
 
+5.0.0
+-----
+
+* Use templates for cover and lower-constraints
+* Special case long\_description\_content\_type
+* tox: Suppress output
+* Support wheel 0.32.0+
+
 4.3.0
 -----
 
 * Remove my\_ip from generated wsgi script
+* docs: Add docs for reno integration
+* Skip test for testr hook being installed when testr is not available
 * Fix typo in contribution instructions
 * Add release note for fix to bug 1786306
 * Move pbr-installation jobs in-tree
@@ -15,6 +25,7 @@ CHANGES
 * switch documentation job to new PTI
 * import zuul job settings from project-config
 * Ignore Zuul when generating AUTHORS
+* packaging: Remove support for pyN requirement files
 * tox: Re-add cover target
 
 4.2.0
index 50d222f566645109ba0d5f044c0a3a106215d598..5ecf732be3a25b4017522dd829265db8f0d4dc58 100644 (file)
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,14 +1,14 @@
 Metadata-Version: 2.1
 Name: pbr
-Version: 4.3.0
+Version: 5.0.0
 Summary: Python Build Reasonableness
 Home-page: https://docs.openstack.org/pbr/latest/
 Author: OpenStack
 Author-email: openstack-dev@lists.openstack.org
 License: UNKNOWN
+Project-URL: Source Code, https://git.openstack.org/cgit/openstack-dev/pbr/
 Project-URL: Documentation, https://docs.openstack.org/pbr/
 Project-URL: Bug Tracker, https://bugs.launchpad.net/pbr/
-Project-URL: Source Code, https://git.openstack.org/cgit/openstack-dev/pbr/
 Description: Introduction
         ============
         
index 60cd46172b51ee64e3f9333a431d7f043ee8e379..428d835604d8efe20f1917b53498d210182cefc7 100644 (file)
@@ -21,6 +21,7 @@ using an install tool such as *pip*.
 * **ChangeLog**: Generate ChangeLog from git log
 * **Manifest**: Generate a sensible manifest from git files and some standard
   files
+* **Release Notes**: Generate a release notes file using reno
 * **Requirements**: Store your dependencies in a pip requirements file
 * **long_description**: Use your README file as a long_description
 * **Smart find_packages**: Smartly find packages under your root package
index dfbc18b46c6c7de3bbdfac9801bec0fefd4f20ac..46c9d039792e721d1474e6a0708a0c014f8ccf74 100644 (file)
@@ -62,7 +62,7 @@ From this, we note a couple of the main features of *pbr*:
 - Extensive use of ``setup.cfg`` for configuration
 - Automatic package metadata generation (``version``)
 - Automatic metadata file generation (``AUTHOR``, ``ChangeLog``,
-  ``MANIFEST.in``)
+  ``MANIFEST.in``, ``RELEASENOTES.txt``)
 
 In addition, there are other things that you don't see here but which *pbr*
 will do for you:
@@ -181,6 +181,10 @@ probably a good long_description. So we'll just inject the contents of your
 You can also specify the exact file you want to use using the
 ``description-file`` parameter.
 
+You can set the ``description-content-type`` to a MIME type that may
+help rendering of the description; for example ``text/markdown`` or
+``text/x-rst; charset=UTF-8``.
+
 Requirements
 ~~~~~~~~~~~~
 
@@ -200,14 +204,16 @@ for your project and will then parse these files, split them up appropriately,
 and inject them into the ``install_requires``, ``tests_require`` and/or
 ``dependency_links`` arguments to ``setup``. Voila!
 
-You can also have a requirement file for each specific major version of Python.
-If you want to have a different package list for Python 3 then just drop a
-``requirements-py3.txt`` and it will be used instead.
-
 Finally, it is possible to specify groups of optional dependencies, or
 :ref:`"extra" requirements <extra-requirements>`, in your ``setup.cfg`` rather
 than ``setup.py``.
 
+.. versionchanged:: 5.0
+
+   Previously you could specify requirements for a given major version of
+   Python using requirments files with a ``-pyN`` suffix. This was deprecated
+   in 4.0 and removed in 5.0 in favour of environment markers.
+
 Automatic File Generation
 -------------------------
 
@@ -253,6 +259,21 @@ test files.
 
 __ https://packaging.python.org/tutorials/distributing-packages/#manifest-in
 
+Release Notes
+~~~~~~~~~~~~~
+
+.. admonition:: Summary
+
+    *pbr* will automatically use *reno* \'s ``build_reno`` setuptools command
+    to generate a release notes file, if reno is available and configured.
+
+If using *reno*, you may wish to include a copy of the release notes in your
+packages. *reno* provides a ``build_reno`` `setuptools command`__ and, if reno
+is present and configured, *pbr* will automatically call this to generate a
+release notes file for inclusion in your package.
+
+__ https://docs.openstack.org/reno/latest/user/setuptools.html
+
 Setup Commands
 --------------
 
index b5e28eb4936211738332bcba64860ff0c4918629..0104640c803598323a79a5bb98d3b7872673be30 100644 (file)
@@ -382,20 +382,18 @@ Requirements
 
 Requirements files are used in place of the ``install_requires`` and
 ``extras_require`` attributes. Requirement files should be given one of the
-below names. This order is also the order that the requirements are tried in
-(where ``N`` is the Python major version number used to install the package):
+below names. This order is also the order that the requirements are tried in:
 
-* ``requirements-pyN.txt``
-* ``tools/pip-requires-py3``
 * ``requirements.txt``
 * ``tools/pip-requires``
 
 Only the first file found is used to install the list of packages it contains.
 
-.. note::
+.. versionchanged:: 5.0
 
-   The ``requirements-pyN.txt`` file is deprecated - ``requirements.txt``
-   should be universal. You can use `Environment markers`_ for this purpose.
+   Previously you could specify requirements for a given major version of
+   Python using requirements files with a ``-pyN`` suffix. This was deprecated
+   in 4.0 and removed in 5.0 in favour of environment markers.
 
 .. _extra-requirements:
 
index 44956cef48ed377f8ca730d5a459582f10dba223..173a299cb6c34ef9c8972802ba0a985c4bbb67a6 100644 (file)
@@ -26,7 +26,7 @@ six==1.10.0
 snowballstemmer==1.2.1
 Sphinx==1.6.5
 sphinxcontrib-websupport==1.0.1
-stestr==2.0.0
+stestr==2.1.0
 testrepository==0.0.18
 testresources==2.0.0
 testscenarios==0.4
index 50d222f566645109ba0d5f044c0a3a106215d598..5ecf732be3a25b4017522dd829265db8f0d4dc58 100644 (file)
@@ -1,14 +1,14 @@
 Metadata-Version: 2.1
 Name: pbr
-Version: 4.3.0
+Version: 5.0.0
 Summary: Python Build Reasonableness
 Home-page: https://docs.openstack.org/pbr/latest/
 Author: OpenStack
 Author-email: openstack-dev@lists.openstack.org
 License: UNKNOWN
+Project-URL: Source Code, https://git.openstack.org/cgit/openstack-dev/pbr/
 Project-URL: Documentation, https://docs.openstack.org/pbr/
 Project-URL: Bug Tracker, https://bugs.launchpad.net/pbr/
-Project-URL: Source Code, https://git.openstack.org/cgit/openstack-dev/pbr/
 Description: Introduction
         ============
         
index ff5be826e56b27e618f4ebc0c59d87abd727eaf3..fd66c5712ab5435d943d4aaa64838a18e72dca87 100644 (file)
@@ -95,6 +95,7 @@ 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/long-descr-content-type-f9a1003acbb8740f.yaml
 releasenotes/notes/remove-command-hooks-907d9c2325f306ca.yaml
 releasenotes/notes/support-vcs-uris-with-subdirectories-20ad68b6138f72ca.yaml
 releasenotes/notes/v_version-457b38c8679c5868.yaml
index a93253baddf4796a1d3be3c80ef0f0979cf95d54..0760ab92fdbb77635233a8654be194b14730c533 100644 (file)
@@ -103,6 +103,16 @@ def pbr(dist, attr, value):
         raise errors.DistutilsSetupError(
             'Error parsing %s: %s: %s' % (path, e.__class__.__name__, e))
 
+
+    # There are some metadata fields that are only supported by
+    # setuptools and not distutils, and hence are not in
+    # dist.metadata.  We are OK to write these in.  For gory details
+    # see
+    #  https://github.com/pypa/setuptools/pull/1343
+    _DISTUTILS_UNSUPPORTED_METADATA = (
+        'long_description_content_type', 'project_urls', 'provides_extras'
+    )
+
     # Repeat some of the Distribution initialization code with the newly
     # provided attrs
     if attrs:
@@ -115,6 +125,8 @@ def pbr(dist, attr, value):
                 setattr(dist.metadata, key, val)
             elif hasattr(dist, key):
                 setattr(dist, key, val)
+            elif key in _DISTUTILS_UNSUPPORTED_METADATA:
+                setattr(dist.metadata, key, val)
             else:
                 msg = 'Unknown distribution option: %s' % repr(key)
                 warnings.warn(msg)
index dc0b60c5eae29f8393718b8f36777d531f58a139..d8d37372b1e3b999a733b79f997746ab2a6c3d05 100644 (file)
@@ -81,14 +81,16 @@ def _any_existing(file_list):
 def get_reqs_from_files(requirements_files):
     existing = _any_existing(requirements_files)
 
+    # TODO(stephenfin): Remove this in pbr 6.0+
     deprecated = [f for f in existing if f in PY_REQUIREMENTS_FILES]
     if deprecated:
         warnings.warn('Support for \'-pyN\'-suffixed requirements files is '
-                      'deprecated in pbr 4.0 and will be removed in 5.0. '
+                      'removed in pbr 5.0 and these files are now ignored. '
                       'Use environment markers instead. Conflicting files: '
                       '%r' % deprecated,
                       DeprecationWarning)
 
+    existing = [f for f in existing if f not in PY_REQUIREMENTS_FILES]
     for requirements_file in existing:
         with open(requirements_file, 'r') as fil:
             return fil.read().split('\n')
index 0fcf96cac2cad32cbbde1e21451e6c8fbfefebd4..3f7479048730028402c0d3914d3561761327e8d3 100644 (file)
@@ -41,7 +41,9 @@
 import os
 
 from testtools import matchers
+from testtools import skipUnless
 
+from pbr import testr_command
 from pbr.tests import base
 from pbr.tests import util
 
@@ -66,6 +68,7 @@ class TestHooks(base.BaseTestCase):
         assert 'test_hook_1\ntest_hook_2' in stdout
         assert return_code == 0
 
+    @skipUnless(testr_command.have_testr, "testrepository not available")
     def test_custom_commands_known(self):
         stdout, _, return_code = self.run_setup('--help-commands')
         self.assertFalse(return_code)
index 9bd91ae024aeaaf19c942985636bcc1c88f3c331..d19dd05bfc5b8beceb76e06d7aedf79913f8ac13 100644 (file)
@@ -43,7 +43,6 @@ import email.errors
 import imp
 import os
 import re
-import sys
 import sysconfig
 import tempfile
 import textwrap
@@ -56,7 +55,7 @@ import testscenarios
 import testtools
 from testtools import matchers
 import virtualenv
-import wheel.install
+from wheel import wheelfile
 
 from pbr import git
 from pbr import packaging
@@ -372,13 +371,13 @@ class TestPackagingWheels(base.BaseTestCase):
         relative_wheel_filename = os.listdir(dist_dir)[0]
         absolute_wheel_filename = os.path.join(
             dist_dir, relative_wheel_filename)
-        wheel_file = wheel.install.WheelFile(absolute_wheel_filename)
+        wheel_file = wheelfile.WheelFile(absolute_wheel_filename)
         wheel_name = wheel_file.parsed_filename.group('namever')
         # Create a directory path to unpack the wheel to
         self.extracted_wheel_dir = os.path.join(dist_dir, wheel_name)
         # Extract the wheel contents to the directory we just created
-        wheel_file.zipfile.extractall(self.extracted_wheel_dir)
-        wheel_file.zipfile.close()
+        wheel_file.extractall(self.extracted_wheel_dir)
+        wheel_file.close()
 
     def test_data_directory_has_wsgi_scripts(self):
         # Build the path to the scripts directory
@@ -549,28 +548,6 @@ class ParseRequirementsTest(base.BaseTestCase):
         result = packaging.parse_requirements([requirements])
         self.assertEqual(['pbr'], result)
 
-    @mock.patch('warnings.warn')
-    def test_python_version(self, mock_warn):
-        with open("requirements-py%d.txt" % sys.version_info[0],
-                  "w") as fh:
-            fh.write("# this is a comment\nfoobar\n# and another one\nfoobaz")
-        self.assertEqual(['foobar', 'foobaz'],
-                         packaging.parse_requirements())
-        mock_warn.assert_called_once_with(mock.ANY, DeprecationWarning)
-
-    @mock.patch('warnings.warn')
-    def test_python_version_multiple_options(self, mock_warn):
-        with open("requirements-py1.txt", "w") as fh:
-            fh.write("thisisatrap")
-        with open("requirements-py%d.txt" % sys.version_info[0],
-                  "w") as fh:
-            fh.write("# this is a comment\nfoobar\n# and another one\nfoobaz")
-        self.assertEqual(['foobar', 'foobaz'],
-                         packaging.parse_requirements())
-        # even though we have multiple offending files, this should only be
-        # called once
-        mock_warn.assert_called_once_with(mock.ANY, DeprecationWarning)
-
 
 class ParseRequirementsTestScenarios(base.BaseTestCase):
 
diff --git a/releasenotes/notes/long-descr-content-type-f9a1003acbb8740f.yaml b/releasenotes/notes/long-descr-content-type-f9a1003acbb8740f.yaml
new file mode 100644 (file)
index 0000000..5912332
--- /dev/null
@@ -0,0 +1,6 @@
+---
+fixes:
+  - |
+    The ``description-content-type`` was not being set correctly.  It
+    will now be correctly populated when using ``setuptools`` 39.2.0
+    and beyond.
index 8d6451cbb4ff244d8f7d385f9d43e9924628c351..ac88d23892d2cf3e14e9fdfd7c43be57e9a605c1 100644 (file)
--- a/setup.cfg
+++ b/setup.cfg
@@ -53,7 +53,7 @@ build-dir = doc/build
 source-dir = doc/source
 warning-is-error = 1
 
-[wheel]
+[bdist_wheel]
 universal = 1
 
 [egg_info]
index 8fdcb83918505d0d08e793f6578fabf9b526383a..70e4ca04aaf497c28ffe91e1552f33c89fe3c494 100644 (file)
@@ -1,15 +1,17 @@
 # The order of packages is significant, because pip processes them in the order
 # of appearance. Changing the order has an impact on the overall integration
 # process, which may cause wedges in the gate later.
+wheel>=0.32.0 # MIT
 fixtures>=3.0.0 # Apache-2.0/BSD
 hacking!=0.13.0,<0.14,>=0.12.0 # Apache-2.0
 mock>=2.0.0 # BSD
 six>=1.10.0 # MIT
-stestr>=2.0.0 # Apache-2.0
+stestr>=2.1.0 # Apache-2.0
 testresources>=2.0.0 # Apache-2.0/BSD
 testscenarios>=0.4 # Apache-2.0/BSD
 testtools>=2.2.0 # MIT
 virtualenv>=14.0.6 # MIT
+coverage!=4.4,>=4.0 # Apache-2.0
 
 # optionally exposed by distutils commands
 sphinx!=1.6.6,!=1.6.7,>=1.6.2 # BSD
diff --git a/tox.ini b/tox.ini
index d97e6ff782b7d11ad620a837fabb0a53ff0149af..4d460d8b765378cc9a81bf3b57b692695f996cd9 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -5,11 +5,15 @@ envlist = py{27,35,36},pep8,docs
 [testenv]
 usedevelop = True
 install_command = pip install {opts} {packages}
-passenv = PBR_INTEGRATION PIPFLAGS PIPVERSION PBRVERSION REPODIR WHEELHOUSE PROJECTS OS_TEST_TIMEOUT OS_STDOUT_CAPTURE OS_STDERR_CAPTURE
+passenv = PBR_INTEGRATION PIPFLAGS PIPVERSION PBRVERSION REPODIR WHEELHOUSE PROJECTS
+setenv =
+  OS_STDOUT_CAPTURE={env:OS_STDOUT_CAPTURE:1}
+  OS_STDERR_CAPTURE={env:OS_STDERR_CAPTURE:1}
+  OS_TEST_TIMEOUT={env:OS_TEST_TIMEOUT:60}
 deps =
   -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
   -r{toxinidir}/test-requirements.txt
-commands = stestr run {posargs}
+commands = stestr run --suppress-attachments {posargs}
 
 [testenv:pep8]
 basepython = python3