[sagemath] 02/03: Temporary hacky workaround for https://trac.sagemath.org/ticket/21732

Ximin Luo infinity0 at debian.org
Sat Dec 17 00:10:39 UTC 2016


This is an automated email from the git hooks/post-receive script.

infinity0 pushed a commit to branch master
in repository sagemath.

commit ec7578e12d8096d42473a844b3eb629c1ec928fe
Author: Ximin Luo <infinity0 at debian.org>
Date:   Sat Dec 17 01:03:58 2016 +0100

    Temporary hacky workaround for https://trac.sagemath.org/ticket/21732
---
 debian/README.Debian                               |  9 +--
 .../patches/dt-work-around-doc-common-conf.patch   | 66 ++++++++++++++++++++++
 debian/patches/series                              |  1 +
 debian/sagemath-common.install                     |  5 ++
 4 files changed, 77 insertions(+), 4 deletions(-)

diff --git a/debian/README.Debian b/debian/README.Debian
index 5f4e717..594a821 100644
--- a/debian/README.Debian
+++ b/debian/README.Debian
@@ -37,10 +37,7 @@ support requests relating to this and will close bugs as "wontfix".
 Known issues
 ============
 
-At the moment, some things are not working:
-
-- '?' and some other documentation features don't work, relating to Sage
-  upstream bug #21732. TODO: we should fix this before Debian stable.
+At the moment, some things are not working, or working a bit roughly:
 
 - Jupyter notebook: there are errors in the browser console relating to loading
   MathJax fonts but this doesn't seem to interfere with the functionality.
@@ -56,6 +53,10 @@ patches are applied. Then, from any directory:
  *$ export -n SAGE_LOCAL SAGE_ROOT
  *$ SAGE_SRC=/path/to/sage/src sage -t -p --long --logfile=ptestlong.log --all
 
+(Note: some doctests under SAGE_SRC/src/doc are known not to work with these
+instructions, due to upstream #21732. They do work when testing from a built
+source tree; see below.)
+
 Feel free to upload your test logs somewhere and send links to them to our
 mailing list <debian-science-sagemath at lists.alioth.debian.org>. Please do not
 send your test logs directly, unless they are small (<400KB). Compressing them
diff --git a/debian/patches/dt-work-around-doc-common-conf.patch b/debian/patches/dt-work-around-doc-common-conf.patch
new file mode 100644
index 0000000..2f9662e
--- /dev/null
+++ b/debian/patches/dt-work-around-doc-common-conf.patch
@@ -0,0 +1,66 @@
+Description: Move runtime documentation python modules into src/sage
+ This is a temporary workaround; upstream is working on a proper fix.
+ When you remove this patch, also be sure to remove the hacky entries in
+ sagemath-common.install
+Author: Ximin Luo <infinity0 at debian.org>
+Bug: https://trac.sagemath.org/ticket/21732
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/sage/src/sage/misc/sagedoc.py
++++ b/sage/src/sage/misc/sagedoc.py
+@@ -463,10 +463,15 @@
+     """
+     if embedded:
+         return s
+-    oldpath = sys.path
+-    sys.path = [os.path.join(SAGE_DOC_SRC, 'common')] + oldpath
+-    from conf import extlinks
+-    sys.path = oldpath
++    extlinks = {
++        'python': ('https://docs.python.org/release/'+sys.version.split(' ')[0]+'/%s', ''),
++        'trac': ('https://trac.sagemath.org/%s', 'trac ticket #'),
++        'wikipedia': ('https://en.wikipedia.org/wiki/%s', 'Wikipedia article '),
++        'arxiv': ('http://arxiv.org/abs/%s', 'Arxiv '),
++        'oeis': ('https://oeis.org/%s', 'OEIS sequence '),
++        'doi': ('https://dx.doi.org/%s', 'doi:'),
++        'mathscinet': ('http://www.ams.org/mathscinet-getitem?mr=%s', 'MathSciNet ')
++        }
+     for key in extlinks:
+         while True:
+             m = re.search(':%s:`([^`]*)`' % key, s)
+--- a/sage/src/sage/misc/sphinxify.py
++++ b/sage/src/sage/misc/sphinxify.py
+@@ -22,7 +22,7 @@
+ import re
+ import shutil
+ from tempfile import mkdtemp
+-from sage.env import SAGE_DOC_SRC
++from sage.env import SAGE_LIB
+ from sphinx.application import Sphinx
+ 
+ 
+@@ -78,7 +78,7 @@
+ 
+     # Sphinx constructor: Sphinx(srcdir, confdir, outdir, doctreedir,
+     # buildername, confoverrides, status, warning, freshenv).
+-    confdir = os.path.join(SAGE_DOC_SRC, 'en', 'introspect')
++    confdir = os.path.join(SAGE_LIB, 'sage', 'misc', 'docs', 'introspect')
+ 
+     doctreedir = os.path.join(srcdir, 'doctrees')
+     confoverrides = {'html_context': {}, 'master_doc': 'docstring'}
+--- a/sage/src/doc/en/introspect/conf.py
++++ b/sage/src/doc/en/introspect/conf.py
+@@ -3,8 +3,11 @@
+ # See sagenb.notebook.cell.Cell.set_introspect_html() for details.
+ 
+ import sys, os
+-sys.path.append(os.environ['SAGE_DOC_SRC'])
+-from common.conf import *
++if 'SAGE_DOC_SRC' in os.environ: sys.path.append(os.environ['SAGE_DOC_SRC'])
++try:
++    from common.conf import *
++except ImportError:
++    from sage.misc.docs.common.conf import *
+ 
+ extensions = ['sphinx.ext.autodoc', 'sphinx.ext.mathjax', 'sphinx.ext.todo',
+               'sphinx.ext.extlinks']
diff --git a/debian/patches/series b/debian/patches/series
index d55d68c..8b4d7d4 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -73,3 +73,4 @@ dt-version-singular-4-extra-fixes.patch
 dt-version-glpk-4.60-extra-hacky-fixes.patch
 dt-r-no-readline.patch
 dt-more-fix-test-cases.patch
+dt-work-around-doc-common-conf.patch
diff --git a/debian/sagemath-common.install b/debian/sagemath-common.install
index fa29d6a..953f1e5 100644
--- a/debian/sagemath-common.install
+++ b/debian/sagemath-common.install
@@ -3,3 +3,8 @@ debian/tmp/usr/bin/sage-* usr/share/sage/bin
 usr/share/sage/ext
 usr/lib/python2.7/dist-packages/sage*
 sage/local/var/lib/sage/installed usr/share/sage
+# next 3 entries are part of a temporary hack around upstream #21732
+# the other part of the hack is debian/patches/dt-work-around-doc-common-conf.patch
+sage/src/sage/misc/__init__.py usr/lib/python2.7/dist-packages/sage/misc/docs
+sage/src/doc/en/introspect     usr/lib/python2.7/dist-packages/sage/misc/docs
+sage/src/doc/common            usr/lib/python2.7/dist-packages/sage/misc/docs

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/sagemath.git



More information about the debian-science-commits mailing list