[arch-commits] Commit in sagemath-doc/trunk (PKGBUILD sagemath-doc-sphinx-1.8.patch)

Antonio Rojas arojas at archlinux.org
Thu Jun 27 06:31:12 UTC 2019


    Date: Thursday, June 27, 2019 @ 06:31:11
  Author: arojas
Revision: 484666

Update to 8.8

Modified:
  sagemath-doc/trunk/PKGBUILD
Deleted:
  sagemath-doc/trunk/sagemath-doc-sphinx-1.8.patch

-------------------------------+
 PKGBUILD                      |   24 +-
 sagemath-doc-sphinx-1.8.patch |  332 ----------------------------------------
 2 files changed, 10 insertions(+), 346 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2019-06-27 06:00:38 UTC (rev 484665)
+++ PKGBUILD	2019-06-27 06:31:11 UTC (rev 484666)
@@ -1,7 +1,7 @@
 # Maintainer: Antonio Rojas <arojas at archlinux.org>
 
 pkgname=sagemath-doc
-pkgver=8.7
+pkgver=8.8
 pkgrel=1
 pkgdesc="HTML documentation and inline help for SageMath"
 arch=(any)
@@ -11,12 +11,10 @@
 makedepends=(sagemath python2-pyzmq python2-docutils python2-jupyter_client python2-pkgconfig cython2 python2-ipywidgets)
 source=(sagemath-$pkgver.tar.gz::"https://github.com/sagemath/sage/archive/$pkgver.tar.gz"
         docbuild_main.patch
-        sagemath-doc-sphinx-1.8.patch
         sagemath-doc-segfault.patch
         sagemath-ecl-sigfpe.patch)
