Imported Upstream version 5.3.0 upstream/5.3.0
authorJinWang An <jinwang.an@samsung.com>
Mon, 28 Dec 2020 04:47:00 +0000 (13:47 +0900)
committerJinWang An <jinwang.an@samsung.com>
Mon, 28 Dec 2020 04:47:00 +0000 (13:47 +0900)
18 files changed:
AUTHORS
ChangeLog
PKG-INFO
doc/requirements.txt
doc/source/conf.py
doc/source/reference/index.rst
doc/source/user/history.rst [deleted file]
doc/source/user/index.rst
lower-constraints.txt
pbr.egg-info/PKG-INFO
pbr.egg-info/SOURCES.txt
pbr/git.py
pbr/tests/test_packaging.py
pbr/tests/test_util.py
pbr/tests/test_wsgi.py
pbr/util.py
setup.cfg
tox.ini

diff --git a/AUTHORS b/AUTHORS
index 5ba4f1f347afd2c0c412bfc46572895f3f46ba67..40ba33aa091dac3f6ff7000c19851e788168b265 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -74,6 +74,7 @@ Luo Gangyi <luogangyi@chinamobile.com>
 Marc Abramowitz <marc@marc-abramowitz.com>
 Mark McLoughlin <markmc@redhat.com>
 Mark Sienkiewicz <sienkiew@stsci.edu>
+Martin Domke <mail@martindomke.net>
 Maru Newby <marun@redhat.com>
 Masaki Matsushita <glass.saga@gmail.com>
 Matt Riedemann <mriedem@us.ibm.com>
index 3abcc13069f6b7e37e88c91a30855af00238f7de..714ad170a45394bf6760d668f8c397912a7f8199 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,15 @@
 CHANGES
 =======
 
+5.3.0
+-----
+
+* Stop using pbr sphinx integration
+* Switch to release.o.o for constraints
+* Make WSGI tests listen on localhost
+* Allow git-tags to be SemVer compliant
+* Read description file as utf-8
+
 5.2.1
 -----
 
index affac5941e74f6d18b0f62a2cbd56441b38dede6..cc289378540114d8dfc75fa3aed9f2dc0c56f906 100644 (file)
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: pbr
-Version: 5.2.1
+Version: 5.3.0
 Summary: Python Build Reasonableness
 Home-page: https://docs.openstack.org/pbr/latest/
 Author: OpenStack
index 711fb9725295e7006043f3ad27c08913d3c3cc20..d0c1f36378252472fa9942654e005d2c98c49ea6 100644 (file)
@@ -1,4 +1,5 @@
 sphinx!=1.6.6,!=1.6.7,>=1.6.2,<2.0.0;python_version=='2.7' # BSD
 sphinx!=1.6.6,!=1.6.7,>=1.6.2;python_version>='3.4' # BSD
+sphinxcontrib-apidoc>=0.2.0  # BSD
 openstackdocstheme>=1.18.1 # Apache-2.0
 reno>=2.5.0 # Apache-2.0
index cc7f4b35b83c750b232d0949323dd5ab5c86d02d..13f63a0b5efe5da41ba8401648179f5d3d094b02 100644 (file)
@@ -8,7 +8,7 @@ sys.path.insert(0, os.path.abspath('../..'))
 
 # Add any Sphinx extension module names here, as strings. They can be
 # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
-extensions = ['sphinx.ext.autodoc', 'sphinx.ext.todo']
+extensions = ['sphinx.ext.autodoc', 'sphinx.ext.todo', 'sphinxcontrib.apidoc']
 # make openstackdocstheme optional to not increase the needed dependencies
 try:
     import openstackdocstheme
@@ -72,3 +72,11 @@ latex_documents = [
      '%s Documentation' % project,
      'OpenStack Foundation', 'manual'),
 ]
+
+# -- sphinxcontrib.apidoc configuration --------------------------------------
+
+apidoc_module_dir = '../../pbr'
+apidoc_output_dir = 'reference/api'
+apidoc_excluded_paths = [
+    'tests',
+]
index 68a9c324f087d1863ee5ed4cc2937b230b397066..3162d671e59599cd9f78a024d53e4b222fd06b27 100644 (file)
@@ -3,6 +3,5 @@
 ===================
 
 .. toctree::
-   :glob:
 
