Skip to content

Commit

Permalink
Trac #16396: upgrade Sphinx to 1.2
Browse files Browse the repository at this point in the history
According to https://groups.google.com/forum/#!topic/sphinx-
users/EC7_wNtE5To Sphinx-1.2 is 25% faster than 1.1.2, and this matters
with doc-clean Sage builds.

Source:
 [https://pypi.python.org/packages/source/S/Sphinx/Sphinx-1.2.2.tar.gz]

URL: http://trac.sagemath.org/16396
Reported by: rws
Ticket author(s): Ralph Stephan, Steven Trogdon
Reviewer(s): François Bissey, Julien Puydt, John Palmieri
  • Loading branch information
Release Manager authored and vbraun committed Oct 29, 2014
2 parents b5ed445 + de9630d commit ca7cc5e
Show file tree
Hide file tree
Showing 15 changed files with 112 additions and 62 deletions.
8 changes: 4 additions & 4 deletions build/pkgs/sphinx/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
tarball=sphinx-VERSION.tar.bz2
sha1=2a6f238185a58cbb5c597c985d715ab9653e0fbe
md5=9ea0a6f218779ddbe3222c5ef8c0f6e6
cksum=1040528499
tarball=Sphinx-VERSION.tar.gz
sha1=9e424b03fe1f68e0326f3905738adcf27782f677
md5=3dc73ccaa8d0bfb2d62fb671b1f7e8a4
cksum=3972992129
2 changes: 1 addition & 1 deletion build/pkgs/sphinx/create_grammar_pickle.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
from sphinx import package_dir
from sphinx.pycode.pgen2 import driver

_grammarfile = path.join(package_dir, 'pycode', 'Grammar.txt')
_grammarfile = path.join(package_dir, 'pycode', 'Grammar-py2.txt')
pygrammar = driver.load_grammar(_grammarfile)
2 changes: 1 addition & 1 deletion build/pkgs/sphinx/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.1.2.p3
1.2.2
12 changes: 5 additions & 7 deletions build/pkgs/sphinx/patches/autodoc.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
diff -ru src/sphinx/ext/autodoc.py src.patched/sphinx/ext/autodoc.py
--- src/sphinx/ext/autodoc.py 2011-11-01 08:38:43.000000000 +0100
+++ src.patched/sphinx/ext/autodoc.py 2011-11-05 20:37:59.000000000 +0100
@@ -911,8 +911,13 @@
--- Sphinx-1.2.2/sphinx/ext/autodoc.py.orig 2014-03-02 20:38:09.000000000 +1300
+++ Sphinx-1.2.2/sphinx/ext/autodoc.py 2014-10-19 23:02:09.000000000 +1300
@@ -953,8 +953,13 @@
def format_args(self):
if inspect.isbuiltin(self.object) or \
inspect.ismethoddescriptor(self.object):
Expand All @@ -17,7 +16,7 @@ diff -ru src/sphinx/ext/autodoc.py src.patched/sphinx/ext/autodoc.py
try:
argspec = getargspec(self.object)
except TypeError:
@@ -1137,9 +1142,14 @@
@@ -1216,9 +1221,14 @@
def format_args(self):
if inspect.isbuiltin(self.object) or \
inspect.ismethoddescriptor(self.object):
Expand All @@ -35,12 +34,11 @@ diff -ru src/sphinx/ext/autodoc.py src.patched/sphinx/ext/autodoc.py
if argspec[0] and argspec[0][0] in ('cls', 'self'):
del argspec[0][0]
return inspect.formatargspec(*argspec)
@@ -1348,6 +1358,7 @@
@@ -1452,6 +1462,7 @@

app.add_config_value('autoclass_content', 'class', True)
app.add_config_value('autodoc_member_order', 'alphabetic', True)
+ app.add_config_value('autodoc_builtin_argspec', None, True)
app.add_config_value('autodoc_default_flags', [], True)
app.add_config_value('autodoc_docstring_signature', True, True)
app.add_event('autodoc-process-docstring')
Only in src.patched/sphinx/ext: autodoc.py.orig
6 changes: 3 additions & 3 deletions build/pkgs/sphinx/patches/environment.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- ../src/sphinx/environment.py 2011-09-23 01:20:17.000000000 -0700
+++ src.patched/sphinx/environment.py 2011-09-23 16:35:10.000000000 -0700
@@ -563,10 +563,13 @@
--- Sphinx-1.2.2/sphinx/environment.py.orig 2014-03-02 20:38:09.000000000 +1300
+++ Sphinx-1.2.2/sphinx/environment.py 2014-10-19 23:31:15.000000000 +1300
@@ -424,10 +424,13 @@
else:
# check if a config value was changed that affects how
# doctrees are read
Expand Down
9 changes: 4 additions & 5 deletions build/pkgs/sphinx/patches/highlighting.patch
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
diff -ur src/sphinx/highlighting.py src.patched/sphinx/highlighting.py
--- src/sphinx/highlighting.py 2010-08-11 17:17:48.000000000 +0200
+++ src.patched/sphinx/highlighting.py 2010-11-28 12:04:44.068642703 +0100
@@ -161,7 +161,7 @@
--- Sphinx-1.2.2/sphinx/highlighting.py.orig 2014-03-02 20:38:09.000000000 +1300
+++ Sphinx-1.2.2/sphinx/highlighting.py 2014-10-19 23:32:23.000000000 +1300
@@ -167,7 +167,7 @@

# find out which lexer to use
if lang in ('py', 'python'):
- if source.startswith('>>>'):
+ if source.startswith('>>>') or source.startswith('sage: '):
# interactive session
lexer = lexers['pycon']
else:
elif not force:
40 changes: 40 additions & 0 deletions build/pkgs/sphinx/patches/inline-latex.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
--- src/sphinx/writers/latex.py.orig 2014-06-05 23:38:03.808669401 -0500
+++ src/sphinx/writers/latex.py 2014-06-05 23:27:22.752376713 -0500
@@ -264,6 +264,7 @@
self.next_figure_ids = set()
self.next_table_ids = set()
# flags
+ self.verbatim = False
self.in_title = 0
self.in_production_list = 0
self.in_footnote = 0
@@ -1319,6 +1320,7 @@
(self.curfilestack[-1], node.line))
if node.rawsource != node.astext():
# most probably a parsed-literal block -- don't highlight
+ self.verbatim = True
self.body.append('\\begin{alltt}\n')
else:
code = node.astext().rstrip('\n')
@@ -1351,6 +1353,7 @@
raise nodes.SkipNode
def depart_literal_block(self, node):
self.body.append('\n\\end{alltt}\n')
+ self.verbatim = False
visit_doctest_block = visit_literal_block
depart_doctest_block = depart_literal_block

