Update to the current oslo.* library version releases

os-api-ref: Drop upstreamed patches that are present
in new release
os-win: convert to using stestr

Change-Id: I2ee3730bd8fb78a8c88a032654fb4569081bd677
This commit is contained in:
Dirk Mueller
2019-07-26 13:08:03 +02:00
parent 831bb61c23
commit fe3b9c6f03
7 changed files with 13 additions and 327 deletions

View File

@@ -1,215 +0,0 @@
From 525eee5a72ac0b0dc84d22336f061e3776e26c62 Mon Sep 17 00:00:00 2001
From: Stephen Finucane <stephenfin@redhat.com>
Date: Thu, 25 Apr 2019 17:23:43 +0100
Subject: [PATCH] Add support for Sphinx 2.0
Sphinx 2.0 switched the default HTML builder from HTML4 to HTML5 [1].
Since some of our tests are validating raw HTML output, this has caused
them to break. We can't drop support for Sphinx < 2.0 yet since Sphinx
2.0 doesn't support Python 2.7, so simply if-else this mofo until such a
time as we _can_ drop support.
[1] https://github.com/sphinx-doc/sphinx/issues/4587
Change-Id: I4631169908e34fa924f5a0a783a94ad9c1215d9f
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
---
os_api_ref/tests/test_basic_example.py | 91 +++++++++++++++++++++++++-
os_api_ref/tests/test_microversions.py | 45 ++++++++++++-
2 files changed, 132 insertions(+), 4 deletions(-)
diff --git a/os_api_ref/tests/test_basic_example.py b/os_api_ref/tests/test_basic_example.py
index dc89bae..20a4fad 100644
--- a/os_api_ref/tests/test_basic_example.py
+++ b/os_api_ref/tests/test_basic_example.py
@@ -91,7 +91,33 @@ class TestBasicExample(base.TestCase):
def test_parameters(self):
"""Do we get some parameters table"""
- table = """<table border="1" class="docutils">
+ # TODO(stephenfin): Drop support for this once we drop support for both
+ # Python 2.7 and Sphinx < 2.0, likely in "U"
+ if sphinx.version_info >= (2, 0, 0):
+ table = """<table class="docutils align-center">
+<colgroup>
+<col style="width: 20%"/>
+<col style="width: 10%"/>
+<col style="width: 10%"/>
+<col style="width: 60%"/>
+</colgroup>
+<thead>
+<tr class="row-odd"><th class="head"><p>Name</p></th>
+<th class="head"><p>In</p></th>
+<th class="head"><p>Type</p></th>
+<th class="head"><p>Description</p></th>
+</tr>
+</thead>
+<tbody>
+<tr class="row-even"><td><p>name</p></td>
+<td><p>body</p></td>
+<td><p>string</p></td>
+<td><p>The name of things</p></td>
+</tr>
+</tbody>
+</table>"""
+ else:
+ table = """<table border="1" class="docutils">
<colgroup>
<col width="20%"/>
<col width="10%"/>
@@ -118,7 +144,65 @@ class TestBasicExample(base.TestCase):
def test_rest_response(self):
- success_table = """table border="1" class="docutils">
+ # TODO(stephenfin): Drop support for this once we drop support for both
+ # Python 2.7 and Sphinx < 2.0, likely in "U"
+ if sphinx.version_info >= (2, 0, 0):
+ success_table = """<table class="docutils align-center">
+<colgroup>
+<col style="width: 30%"/>
+<col style="width: 70%"/>
+</colgroup>
+<thead>
+<tr class="row-odd"><th class="head"><p>Code</p></th>
+<th class="head"><p>Reason</p></th>
+</tr>
+</thead>
+<tbody>
+<tr class="row-even"><td><code>200 - OK</code></td>
+<td><p>Request was successful.</p></td>
+</tr>
+<tr class="row-odd"><td><code>100 - Continue</code></td>
+<td><p>An unusual code for an API</p></td>
+</tr>
+<tr class="row-even"><td><code>201 - Created</code></td>
+<td><p>Resource was created and is ready to use.</p></td>
+</tr>
+</tbody>
+</table>"""
+
+ error_table = """<table class="docutils align-center">
+<colgroup>
+<col style="width: 30%"/>
+<col style="width: 70%"/>
+</colgroup>
+<thead>
+<tr class="row-odd"><th class="head"><p>Code</p></th>
+<th class="head"><p>Reason</p></th>
+</tr>
+</thead>
+<tbody>
+<tr class="row-even"><td><code>405 - Method Not Allowed</code></td>
+<td><p>Method is not valid for this endpoint.</p></td>
+</tr>
+<tr class="row-odd"><td><code>403 - Forbidden</code></td>
+<td><p>Policy does not allow current user to do this operation.</p></td>
+</tr>
+<tr class="row-even"><td><code>401 - Unauthorized</code></td>
+<td><p>User must authenticate before making a request</p></td>
+</tr>
+<tr class="row-odd"><td><code>400 - Bad Request</code></td>
+<td><p>Some content in the request was invalid</p></td>
+</tr>
+<tr class="row-even"><td><code>500 - Internal Server Error</code></td>
+<td><p>Something went wrong inside the service.</p></td>
+</tr>
+<tr class="row-odd"><td><code>409 - Conflict</code></td>
+<td><p>There is already a zone with this name.</p></td>
+</tr>
+</tbody>
+</table>"""
+ else:
+ success_table = """table border="1" class="docutils">
<colgroup>
<col width="30%"/>
<col width="70%"/>
@@ -142,7 +226,7 @@ class TestBasicExample(base.TestCase):
</table>
"""
- error_table = """<table border="1" class="docutils">
+ error_table = """<table border="1" class="docutils">
<colgroup>
<col width="30%"/>
<col width="70%"/>
@@ -174,5 +258,6 @@ class TestBasicExample(base.TestCase):
</tbody>
</table>
"""
+
self.assertIn(success_table, self.content)
self.assertIn(error_table, self.content)
diff --git a/os_api_ref/tests/test_microversions.py b/os_api_ref/tests/test_microversions.py
index d58f673..11f3636 100644
--- a/os_api_ref/tests/test_microversions.py
+++ b/os_api_ref/tests/test_microversions.py
@@ -18,6 +18,7 @@ Tests for `os_api_ref` module.
"""
from bs4 import BeautifulSoup
+import sphinx
from sphinx_testing import with_app
from os_api_ref.tests import base
@@ -55,7 +56,48 @@ class TestMicroversions(base.TestCase):
def test_parameters_table(self):
"""Test that min / max mv css class attributes are set in params"""
- table = """<div class="api-detail collapse section" id="list-servers-detail">
+ if sphinx.version_info >= (2, 0, 0):
+ table = """<div class="api-detail collapse section" id="list-servers-detail">
+<table class="docutils align-center">
+<colgroup>
+<col style="width: 20%"/>
+<col style="width: 10%"/>
+<col style="width: 10%"/>
+<col style="width: 60%"/>
+</colgroup>
+<thead>
+<tr class="row-odd"><th class="head"><p>Name</p></th>
+<th class="head"><p>In</p></th>
+<th class="head"><p>Type</p></th>
+<th class="head"><p>Description</p></th>
+</tr>
+</thead>
+<tbody>
+<tr class="row-even"><td><p>name</p></td>
+<td><p>body</p></td>
+<td><p>string</p></td>
+<td><p>The name of things</p></td>
+</tr>
+<tr class="rp_min_ver_2_11 row-odd"><td><p>name2</p></td>
+<td><p>body</p></td>
+<td><p>string</p></td>
+<td><p>The name of things</p>
+<p><strong>New in version 2.11</strong></p>
+</td>
+</tr>
+<tr class="rp_max_ver_2_20 row-even"><td><p>name3</p></td>
+<td><p>body</p></td>
+<td><p>string</p></td>
+<td><p>The name of things</p>
+<p><strong>Available until version 2.20</strong></p>
+</td>
+</tr>
+</tbody>
+</table>
+</div>
+""" # noqa
+ else:
+ table = """<div class="api-detail collapse section" id="list-servers-detail">
<table border="1" class="docutils">
<colgroup>
<col width="20%"/>
@@ -94,6 +136,7 @@ class TestMicroversions(base.TestCase):
</table>
</div>
""" # noqa
+
self.assertIn(table, self.content)
def test_mv_selector(self):
--
2.21.0

