Update to 1.6.0 bug fix release (RHBZ#1534132)

This commit is contained in:
Dan Callaghan 2018-01-15 10:26:19 +10:00
parent 4bd76c6de9
commit da6be56d44
6 changed files with 7 additions and 242 deletions

1
.gitignore vendored
View File

@ -3,3 +3,4 @@
/sphinxcontrib-httpdomain-1.3.0.tar.gz
/sphinxcontrib-httpdomain-1.4.0.tar.gz
/sphinxcontrib-httpdomain-1.5.0.tar.gz
/sphinxcontrib-httpdomain-1.6.0.tar.gz

View File

@ -1,125 +0,0 @@
From 9b47b140c0b36c3914eb8314511098a39311c27b Mon Sep 17 00:00:00 2001
From: Dave Shawley <daveshawley@gmail.com>
Date: Fri, 23 Jun 2017 07:12:18 -0400
Subject: [PATCH 1/4] Update 'http' domain detection to work with new Sphinx.
The autohttp.*.setup functions were detecting whether httpdomain was
installed using an attribute on the sphinx application that was removed
in recent Sphinx versions. This commit:
(1) moves the idempotency logic into httpdomain.setup
(2) makes the logic work with new and old versions of sphinx by
falling back to the legacy behavior on AttributeError
(3) changes each setup function to always call the new idempotent
httpdomain.setup
---
httpdomain/sphinxcontrib/autohttp/bottle.py | 3 +--
httpdomain/sphinxcontrib/autohttp/flask.py | 3 +--
httpdomain/sphinxcontrib/autohttp/flaskqref.py | 13 ++++++-------
httpdomain/sphinxcontrib/autohttp/tornado.py | 3 +--
httpdomain/sphinxcontrib/httpdomain.py | 8 +++++++-
5 files changed, 16 insertions(+), 14 deletions(-)
diff --git a/httpdomain/sphinxcontrib/autohttp/bottle.py b/httpdomain/sphinxcontrib/autohttp/bottle.py
index d8c1859..306cadd 100644
--- a/httpdomain/sphinxcontrib/autohttp/bottle.py
+++ b/httpdomain/sphinxcontrib/autohttp/bottle.py
@@ -108,7 +108,6 @@ def run(self):
def setup(app):
- if 'http' not in app.domains:
- httpdomain.setup(app)
+ httpdomain.setup(app)
app.add_directive('autobottle', AutobottleDirective)
diff --git a/httpdomain/sphinxcontrib/autohttp/flask.py b/httpdomain/sphinxcontrib/autohttp/flask.py
index 4bd5232..be65f35 100644
--- a/httpdomain/sphinxcontrib/autohttp/flask.py
+++ b/httpdomain/sphinxcontrib/autohttp/flask.py
@@ -43,6 +43,5 @@ def run(self):
def setup(app):
- if 'http' not in app.domains:
- httpdomain.setup(app)
+ httpdomain.setup(app)
app.add_directive('autoflask', AutoflaskDirective)
diff --git a/httpdomain/sphinxcontrib/autohttp/flaskqref.py b/httpdomain/sphinxcontrib/autohttp/flaskqref.py
index c28bb15..3a70b4b 100644
--- a/httpdomain/sphinxcontrib/autohttp/flaskqref.py
+++ b/httpdomain/sphinxcontrib/autohttp/flaskqref.py
@@ -2,7 +2,7 @@
sphinxcontrib.autohttp.flaskqref
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- The sphinx.ext.autodoc-style HTTP API quick reference
+ The sphinx.ext.autodoc-style HTTP API quick reference
builder (from Flask)
for sphinxcontrib.httpdomain.
@@ -38,15 +38,15 @@ def run(self):
node.document = self.state.document
result = ViewList()
for line in QuickReferenceFlaskDirective.header:
- result.append(line, '<qrefflask>')
+ result.append(line, '<qrefflask>')
table={}
table_sorted_names=[]
-
+
for table_row in self.make_rst(qref=True):
name = table_row['name']
if table.get(name) is None:
table[name]=[]
- table[name].append(table_row)
+ table[name].append(table_row)
if name not in table_sorted_names:
table_sorted_names.append(name)
@@ -72,9 +72,8 @@ def run(self):
result.append('', '<qrefflask>')
nested_parse_with_titles(self.state, result, node)
return node.children
-
+
def setup(app):
- if 'http' not in app.domains:
- httpdomain.setup(app)
+ httpdomain.setup(app)
app.add_directive('qrefflask', QuickReferenceFlaskDirective)
diff --git a/httpdomain/sphinxcontrib/autohttp/tornado.py b/httpdomain/sphinxcontrib/autohttp/tornado.py
index 9a514fe..8efd343 100644
--- a/httpdomain/sphinxcontrib/autohttp/tornado.py
+++ b/httpdomain/sphinxcontrib/autohttp/tornado.py
@@ -123,6 +123,5 @@ def run(self):
def setup(app):
- if 'http' not in app.domains:
- httpdomain.setup(app)
+ httpdomain.setup(app)
app.add_directive('autotornado', AutoTornadoDirective)
diff --git a/httpdomain/sphinxcontrib/httpdomain.py b/httpdomain/sphinxcontrib/httpdomain.py
index d5c30a4..9812671 100644
--- a/httpdomain/sphinxcontrib/httpdomain.py
+++ b/httpdomain/sphinxcontrib/httpdomain.py
@@ -756,7 +756,13 @@ def content_callback(self, match):
def setup(app):
- app.add_domain(HTTPDomain)
+ try:
+ if app.registry.has_domain(HTTPDomain.name):
+ return
+ except AttributeError:
+ if HTTPDomain.name in app.domains:
+ return
+
try:
get_lexer_by_name('http')
except ClassNotFound:
--
2.9.4

View File

@ -1,25 +0,0 @@
From 482c93aa46b79d0d0d2d0386c71288ec5e666a0b Mon Sep 17 00:00:00 2001
From: Dave Shawley <daveshawley@gmail.com>
Date: Tue, 27 Jun 2017 08:01:21 -0400
Subject: [PATCH 2/4] httpdomain: Add missing call to add_domain.
---
httpdomain/sphinxcontrib/httpdomain.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/httpdomain/sphinxcontrib/httpdomain.py b/httpdomain/sphinxcontrib/httpdomain.py
index 9812671..6a25e2e 100644
--- a/httpdomain/sphinxcontrib/httpdomain.py
+++ b/httpdomain/sphinxcontrib/httpdomain.py
@@ -763,6 +763,8 @@ def setup(app):
if HTTPDomain.name in app.domains:
return
+ app.add_domain(HTTPDomain)
+
try:
get_lexer_by_name('http')
except ClassNotFound:
--
2.9.4

View File

@ -1,82 +0,0 @@
From 8d0b0ecd213e668529b531f618e10e4eaadc6340 Mon Sep 17 00:00:00 2001
From: Dave Shawley <daveshawley@gmail.com>
Date: Tue, 27 Jun 2017 08:11:57 -0400
Subject: [PATCH 3/4] httpdomain/autohttp: Use app.setup_extension.
This method has been available since sphinx 1.0 so there is no need to wrap
this in "version safety" checks and it is significantly cleaner.
---
httpdomain/sphinxcontrib/autohttp/bottle.py | 3 +--
httpdomain/sphinxcontrib/autohttp/flask.py | 2 +-
httpdomain/sphinxcontrib/autohttp/flaskqref.py | 3 +--
httpdomain/sphinxcontrib/autohttp/tornado.py | 2 +-
httpdomain/sphinxcontrib/httpdomain.py | 7 -------
5 files changed, 4 insertions(+), 13 deletions(-)
diff --git a/httpdomain/sphinxcontrib/autohttp/bottle.py b/httpdomain/sphinxcontrib/autohttp/bottle.py
index 306cadd..adf6c77 100644
--- a/httpdomain/sphinxcontrib/autohttp/bottle.py
+++ b/httpdomain/sphinxcontrib/autohttp/bottle.py
@@ -108,6 +108,5 @@ def run(self):
def setup(app):
- httpdomain.setup(app)
+ app.setup_extension('sphinxcontrib.httpdomain')
app.add_directive('autobottle', AutobottleDirective)
-
diff --git a/httpdomain/sphinxcontrib/autohttp/flask.py b/httpdomain/sphinxcontrib/autohttp/flask.py
index be65f35..b1fac45 100644
--- a/httpdomain/sphinxcontrib/autohttp/flask.py
+++ b/httpdomain/sphinxcontrib/autohttp/flask.py
@@ -43,5 +43,5 @@ def run(self):
def setup(app):
- httpdomain.setup(app)
+ app.setup_extension('sphinxcontrib.httpdomain')
app.add_directive('autoflask', AutoflaskDirective)
diff --git a/httpdomain/sphinxcontrib/autohttp/flaskqref.py b/httpdomain/sphinxcontrib/autohttp/flaskqref.py
index 3a70b4b..8f33d18 100644
--- a/httpdomain/sphinxcontrib/autohttp/flaskqref.py
+++ b/httpdomain/sphinxcontrib/autohttp/flaskqref.py
@@ -74,6 +74,5 @@ def run(self):
return node.children
def setup(app):
- httpdomain.setup(app)
+ app.setup_extension('sphinxcontrib.httpdomain')
app.add_directive('qrefflask', QuickReferenceFlaskDirective)
-
diff --git a/httpdomain/sphinxcontrib/autohttp/tornado.py b/httpdomain/sphinxcontrib/autohttp/tornado.py
index 8efd343..f844305 100644
--- a/httpdomain/sphinxcontrib/autohttp/tornado.py
+++ b/httpdomain/sphinxcontrib/autohttp/tornado.py
@@ -123,5 +123,5 @@ def run(self):
def setup(app):
- httpdomain.setup(app)
+ app.setup_extension('sphinxcontrib.httpdomain')
app.add_directive('autotornado', AutoTornadoDirective)
diff --git a/httpdomain/sphinxcontrib/httpdomain.py b/httpdomain/sphinxcontrib/httpdomain.py
index 6a25e2e..faa50f2 100644
--- a/httpdomain/sphinxcontrib/httpdomain.py
+++ b/httpdomain/sphinxcontrib/httpdomain.py
@@ -756,13 +756,6 @@ def content_callback(self, match):
def setup(app):
- try:
- if app.registry.has_domain(HTTPDomain.name):
- return
- except AttributeError:
- if HTTPDomain.name in app.domains:
- return
-
app.add_domain(HTTPDomain)
try:
--
2.9.4

View File

@ -2,16 +2,12 @@
%global upstream_name sphinxcontrib-httpdomain
Name: python-%{upstream_name}
Version: 1.5.0
Release: 5%{?dist}
Version: 1.6.0
Release: 1%{?dist}
Summary: Sphinx domain for documenting HTTP APIs
License: BSD
URL: http://packages.python.org/sphinxcontrib-httpdomain/
Source0: https://files.pythonhosted.org/packages/source/s/%{upstream_name}/%{upstream_name}-%{version}.tar.gz
# https://bitbucket.org/birkenfeld/sphinx-contrib/pull-requests/152
Patch1: 0001-Update-http-domain-detection-to-work-with-new-Sphinx.patch
Patch2: 0002-httpdomain-Add-missing-call-to-add_domain.patch
Patch3: 0003-httpdomain-autohttp-Use-app.setup_extension.patch
# issue to be filed(?)
Patch4: 0004-httpdomain-bump-domain-data-version.patch
BuildArch: noarch
@ -60,9 +56,6 @@ for generating documentation from Flask routing tables.
%prep
%setup -q -n %{upstream_name}-%{version}
%patch1 -p2
%patch2 -p2
%patch3 -p2
%patch4 -p2
rm -r *.egg-info
@ -91,6 +84,9 @@ rm -r *.egg-info
%endif
%changelog
* Mon Jan 15 2018 Dan Callaghan <dcallagh@redhat.com> - 1.6.0-1
- Update to 1.6.0 bug fix release (RHBZ#1534132)
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.5.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

View File

@ -1 +1 @@
db069391a08c0f0bd6aa6819f5018337 sphinxcontrib-httpdomain-1.5.0.tar.gz
SHA512 (sphinxcontrib-httpdomain-1.6.0.tar.gz) = f408b59f5ffbd194edf62995b3f4430a5f06d5483b12dd0c9cc9005912dae8df30a38db26fb23fa8ef1b03e38381ae9210296b353decf338fa571271784ac986