--- src/sphinx/ext/mathbase.py.orig 2014-06-05 23:39:36.773293241 -0500
+++ src/sphinx/ext/mathbase.py 2014-06-05 23:18:53.949020605 -0500
@@ -88,7 +88,10 @@


def latex_visit_math(self, node):
- self.body.append('\\(' + node['latex'] + '\\)')
+ if self.verbatim:
+ self.body.append('\\(' + node['latex'] + '\\)')
+ else:
+ self.body.append('$' + node['latex'] + '$')
raise nodes.SkipNode

def latex_visit_displaymath(self, node):
9 changes: 4 additions & 5 deletions build/pkgs/sphinx/patches/nested.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
diff -ur src/sphinx/texinputs/sphinx.sty src.patched/sphinx/texinputs/sphinx.sty
--- src/sphinx/texinputs/sphinx.sty 2014-03-25 14:26:14.000000000 +0200
+++ src.patched/sphinx/texinputs/sphinx.sty 2014-06-13 13:50:13.014623000 +0100
@@ -169,7 +169,7 @@
--- Sphinx-1.2.2/sphinx/texinputs/sphinx.sty.orig 2014-01-12 02:52:54.000000000 +1300
+++ Sphinx-1.2.2/sphinx/texinputs/sphinx.sty 2014-10-19 23:34:18.000000000 +1300
@@ -167,7 +167,7 @@
\smallskip%
% The list environement is needed to control perfectly the vertical
% space.
Expand All @@ -10,7 +9,7 @@ diff -ur src/sphinx/texinputs/sphinx.sty src.patched/sphinx/texinputs/sphinx.sty
\setlength\parskip{0pt}%
\setlength\itemsep{0ex}%
\setlength\topsep{0ex}%
@@ -183,7 +183,7 @@
@@ -181,7 +181,7 @@
\renewcommand{\endVerbatim}{%
\endOriginalVerbatim%
\endMakeFramed%
Expand Down
7 changes: 3 additions & 4 deletions build/pkgs/sphinx/patches/pngmath.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
diff -ur src/sphinx/ext/pngmath.py src.patched/sphinx/ext/pngmath.py
--- src/sphinx/ext/pngmath.py 2010-07-24 12:07:36.000000000 +0200
+++ src.patched/sphinx/ext/pngmath.py 2010-11-28 12:00:17.938636725 +0100
@@ -35,7 +35,7 @@
--- Sphinx-1.2.2/sphinx/ext/pngmath.py.orig 2014-03-02 20:38:09.000000000 +1300
+++ Sphinx-1.2.2/sphinx/ext/pngmath.py 2014-10-19 23:35:17.000000000 +1300
@@ -42,7 +42,7 @@

DOC_HEAD = r'''
\documentclass[12pt]{article}
Expand Down
3 changes: 2 additions & 1 deletion src/doc/common/custom-sphinx-build.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ def term_width_line(text):
re.compile('^looking for now-outdated files... none found'),
re.compile('^building \[.*\]: targets for 0 source files that are out of date'),
re.compile('^loading pickled environment... done'),
re.compile('^loading cross citations... done \([0-9]* citations\).')
re.compile('^loading cross citations... done \([0-9]* citations\).'),
re.compile('WARNING: favicon file \'favicon.ico\' does not exist')
)

# replacements: pairs of regular expressions and their replacements,
Expand Down
9 changes: 7 additions & 2 deletions src/doc/common/multidocs.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,13 @@ def get_js_index(app, curdoc):
"""
from sphinx.search import IndexBuilder, languages
# FIXME: find the correct lang
indexer = IndexBuilder(app.env, 'en',
app.config.html_search_options)
sphinx_version=__import__("sphinx").__version__
if (sphinx_version < '1.2'):
indexer = IndexBuilder(app.env, 'en',
app.config.html_search_options)
else:
indexer = IndexBuilder(app.env, 'en',
app.config.html_search_options, scoring=None)
indexfile = os.path.join(app.outdir, curdoc, 'searchindex.js')
try:
f = open(indexfile, 'rb')
Expand Down
46 changes: 25 additions & 21 deletions src/sage/graphs/generic_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -4453,7 +4453,9 @@ def blocks_and_cut_vertices(self):
We implement the algorithm proposed by Tarjan in [Tarjan72]_. The
original version is recursive. We emulate the recursion using a stack.

.. SEEALSO:: :meth:`blocks_and_cuts_tree`
.. SEEALSO::

:meth:`blocks_and_cuts_tree`

EXAMPLES::

Expand Down Expand Up @@ -4605,7 +4607,9 @@ def blocks_and_cuts_tree(self):
When ``self`` is biconnected, the tree is reduced to a single node of
type `B`.

.. SEEALSO:: :meth:`blocks_and_cut_vertices`
.. SEEALSO::

:meth:`blocks_and_cut_vertices`

EXAMPLES:

Expand Down Expand Up @@ -9363,7 +9367,7 @@ def subdivide_edges(self, edges, k):

.. SEEALSO::

- :meth:`subdivide_edge` -- subdivides one edge
- :meth:`subdivide_edge` -- subdivides one edge
"""
for e in edges:
self.subdivide_edge(e, k)
Expand Down Expand Up @@ -11645,10 +11649,10 @@ def is_interval(self, certificate = False):

.. SEEALSO::

- :mod:`Interval Graph Recognition <sage.graphs.pq_trees>`.

- :meth:`PQ <sage.graphs.pq_trees.PQ>`
-- Implementation of PQ-Trees.
- :mod:`Interval Graph Recognition <sage.graphs.pq_trees>`.
- :meth:`PQ <sage.graphs.pq_trees.PQ>`
-- Implementation of PQ-Trees.

"""
self._scream_if_not_simple()
Expand Down Expand Up @@ -13517,13 +13521,13 @@ def breadth_first_search(self, start, ignore_direction=False,

.. SEEALSO::

- :meth:`breadth_first_search <sage.graphs.base.c_graph.CGraphBackend.breadth_first_search>`
-- breadth-first search for fast compiled graphs.

- :meth:`depth_first_search <sage.graphs.base.c_graph.CGraphBackend.depth_first_search>`
-- depth-first search for fast compiled graphs.

- :meth:`depth_first_search` -- depth-first search for generic graphs.
- :meth:`breadth_first_search <sage.graphs.base.c_graph.CGraphBackend.breadth_first_search>`
-- breadth-first search for fast compiled graphs.
- :meth:`depth_first_search <sage.graphs.base.c_graph.CGraphBackend.depth_first_search>`
-- depth-first search for fast compiled graphs.
- :meth:`depth_first_search` -- depth-first search for generic graphs.

EXAMPLES::

Expand Down Expand Up @@ -13642,13 +13646,13 @@ def depth_first_search(self, start, ignore_direction=False,

.. SEEALSO::

- :meth:`breadth_first_search`

- :meth:`breadth_first_search <sage.graphs.base.c_graph.CGraphBackend.breadth_first_search>`
-- breadth-first search for fast compiled graphs.

- :meth:`depth_first_search <sage.graphs.base.c_graph.CGraphBackend.depth_first_search>`
-- depth-first search for fast compiled graphs.
- :meth:`breadth_first_search`
- :meth:`breadth_first_search <sage.graphs.base.c_graph.CGraphBackend.breadth_first_search>`
-- breadth-first search for fast compiled graphs.
- :meth:`depth_first_search <sage.graphs.base.c_graph.CGraphBackend.depth_first_search>`
-- depth-first search for fast compiled graphs.

EXAMPLES::

Expand Down
2 changes: 1 addition & 1 deletion src/sage/graphs/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -6367,7 +6367,7 @@ def modular_decomposition(self):
.. SEEALSO::
- :meth:`is_prime` -- Tests whether a graph is prime.
- :meth:`is_prime` -- Tests whether a graph is prime.
REFERENCE:
Expand Down
17 changes: 11 additions & 6 deletions src/sage/libs/lrcalc/lrcalc.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,17 @@ this example `\mu=[3,2,1]` and `\nu=[2,1]`. Specifying a third entry
.. seealso::
- :func:`lrcoef`
- :func:`mult`
- :func:`coprod`
- :func:`skew`
- :func:`lrskew`
- :func:`mult_schubert`
- :func:`lrcoef`
- :func:`mult`
- :func:`coprod`
- :func:`skew`
- :func:`lrskew`
- :func:`mult_schubert`
.. rubric:: Underlying algorithmic in lrcalc
Expand Down
2 changes: 1 addition & 1 deletion src/sage/numerical/backends/generic_backend.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1069,7 +1069,7 @@ cpdef GenericBackend get_solver(constraint_generation = False, solver = None):
.. SEEALSO::
- :func:`default_mip_solver` -- Returns/Sets the default MIP solver.
- :func:`default_mip_solver` -- Returns/Sets the default MIP solver.
EXAMPLE::
Expand Down

0 comments on commit ca7cc5e

Please sign in to comment.