View File

@@ -1,98 +0,0 @@
From 2a3f53494df93d4fe0e67055f95fc3e33cf7e8f4 Mon Sep 17 00:00:00 2001
From: Stephen Finucane <stephenfin@redhat.com>
Date: Mon, 24 Jun 2019 16:07:20 +0100
Subject: [PATCH] Add support for Sphinx v2.1
Come a new Sphinx version, come new breakages. This one is because of
commit 107c20a11f [1], which changed the default centering style of
tables.
[1] https://github.com/sphinx-doc/sphinx/commit/107c20a11f
Change-Id: I1155300828ad0012bd80b7615a0baca121c5e72e
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
---
os_api_ref/tests/test_basic_example.py | 15 +++++++++------
os_api_ref/tests/test_microversions.py | 4 ++--
2 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/os_api_ref/tests/test_basic_example.py b/os_api_ref/tests/test_basic_example.py
index 20a4fad..dcfb7d7 100644
--- a/os_api_ref/tests/test_basic_example.py
+++ b/os_api_ref/tests/test_basic_example.py
@@ -94,7 +94,7 @@ class TestBasicExample(base.TestCase):
# TODO(stephenfin): Drop support for this once we drop support for both
# Python 2.7 and Sphinx < 2.0, likely in "U"
if sphinx.version_info >= (2, 0, 0):
- table = """<table class="docutils align-center">
+ table = """<table class="docutils align-{}">
<colgroup>
<col style="width: 20%"/>
<col style="width: 10%"/>
@@ -115,7 +115,8 @@ class TestBasicExample(base.TestCase):
<td><p>The name of things</p></td>
</tr>
</tbody>
-</table>"""
+</table>""".format('center' if sphinx.version_info < (2, 1, 0)
+ else 'default')
else:
table = """<table border="1" class="docutils">
<colgroup>
@@ -147,7 +148,7 @@ class TestBasicExample(base.TestCase):
# TODO(stephenfin): Drop support for this once we drop support for both
# Python 2.7 and Sphinx < 2.0, likely in "U"
if sphinx.version_info >= (2, 0, 0):
- success_table = """<table class="docutils align-center">
+ success_table = """<table class="docutils align-{}">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
@@ -168,9 +169,10 @@ class TestBasicExample(base.TestCase):
<td><p>Resource was created and is ready to use.</p></td>
</tr>
</tbody>
-</table>"""
+</table>""".format('center' if sphinx.version_info < (2, 1, 0)
+ else 'default')
- error_table = """<table class="docutils align-center">
+ error_table = """<table class="docutils align-{}">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
@@ -200,7 +202,8 @@ class TestBasicExample(base.TestCase):
<td><p>There is already a zone with this name.</p></td>
</tr>
</tbody>
-</table>"""
+</table>""".format('center' if sphinx.version_info < (2, 1, 0)
+ else 'default')
else:
success_table = """table border="1" class="docutils">
<colgroup>
diff --git a/os_api_ref/tests/test_microversions.py b/os_api_ref/tests/test_microversions.py
index 11f3636..9aa4bf2 100644
--- a/os_api_ref/tests/test_microversions.py
+++ b/os_api_ref/tests/test_microversions.py
@@ -58,7 +58,7 @@ class TestMicroversions(base.TestCase):
"""Test that min / max mv css class attributes are set in params"""
if sphinx.version_info >= (2, 0, 0):
table = """<div class="api-detail collapse section" id="list-servers-detail">
-<table class="docutils align-center">
+<table class="docutils align-{}">
<colgroup>
<col style="width: 20%"/>
<col style="width: 10%"/>
@@ -95,7 +95,7 @@ class TestMicroversions(base.TestCase):
</tbody>
</table>
</div>
-""" # noqa
+""".format('center' if sphinx.version_info < (2, 1, 0) else 'default') # noqa
else:
table = """<div class="api-detail collapse section" id="list-servers-detail">
<table border="1" class="docutils">
--
2.22.0

