git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #12513 from nckx/master

Update & fix Sphinx [PR for Travis testing]

commitabdd8a81eb650a3d277e76b0f578d162bc819547 authorRobin Gloster <mail@glob.in> dateThu 21 Jan 2016, 05:30 (11 years ago) parent39a07cad561179
3 files changed+68−38
pkgs/development/python-modules/sphinx-1.3.1-pr-1946.patch−35 pkgs/development/python-modules/sphinx-fix-tests-with-pygments-2.1.patch+63 pkgs/top-level/python-packages.nix+5−3
pkgs/development/python-modules/sphinx-1.3.1-pr-1946.patchdeleted−35
@@ -1,35 +0,0 @@
1−From 7ce3b991229c74262f81ab7692a1dc6bde2416ee Mon Sep 17 00:00:00 2001
2−From: Barry Warsaw <barry@python.org>
3−Date: Thu, 25 Jun 2015 11:54:05 -0400
4−Subject: [PATCH] One way to work around the lack of
5− html.parser.HTMLParserError in Python 3.5
6−
7−---
8− sphinx/builders/linkcheck.py | 12 +++++++++++-
9− 1 file changed, 11 insertions(+), 1 deletion(-)
10−
11−diff --git a/sphinx/builders/linkcheck.py b/sphinx/builders/linkcheck.py
12−index 9f5c213..b05c5b2 100644
13−--- a/sphinx/builders/linkcheck.py
14−+++ b/sphinx/builders/linkcheck.py
15−@@ -19,9 +19,19 @@
16− from six.moves.urllib.request import build_opener, Request, HTTPRedirectHandler
17− from six.moves.urllib.parse import unquote, urlsplit, quote
18− from six.moves.urllib.error import HTTPError
19−-from six.moves.html_parser import HTMLParser, HTMLParseError
20−+from six.moves.html_parser import HTMLParser
21− from docutils import nodes
22−
23−+# 2015-06-25 barry@python.org. This exception was deprecated in Python 3.3 and
24−+# removed in Python 3.5, however for backward compatibility reasons, we're not
25−+# going to just remove it. If it doesn't exist, define an exception that will
26−+# never be caught but leaves the code in check_anchor() intact.
27−+try:
28−+ from six.moves.html_parser import HTMLParseError
29−+except ImportError:
30−+ class HTMLParseError(Exception):
31−+ pass
32−+
33− from sphinx.builders import Builder
34− from sphinx.util.console import purple, red, darkgreen, darkgray, \
35− darkred, turquoise
pkgs/development/python-modules/sphinx-fix-tests-with-pygments-2.1.patchnew file+63
@@ -0,0 +1,63 @@
1+From 5574aba60ed76f2bae947722122ac4d71ab8ed5a Mon Sep 17 00:00:00 2001
2+From: Takeshi KOMIYA <i.tkomiya@gmail.com>
3+Date: Mon, 18 Jan 2016 12:38:02 +0900
4+Subject: [PATCH] Fix tests are broken with pygments-2.1
5+
6+---
7+ tests/test_build_html.py | 2 +-
8+ tests/test_intl.py | 10 ++++++----
9+ 2 files changed, 7 insertions(+), 5 deletions(-)
10+
11+diff --git a/tests/test_build_html.py b/tests/test_build_html.py
12+index e330761..17ea089 100644
13+--- a/tests/test_build_html.py
14++++ b/tests/test_build_html.py
15+@@ -82,7 +82,7 @@ def checker(nodes):
16+ (".//a[@href='_downloads/img1.png']", ''),
17+ (".//pre", u'"quotes"'),
18+ (".//pre", u"'included'"),
19+- (".//pre/span[@class='s']", u'üöä'),
20++ (".//pre/span[@class='s2']", u'üöä'),
21+ (".//div[@class='inc-pyobj1 highlight-text']//pre",
22+ r'^class Foo:\n pass\n\s*$'),
23+ (".//div[@class='inc-pyobj2 highlight-text']//pre",
24+diff --git a/tests/test_intl.py b/tests/test_intl.py
25+index 4c665d4..b24ec65 100644
26+--- a/tests/test_intl.py
27++++ b/tests/test_intl.py
28+@@ -694,14 +694,15 @@ def test_additional_targets_should_not_be_translated(app, status, warning):
29+ yield assert_count(expected_expr, result, 1)
30+
31+ # C code block with lang should not be translated but be *C* highlighted
32+- expected_expr = """<span class="cp">#include &lt;stdio.h&gt;</span>"""
33++ expected_expr = ("""<span class="cp">#include</span> """
34++ """<span class="cpf">&lt;stdio.h&gt;</span>""")
35+ yield assert_count(expected_expr, result, 1)
36+
37+ # doctest block should not be translated but be highlighted
38+ expected_expr = (
39+ """<span class="gp">&gt;&gt;&gt; </span>"""
40+ """<span class="kn">import</span> <span class="nn">sys</span> """
41+- """<span class="c"># sys importing</span>""")
42++ """<span class="c1"># sys importing</span>""")
43+ yield assert_count(expected_expr, result, 1)
44+
45+ ## raw.txt
46+@@ -754,14 +755,15 @@ def test_additional_targets_should_be_translated(app, status, warning):
47+ yield assert_count(expected_expr, result, 1)
48+
49+ # C code block with lang should be translated and be *C* highlighted
50+- expected_expr = """<span class="cp">#include &lt;STDIO.H&gt;</span>"""
51++ expected_expr = ("""<span class="cp">#include</span> """
52++ """<span class="cpf">&lt;STDIO.H&gt;</span>""")
53+ yield assert_count(expected_expr, result, 1)
54+
55+ # doctest block should not be translated but be highlighted
56+ expected_expr = (
57+ """<span class="gp">&gt;&gt;&gt; </span>"""
58+ """<span class="kn">import</span> <span class="nn">sys</span> """
59+- """<span class="c"># SYS IMPORTING</span>""")
60++ """<span class="c1"># SYS IMPORTING</span>""")
61+ yield assert_count(expected_expr, result, 1)
62+
63+ ## raw.txt
pkgs/top-level/python-packages.nix+5−3
@@ -18903,14 +18903,14 @@ in modules // {
1890318903
1890418904
1890518905 sphinx = buildPythonPackage (rec {
18906− name = "Sphinx-1.3.1";
18906+ name = "Sphinx-1.3.4";
1890718907
1890818908 src = pkgs.fetchurl {
1890918909 url = "http://pypi.python.org/packages/source/S/Sphinx/${name}.tar.gz";
18910− sha256 = "052i5c7cgvs5iv011dkq3r8d6jycg2gjjg3907ijsbdlq8q52vhs";
18910+ sha256 = "0mw06q7bzzjylgwh0wnnaxmwc95hx8w95as4vcgpan579brw7b4a";
1891118911 };
1891218912
18913− patches = [ ../development/python-modules/sphinx-1.3.1-pr-1946.patch ];
18913+ patches = [ ../development/python-modules/sphinx-fix-tests-with-pygments-2.1.patch ];
1891418914 LC_ALL = "en_US.UTF-8";
1891518915 checkPhase = ''
1891618916 PYTHON=${python.executable} make test
@@ -18938,6 +18938,8 @@ in modules // {
1893818938 };
1893918939 patches = [];
1894018940 disabled = isPy35;
18941+ # Tests requires Pygments >=2.0.2 which isn't worth keeping around for this:
18942+ doCheck = false;
1894118943 };
1894218944
1894318945 sphinx_rtd_theme = buildPythonPackage (rec {