-   api/*
+   api/modules
diff --git a/doc/source/user/history.rst b/doc/source/user/history.rst
deleted file mode 100644 (file)
index 55439e7..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-=================
- Release History
-=================
-
-.. include:: ../../../ChangeLog
index 7854dc54ca296cb3bb96d5e2090a2b25d3ad0a06..0629e2e53855ba80214e19133a11fa8be9fe99a8 100644 (file)
@@ -9,4 +9,3 @@
    packagers
    semver
    compatibility
-   history
index 173a299cb6c34ef9c8972802ba0a985c4bbb67a6..fc576a5657a973d2d205edd4034561fc797a68e1 100644 (file)
@@ -25,6 +25,7 @@ requests==2.14.2
 six==1.10.0
 snowballstemmer==1.2.1
 Sphinx==1.6.5
+sphinxcontrib-apidoc==0.2.0
 sphinxcontrib-websupport==1.0.1
 stestr==2.1.0
 testrepository==0.0.18
index affac5941e74f6d18b0f62a2cbd56441b38dede6..cc289378540114d8dfc75fa3aed9f2dc0c56f906 100644 (file)
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: pbr
-Version: 5.2.1
+Version: 5.3.0
 Summary: Python Build Reasonableness
 Home-page: https://docs.openstack.org/pbr/latest/
 Author: OpenStack
index 2988e802980bba22cc63aefb85bca43492dbf5a3..d6737974cba8cd80ed59b601baff229819446153 100644 (file)
@@ -19,7 +19,6 @@ doc/source/contributor/index.rst
 doc/source/reference/index.rst
 doc/source/user/compatibility.rst
 doc/source/user/features.rst
-doc/source/user/history.rst
 doc/source/user/index.rst
 doc/source/user/packagers.rst
 doc/source/user/semver.rst
index 6e18adae88c80542b6c47839c01dba7354c7108d..6e0e3467a9b7421b35f0a2814618ae4dcc62fa79 100644 (file)
@@ -223,6 +223,11 @@ def _iter_log_inner(git_dir):
     presentation logic to the output - making it suitable for different
     uses.
 
+    .. caution:: this function risk to return a tag that doesn't exist really
+                 inside the git objects list due to replacement made
+                 to tag name to also list pre-release suffix.
+                 Compliant with the SemVer specification (e.g 1.2.3-rc1)
+
     :return: An iterator of (hash, tags_set, 1st_line) tuples.
     """
     log.info('[pbr] Generating ChangeLog')
@@ -248,7 +253,7 @@ def _iter_log_inner(git_dir):
             for tag_string in refname.split("refs/tags/")[1:]:
                 # git tag does not allow : or " " in tag names, so we split
                 # on ", " which is the separator between elements
-                candidate = tag_string.split(", ")[0]
+                candidate = tag_string.split(", ")[0].replace("-", ".")
                 if _is_valid_version(candidate):
                     tags.add(candidate)
 
index 853844f49d2557c1e0fa506de4427345273cf2a2..308ae89cb11764cfee56035695ed5d4527ca7312 100644 (file)
@@ -670,6 +670,12 @@ class TestVersions(base.BaseTestCase):
         version = packaging._get_version_from_git('1.2.3')
         self.assertEqual('1.2.3', version)
 
+    def test_tagged_version_with_semver_compliant_prerelease(self):
+        self.repo.commit()
+        self.repo.tag('1.2.3-rc2')
+        version = packaging._get_version_from_git()
+        self.assertEqual('1.2.3.0rc2', version)
+
     def test_non_canonical_tagged_version_bump(self):
         self.repo.commit()
         self.repo.tag('1.4')
@@ -726,6 +732,13 @@ class TestVersions(base.BaseTestCase):
         version = packaging._get_version_from_git('1.2.3')
         self.assertThat(version, matchers.StartsWith('1.2.3.0a2.dev1'))
 
+    def test_untagged_version_after_semver_compliant_prerelease_tag(self):
+        self.repo.commit()
+        self.repo.tag('1.2.3-rc2')
+        self.repo.commit()
+        version = packaging._get_version_from_git()
+        self.assertEqual('1.2.3.0rc3.dev1', version)
+
     def test_preversion_too_low_simple(self):
         # That is, the target version is either already released or not high
         # enough for the semver requirements given api breaks etc.
index 393bc5cd719b7d22810aaaf8930b6e836917d1d2..1cbb2d2aa88aa13fdee64f147f05f14c1bc182e9 100644 (file)
@@ -1,3 +1,4 @@
+# -*- coding: utf-8 -*-
 # Copyright (c) 2015 Hewlett-Packard Development Company, L.P. (HP)
 #
 # Licensed under the Apache License, Version 2.0 (the "License"); you may
@@ -13,6 +14,7 @@
 # under the License.
 
 import io
+import tempfile
 import textwrap
 
 import six
@@ -197,3 +199,21 @@ class TestDataFilesParsing(base.BaseTestCase):
 
         self.assertEqual(self.data_files,
                          list(kwargs['data_files']))
+
+
+class TestUTF8DescriptionFile(base.BaseTestCase):
+    def test_utf8_description_file(self):
+        _, path = tempfile.mkstemp()
+        ini_template = """
+        [metadata]
+        description_file = %s
+        """
+        # Two \n's because pbr strips the file content and adds \n\n
+        # This way we can use it directly as the assert comparison
+        unicode_description = u'UTF8 description: é"…-ʃŋ\'\n\n'
+        ini = ini_template % path
+        with io.open(path, 'w', encoding='utf8') as f:
+            f.write(unicode_description)
+        config = config_from_ini(ini)
+        kwargs = util.setup_cfg_to_setup_kwargs(config)
+        self.assertEqual(unicode_description, kwargs['long_description'])
index f840610de1b0139abee406067722ec5f84ee2065..18732f741f970f4fef4829c39db3fc33bce8339e 100644 (file)
@@ -77,8 +77,8 @@ class TestWsgiScripts(base.BaseTestCase):
 
     def _test_wsgi(self, cmd_name, output, extra_args=None):
         cmd = os.path.join(self.temp_dir, 'bin', cmd_name)
-        print("Running %s -p 0" % cmd)
-        popen_cmd = [cmd, '-p', '0']
+        print("Running %s -p 0 -b 127.0.0.1" % cmd)
+        popen_cmd = [cmd, '-p', '0', '-b', '127.0.0.1']
         if extra_args:
             popen_cmd.extend(extra_args)
 
index e931b5ff0bc0aa2d74f94adbb106c07b84dd8f1a..323747e4e1bb3b84b073a1f414ade4d2fcf44ca4 100644 (file)
@@ -62,6 +62,7 @@ except ImportError:
 import logging  # noqa
 
 from collections import defaultdict
+import io
 import os
 import re
 import shlex
@@ -320,7 +321,7 @@ def setup_cfg_to_setup_kwargs(config, script_args=()):
                     in_cfg_value = split_multiline(in_cfg_value)
                     value = ''
                     for filename in in_cfg_value:
-                        description_file = open(filename)
+                        description_file = io.open(filename, encoding='utf-8')
                         try:
                             value += description_file.read().strip() + '\n\n'
                         finally:
index e4e58e6ac4c44eef6f5e0d8bb4d8a8f62cf7d487..5a787d88ec742688d4628dbc07ebd3999f3d97ec 100644 (file)
--- a/setup.cfg
+++ b/setup.cfg
@@ -32,13 +32,6 @@ classifier =
 packages = 
        pbr
 
-[pbr]
-autodoc_tree_index_modules = True
-autodoc_tree_excludes = 
-       setup.py
-       pbr/tests/
-api_doc_dir = reference/api
-
 [entry_points]
 distutils.setup_keywords = 
        pbr = pbr.core:pbr
@@ -47,12 +40,6 @@ egg_info.writers =
 console_scripts = 
        pbr = pbr.cmd.main:main
 
-[build_sphinx]
-all-files = 1
-build-dir = doc/build
-source-dir = doc/source
-warning-is-error = 1
-
 [bdist_wheel]
 universal = 1
 
diff --git a/tox.ini b/tox.ini
index d029afcb3b6f8fe7e4b4a44dffd94a06155043fc..5cc32a9adac333e00af5e2e7001dbfd8bea73fe9 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -13,7 +13,7 @@ setenv =
   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}
+  -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
   -r{toxinidir}/test-requirements.txt
 commands = stestr run --suppress-attachments {posargs}
 
@@ -23,12 +23,20 @@ commands = flake8 {posargs}
 
 [testenv:docs]
 basepython = python3
-deps = -r{toxinidir}/doc/requirements.txt
-commands = python setup.py build_sphinx
+whitelist_externals = rm
+deps =
+  -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
+  -r{toxinidir}/doc/requirements.txt
+commands =
+  rm -rf doc/build doc/source/reference/api
+  sphinx-build -W -b html doc/source doc/build/html {posargs}
 
 [testenv:releasenotes]
 basepython = python3
-deps = -r{toxinidir}/doc/requirements.txt
+whitelist_externals = rm
+deps =
+  -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
+  -r{toxinidir}/doc/requirements.txt
 commands =
   rm -rf releasenotes/build
   sphinx-build -W -b html -d releasenotes/build/doctrees releasenotes/source releasenotes/build/html