From da6be56d443c1de883b433c5dd3884fee20637ed Mon Sep 17 00:00:00 2001 From: Dan Callaghan Date: Mon, 15 Jan 2018 10:26:19 +1000 Subject: [PATCH] Update to 1.6.0 bug fix release (RHBZ#1534132) --- .gitignore | 1 + ...in-detection-to-work-with-new-Sphinx.patch | 125 ------------------ ...omain-Add-missing-call-to-add_domain.patch | 25 ---- ...ain-autohttp-Use-app.setup_extension.patch | 82 ------------ python-sphinxcontrib-httpdomain.spec | 14 +- sources | 2 +- 6 files changed, 7 insertions(+), 242 deletions(-) delete mode 100644 0001-Update-http-domain-detection-to-work-with-new-Sphinx.patch delete mode 100644 0002-httpdomain-Add-missing-call-to-add_domain.patch delete mode 100644 0003-httpdomain-autohttp-Use-app.setup_extension.patch diff --git a/.gitignore b/.gitignore index f9dbd81..1a25228 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/0001-Update-http-domain-detection-to-work-with-new-Sphinx.patch b/0001-Update-http-domain-detection-to-work-with-new-Sphinx.patch deleted file mode 100644 index e3eb375..0000000 --- a/0001-Update-http-domain-detection-to-work-with-new-Sphinx.patch +++ /dev/null @@ -1,125 +0,0 @@ -From 9b47b140c0b36c3914eb8314511098a39311c27b Mon Sep 17 00:00:00 2001 -From: Dave Shawley -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, '') -+ result.append(line, '') - 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('', '') - 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 - diff --git a/0002-httpdomain-Add-missing-call-to-add_domain.patch b/0002-httpdomain-Add-missing-call-to-add_domain.patch deleted file mode 100644 index d1940a2..0000000 --- a/0002-httpdomain-Add-missing-call-to-add_domain.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 482c93aa46b79d0d0d2d0386c71288ec5e666a0b Mon Sep 17 00:00:00 2001 -From: Dave Shawley -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 - diff --git a/0003-httpdomain-autohttp-Use-app.setup_extension.patch b/0003-httpdomain-autohttp-Use-app.setup_extension.patch deleted file mode 100644 index 0988b83..0000000 --- a/0003-httpdomain-autohttp-Use-app.setup_extension.patch +++ /dev/null @@ -1,82 +0,0 @@ -From 8d0b0ecd213e668529b531f618e10e4eaadc6340 Mon Sep 17 00:00:00 2001 -From: Dave Shawley -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 - diff --git a/python-sphinxcontrib-httpdomain.spec b/python-sphinxcontrib-httpdomain.spec index e393f2b..353a492 100644 --- a/python-sphinxcontrib-httpdomain.spec +++ b/python-sphinxcontrib-httpdomain.spec @@ -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 - 1.6.0-1 +- Update to 1.6.0 bug fix release (RHBZ#1534132) + * Thu Jul 27 2017 Fedora Release Engineering - 1.5.0-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild diff --git a/sources b/sources index 2bf92f2..52ebbee 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -db069391a08c0f0bd6aa6819f5018337 sphinxcontrib-httpdomain-1.5.0.tar.gz +SHA512 (sphinxcontrib-httpdomain-1.6.0.tar.gz) = f408b59f5ffbd194edf62995b3f4430a5f06d5483b12dd0c9cc9005912dae8df30a38db26fb23fa8ef1b03e38381ae9210296b353decf338fa571271784ac986