View File

@@ -1,5 +1,5 @@
{% set pypi_name = 'os-api-ref' %}
{% set upstream_version = upstream_version('1.6.1') %}
{% set upstream_version = upstream_version('1.6.2') %}
{% set rpm_release = '1' %}
{% set source = url_pypi() %}
@@ -11,8 +11,6 @@ License: {{ license('Apache-2.0') }}
Group: Development/Languages/Python
URL: https://launchpad.net/%{sname}
Source0: {{ source }}
Patch0: 0001-Add-support-for-Sphinx-2.0.patch
Patch1: 0001-Add-support-for-Sphinx-v2.1.patch
BuildRequires: openstack-macros
BuildRequires: {{ py2pkg('PyYAML', py_versions=['py2', 'py3']) }}
BuildRequires: {{ py2pkg('Sphinx', py_versions=['py2', 'py3']) }}

View File

@@ -1,5 +1,5 @@
{% set pypi_name = 'os-win' %}
{% set upstream_version = upstream_version('4.2.0') %}
{% set upstream_version = upstream_version('4.3.0') %}
{% set rpm_release = '0' %}
{% set source = url_pypi() %}
Name: {{ py2name('os-win') }}
@@ -22,7 +22,8 @@ BuildRequires: {{ py2pkg('oslo.i18n', py_versions=['py2', 'py3']) }}
BuildRequires: {{ py2pkg('oslo.log', py_versions=['py2', 'py3']) }}
BuildRequires: {{ py2pkg('oslotest', py_versions=['py2', 'py3']) }}
BuildRequires: {{ py2pkg('pbr', py_versions=['py2', 'py3']) }}
BuildRequires: {{ py2pkg('testrepository', py_versions=['py2', 'py3']) }}
BuildRequires: {{ py2pkg('reno', py_versions=['py2', 'py3']) }}
BuildRequires: {{ py2pkg('stestr', py_versions=['py2', 'py3']) }}
BuildRequires: {{ py2pkg('testscenarios', py_versions=['py2', 'py3']) }}
BuildRequires: {{ py2pkg('testtools', py_versions=['py2', 'py3']) }}
Requires: {{ py2pkg('Babel') }}
@@ -52,8 +53,8 @@ nova, cinder, networking-hyperv.
%package -n {{ py2name() }}-doc
Summary: Documentation for OpenStack Windows/Hyper-V Library
Group: Documentation/HTML
BuildRequires: {{ py2pkg('Sphinx') }}
BuildRequires: {{ py2pkg('openstackdocstheme') }}
BuildRequires: {{ py2pkg('Sphinx', py_versions=['py2', 'py3']) }}
BuildRequires: {{ py2pkg('openstackdocstheme', py_versions=['py2', 'py3']) }}
%description -n {{ py2name() }}-doc
Documentation for the Hyper-V library.
@@ -66,7 +67,9 @@ rm -f os_win/tests/unit/test_hacking.py
%build
%{python_build}
%{__python2} setup.py build_sphinx --builder=html,man
%sphinx_build -b html doc/source doc/build/html
%sphinx_build -b man doc/source doc/build/man
rm -rf doc/build/html/.{doctrees,buildinfo}
%install
@@ -78,9 +81,7 @@ install -p -D -m 644 doc/build/man/os-win.1 %{buildroot}/%{_mandir}/man1/os-win.
%python_install_alternative os-win.1
%check
%{python_expand rm -rf .testrepository
PYTHON=$python $python setup.py test
}
%python_exec -m stestr.cli run
%files %{python_files}
%doc README.rst ChangeLog

View File

@@ -1,5 +1,5 @@
{% set pypi_name = 'oslo.cache' %}
{% set upstream_version = upstream_version('1.35.0') %}
{% set upstream_version = upstream_version('1.36.0') %}
{% set rpm_release = '1' %}
{% set source = url_pypi() %}

View File

@@ -1,5 +1,5 @@
{% set pypi_name = 'oslo.service' %}
{% set upstream_version = upstream_version('1.39.0') %}
{% set upstream_version = upstream_version('1.40.0') %}
{% set rpm_release = '1' %}
{% set source = url_pypi() %}
%if 0%{?rhel} || 0%{?fedora}

View File

@@ -1,5 +1,5 @@
{% set pypi_name = 'oslo.upgradecheck' %}
{% set upstream_version = upstream_version('0.3.0') %}
{% set upstream_version = upstream_version('0.3.1') %}
{% set rpm_release = '1' %}
{% set source = url_pypi() %}