-sha256sums=('263c3b3fc956b8bebc532f3b51e68c1b0d559d3b7e7c9fadffdfc0f4dbae18ab'
+sha256sums=('d012ff4f0f34e086fcaf576e25220fc647826116c69b62b887bc0b8ced5c1e9f'
             'ea5e17bb7a7cb36a22e5e3872fcc2585852bc971c4b139b0b2cd69a36c1b009b'
-            'ec6835d555056e1f20684de015f43c46cff62a132c9cd6f5ea7243c6bacd3f1e'
             '2ee218610001f906015df647881581ff1f7eb0acf923b79b72056965129bac22'
             'a42f3b152b1aedb8abf16bc70971419919d1fe30328574e7fef8305f9d07d938')
 
@@ -28,8 +26,6 @@
 # use sage_setup imports from sagemath source, but use system sage ones (which include compiled modules)
   mkdir -p local-python
   ln -sr src/sage_setup local-python
-# fix build with sphinx 1.8
-  patch -p1 -i ../sagemath-doc-sphinx-1.8.patch
 # Fix segfault when pari is compiled with threads https://trac.sagemath.org/ticket/26608
   patch -p1 -i ../sagemath-doc-segfault.patch
 # Fix SIGFPE crashes with ecl 16.1.3 https://trac.sagemath.org/ticket/22191
@@ -39,14 +35,14 @@
 build() {
   cd sage-$pkgver/src
 
-  export SAGE_LOCAL="/usr"
-  export SAGE_ROOT="/usr"
-  export SAGE_SRC="$PWD"
-  export SAGE_DOC_SRC="$SAGE_SRC"/doc
-  export SAGE_DOC="$SAGE_DOC_SRC"
-  export SAGE_DOC_MATHJAX=yes
-  export PYTHONPATH="$srcdir"/sage-$pkgver/local-python
-  export SAGE_NUM_THREADS=10
+  export SAGE_LOCAL="/usr" \
+         SAGE_ROOT="/usr" \
+         SAGE_SRC="$PWD" \
+         SAGE_DOC_SRC="$PWD"/doc \
+         SAGE_DOC="$PWD"/doc \
+         SAGE_DOC_MATHJAX=yes \
+         PYTHONPATH="$srcdir"/sage-$pkgver/local-python \
+         SAGE_NUM_THREADS=10
   python2 sage_setup/docbuild --no-pdf-links all html
 }
 

Deleted: sagemath-doc-sphinx-1.8.patch
===================================================================
--- sagemath-doc-sphinx-1.8.patch	2019-06-27 06:00:38 UTC (rev 484665)
+++ sagemath-doc-sphinx-1.8.patch	2019-06-27 06:31:11 UTC (rev 484666)
@@ -1,332 +0,0 @@
-diff --git a/src/doc/common/conf.py b/src/doc/common/conf.py
-index 70dd17f..e9a3dae 100644
---- a/src/doc/common/conf.py
-+++ b/src/doc/common/conf.py
-@@ -4,6 +4,8 @@ import sage.version
- from sage.misc.sagedoc import extlinks
- import dateutil.parser
- from six import iteritems
-+from docutils import nodes
-+from docutils.transforms import Transform
- 
- # If your extensions are in another directory, add it here.
- sys.path.append(os.path.join(SAGE_SRC, "sage_setup", "docbuild", "ext"))
-@@ -669,7 +671,7 @@ def call_intersphinx(app, env, node, contnode):
-         sage: for line in open(thematic_index).readlines():  # optional - dochtml
-         ....:     if "padics" in line:
-         ....:         _ = sys.stdout.write(line)
--        <li><a class="reference external" href="../reference/padics/sage/rings/padics/tutorial.html#sage-rings-padics-tutorial" title="(in Sage Reference Manual: p-Adics v...)"><span>Introduction to the -adics</span></a></li>
-+        <li><a class="reference external" href="../reference/padics/sage/rings/padics/tutorial.html#sage-rings-padics-tutorial" title="(in Sage Reference Manual: p-Adics v...)"><span>Introduction to the p-adics</span></a></li>
-     """
-     debug_inf(app, "???? Trying intersphinx for %s" % node['reftarget'])
-     builder = app.builder
-diff --git a/src/sage/misc/sphinxify.py b/src/sage/misc/sphinxify.py
-index 6e21344..4270294 100644
---- a/src/sage/misc/sphinxify.py
-+++ b/src/sage/misc/sphinxify.py
-@@ -68,20 +68,20 @@ def sphinxify(docstring, format='html'):
-         sage: assert n == len(sys.path)
-     """
-     srcdir = mkdtemp()
--    base_name = os.path.join(srcdir, 'docstring')
--    rst_name = base_name + '.rst'
-+    outdir = mkdtemp()
-+    src_base_name = os.path.join(srcdir, 'docstring')
-+    out_base_name = os.path.join(outdir, 'docstring')
-+    rst_name = src_base_name + '.rst'
- 
-     if format == 'html':
-         suffix = '.html'
-     else:
-         suffix = '.txt'
--    output_name = base_name + suffix
-+    output_name = out_base_name + suffix
- 
-     with open(rst_name, 'w') as filed:
-         filed.write(docstring)
- 
--    # Sphinx constructor: Sphinx(srcdir, confdir, outdir, doctreedir,
--    # buildername, confoverrides, status, warning, freshenv).
-     confdir = os.path.join(SAGE_DOC_SRC, 'en', 'introspect')
- 
-     open(os.path.join(srcdir, 'docutils.conf'), 'w').write(r"""
-@@ -93,7 +93,9 @@ smart_quotes = no
- 
-     import sys
-     old_sys_path = list(sys.path)  # Sphinx modifies sys.path
--    sphinx_app = Sphinx(srcdir, confdir, srcdir, doctreedir, format,
-+    # Sphinx constructor: Sphinx(srcdir, confdir, outdir, doctreedir,
-+    # buildername, confoverrides, status, warning, freshenv).
-+    sphinx_app = Sphinx(srcdir, confdir, outdir, doctreedir, format,
-                         confoverrides, None, None, True)
-     sphinx_app.build(None, [rst_name])
-     sys.path = old_sys_path
-@@ -118,13 +120,15 @@ smart_quotes = no
-         # Remove spurious \(, \), \[, \].
-         output = output.replace('\\(', '').replace('\\)', '').replace('\\[', '').replace('\\]', '')
-     else:
--        print("BUG -- Sphinx error")
-+        from warnings import warn
-+        warn("Sphinx did not produce any output", Warning)
-         if format == 'html':
-             output = '<pre class="introspection">%s</pre>' % docstring
-         else:
-             output = docstring
- 
-     shutil.rmtree(srcdir, ignore_errors=True)
-+    shutil.rmtree(outdir, ignore_errors=True)
- 
-     return output
- 
-diff --git a/src/sage_setup/docbuild/__init__.py b/src/sage_setup/docbuild/__init__.py
-index 4546f87..9efe45d 100644
---- a/src/sage_setup/docbuild/__init__.py
-+++ b/src/sage_setup/docbuild/__init__.py
-@@ -53,7 +53,6 @@ import warnings
- 
- logger = logging.getLogger(__name__)
- 
--import sphinx.cmdline
- import sphinx.util.console
- import sphinx.ext.intersphinx
- 
-@@ -354,6 +353,7 @@ class AllBuilder(object):
-             getattr(get_builder(document), 'inventory')(*args, **kwds)
- 
-         logger.warning("Building reference manual, second pass.\n")
-+        sage_makedirs(os.path.join(SAGE_DOC, "html", "en", "reference", "_static"))
-         for document in refs:
-             getattr(get_builder(document), name)(*args, **kwds)
- 
-diff --git a/src/sage_setup/docbuild/ext/inventory_builder.py b/src/sage_setup/docbuild/ext/inventory_builder.py
-index 113849a..92deaa1 100644
---- a/src/sage_setup/docbuild/ext/inventory_builder.py
-+++ b/src/sage_setup/docbuild/ext/inventory_builder.py
-@@ -12,6 +12,7 @@ from os import path
- 
- from six import iteritems, text_type
- 
-+import shutil
- 
- try:
-     from hashlib import md5
-@@ -107,6 +108,18 @@ class InventoryBuilder(StandaloneHTMLBuilder):
-         """
-         raise RuntimeError("This function shouldn't be called in \"%s\" builder"%(self.name))
- 
-+    def cleanup(self):
-+        """
-+        Remove the '_static' directory.
-+
-+        This directory is unnecessary for the inventory build, but it
-+        may be created by the graphviz extension. Its presence will
-+        break the docbuild later on, so remove it.
-+        """
-+        if path.isdir(path.join(self.outdir, '_static')):
-+            shutil.rmtree(path.join(self.outdir, '_static'))
-+
-+
-     copy_image_files = removed_method_error
-     copy_download_files = removed_method_error
-     copy_static_files = removed_method_error
-diff --git a/src/sage_setup/docbuild/ext/multidocs.py b/src/sage_setup/docbuild/ext/multidocs.py
-index 15c7ca5..bc5ca9e 100644
---- a/src/sage_setup/docbuild/ext/multidocs.py
-+++ b/src/sage_setup/docbuild/ext/multidocs.py
-@@ -32,6 +32,7 @@ from sphinx.util.console import bold
- from sage.env import SAGE_DOC
- from sage.misc.misc import sage_makedirs
- 
-+logger = sphinx.util.logging.getLogger(__name__)
- 
- CITE_FILENAME = 'citations.pickle'
- 
-@@ -48,13 +49,13 @@ def merge_environment(app, env):
- 
-     - domaindata['py']['modules'] # list of python modules
-     """
--    app.info(bold('Merging environment/index files...'))
-+    logger.info(bold('Merging environment/index files...'))
-     for curdoc in app.env.config.multidocs_subdoc_list:
--        app.info("    %s:" % curdoc, nonl=1)
-+        logger.info("    %s:"%curdoc, nonl=1)
-         docenv = get_env(app, curdoc)
-         if docenv is not None:
-             fixpath = lambda path: os.path.join(curdoc, path)
--            app.info(" %s todos, %s index, %s citations"%(
-+            logger.info(" %s todos, %s index, %s citations"%(
-                     len(docenv.todo_all_todos),
-                     len(docenv.indexentries),
-                     len(docenv.domaindata["std"]["citations"])
-@@ -99,8 +100,8 @@ def merge_environment(app, env):
-                 six.iteritems(docenv.domaindata['py']['modules'])):
-                 newmodules[ind] = (fixpath(modpath),v1,v2,v3)
-             env.domaindata['py']['modules'].update(newmodules)
--            app.info(", %s modules"%(len(newmodules)))
--    app.info('... done (%s todos, %s index, %s citations, %s modules)'%(
-+            logger.info(", %s modules"%(len(newmodules)))
-+    logger.info('... done (%s todos, %s index, %s citations, %s modules)'%(
-             len(env.todo_all_todos),
-             len(env.indexentries),
-             len(env.domaindata["std"]["citations"]),
-@@ -118,8 +119,8 @@ def get_env(app, curdoc):
-     try:
-         f = open(filename, 'rb')
-     except IOError:
--        app.info("")
--        app.warn("Unable to fetch %s " % filename)
-+        logger.info("")
-+        logger.warning("Unable to fetch %s " % filename)
-         return None
-     docenv = cPickle.load(f)
-     f.close()
-@@ -130,16 +131,16 @@ def merge_js_index(app):
-     """
-     Merge the JS indexes of the sub-docs into the main JS index
-     """
--    app.info('')
--    app.info(bold('Merging js index files...'))
-+    logger.info('')
-+    logger.info(bold('Merging js index files...'))
-     mapping = app.builder.indexer._mapping
-     for curdoc in app.env.config.multidocs_subdoc_list:
--        app.info("    %s:"%curdoc, nonl=1)
-+        logger.info("    %s:"%curdoc, nonl=1)
-         fixpath = lambda path: os.path.join(curdoc, path)
-         index = get_js_index(app, curdoc)
-         if index is not None:
-             # merge the mappings
--            app.info(" %s js index entries"%(len(index._mapping)))
-+            logger.info(" %s js index entries"%(len(index._mapping)))
-             for (ref, locs) in six.iteritems(index._mapping):
-                 newmapping = set(map(fixpath, locs))
-                 if ref in mapping:
-@@ -159,8 +160,8 @@ def merge_js_index(app):
-             dest = os.path.join(app.outdir, "_sources", curdoc)
-             if not os.path.exists(dest):
-                 os.symlink(os.path.join("..", curdoc, "_sources"), dest)
--    app.info('... done (%s js index entries)'%(len(mapping)))
--    app.info(bold('Writing js search indexes...'), nonl=1)
-+    logger.info('... done (%s js index entries)'%(len(mapping)))
-+    logger.info(bold('Writing js search indexes...'), nonl=1)
-     return [] # no extra page to setup
- 
- 
-@@ -181,8 +182,8 @@ def get_js_index(app, curdoc):
-     try:
-         f = open(indexfile, 'r')
-     except IOError:
--        app.info("")
--        app.warn("Unable to fetch %s " % indexfile)
-+        logger.info("")
-+        logger.warning("Unable to fetch %s " % indexfile)
-         return None
-     indexer.load(f, sphinx.search.js_index)
-     f.close()
-@@ -240,7 +241,7 @@ def write_citations(app, citations):
-     outdir = citation_dir(app)
-     with atomic_write(os.path.join(outdir, CITE_FILENAME), binary=True) as f:
-         cPickle.dump(citations, f)
--    app.info("Saved pickle file: %s" % CITE_FILENAME)
-+    logger.info("Saved pickle file: %s" % CITE_FILENAME)
- 
- 
- def fetch_citation(app, env):
-@@ -248,13 +249,13 @@ def fetch_citation(app, env):
-     Fetch the global citation index from the refman to allow for cross
-     references.
-     """
--    app.builder.info(bold('loading cross citations... '), nonl=1)
-+    logger.info(bold('loading cross citations... '), nonl=1)
-     filename = os.path.join(citation_dir(app), '..', CITE_FILENAME)
-     if not os.path.isfile(filename):
-         return
-     with open(filename, 'rb') as f:
-         cache = cPickle.load(f)
--    app.builder.info("done (%s citations)."%len(cache))
-+    logger.info("done (%s citations)."%len(cache))
-     cite = env.domaindata["std"]["citations"]
-     for ind, (path, tag, lineno) in six.iteritems(cache):
-         if ind not in cite: # don't override local citation
-@@ -267,18 +268,18 @@ def init_subdoc(app):
-     doc itself.
-     """
-     if app.config.multidocs_is_master:
--        app.info(bold("Compiling the master document"))
-+        logger.info(bold("Compiling the master document"))
-         app.connect('env-updated', merge_environment)
-         app.connect('html-collect-pages', merge_js_index)
-         if app.config.multidocs_subdoc_list:
-             # Master file with indexes computed by merging indexes:
-             # Monkey patch index fetching to silence warning about broken index
-             def load_indexer(docnames):
--                app.builder.info(bold('skipping loading of indexes... '), nonl=1)
-+                logger.info(bold('skipping loading of indexes... '), nonl=1)
-             app.builder.load_indexer = load_indexer
- 
-     else:
--        app.info(bold("Compiling a sub-document"))
-+        logger.info(bold("Compiling a sub-document"))
-         app.connect('html-page-context', fix_path_html)
-         if not app.config.multidoc_first_pass:
-             app.connect('env-updated', fetch_citation)
-@@ -294,7 +295,7 @@ def init_subdoc(app):
-                     def copy_static_files(self):
-                     [...]
-             """
--            app.builder.info(bold('linking _static directory.'))
-+            logger.info(bold('linking _static directory.'))
-             static_dir = os.path.join(app.builder.outdir, '_static')
-             master_static_dir = os.path.join('..', '_static')
-             if os.path.lexists(static_dir):
-@@ -308,6 +309,9 @@ def init_subdoc(app):
- 
-     if app.config.multidoc_first_pass == 1:
-         app.config.intersphinx_mapping = {}
-+    else:
-+        app.emit('env-check-consistency', app.env)
-+
- 
- 
- def setup(app):
-diff --git a/src/sage_setup/docbuild/ext/sage_autodoc.py b/src/sage_setup/docbuild/ext/sage_autodoc.py
-index 25895d3..2e640a0 100644
---- a/src/sage_setup/docbuild/ext/sage_autodoc.py
-+++ b/src/sage_setup/docbuild/ext/sage_autodoc.py
-@@ -40,7 +40,8 @@ from sphinx.errors import ExtensionError
- from sphinx.ext.autodoc.importer import mock, import_object, get_object_members
- from sphinx.ext.autodoc.inspector import format_annotation, formatargspec
- from sphinx.locale import _, __
--from sphinx.pycode import ModuleAnalyzer, PycodeError
-+from sphinx.pycode import ModuleAnalyzer
-+from sphinx.errors import ExtensionError, PycodeError
- from sphinx.util import logging
- from sphinx.util import rpartition, force_decode
- from sphinx.util.docstrings import prepare_docstring
-diff --git a/src/sage_setup/docbuild/sphinxbuild.py b/src/sage_setup/docbuild/sphinxbuild.py
-index 8c7efbe..9a2fba7 100644
---- a/src/sage_setup/docbuild/sphinxbuild.py
-+++ b/src/sage_setup/docbuild/sphinxbuild.py
-@@ -22,6 +22,7 @@ We redirect stdout and stderr to our own logger, and remove some unwanted chatte
- # ****************************************************************************
- 
- import os, sys, re, sphinx
-+import sphinx.cmd.build
- 
- # override the fancy multi-line formatting
- def term_width_line(text):
-@@ -304,12 +305,12 @@ def runsphinx():
-     try:
-         sys.stdout = SageSphinxLogger(sys.stdout, os.path.basename(output_dir))
-         sys.stderr = SageSphinxLogger(sys.stderr, os.path.basename(output_dir))
--        # Note that this call as of eraly 2018 leaks memory. So make sure that
-+        # Note that this call as of early 2018 leaks memory. So make sure that
-         # you don't call runsphinx() several times in a row. (i.e., you want to
-         # fork() somewhere before this call.)
-         # We don't use subprocess here, as we don't want to re-initialize Sage
-         # for every docbuild as this takes a while.
--        sphinx.cmdline.main(sys.argv[1:])
-+        sphinx.cmd.build.main(sys.argv[1:])
-         sys.stderr.raise_errors()
-         sys.stdout.raise_errors()
-     finally:



More information about the arch-commits mailing list