[arch-commits] Commit in sagemath-doc/repos (3 files)

Antonio Rojas arojas at archlinux.org
Mon May 10 18:02:38 UTC 2021


    Date: Monday, May 10, 2021 @ 18:02:37
  Author: arojas
Revision: 929585

archrelease: copy trunk to community-testing-any

Added:
  sagemath-doc/repos/community-testing-any/
  sagemath-doc/repos/community-testing-any/PKGBUILD
    (from rev 929584, sagemath-doc/trunk/PKGBUILD)
  sagemath-doc/repos/community-testing-any/sagemath-sphinx4.patch
    (from rev 929584, sagemath-doc/trunk/sagemath-sphinx4.patch)

------------------------+
 PKGBUILD               |   53 ++++++++++++++++
 sagemath-sphinx4.patch |  148 +++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 201 insertions(+)

Copied: sagemath-doc/repos/community-testing-any/PKGBUILD (from rev 929584, sagemath-doc/trunk/PKGBUILD)
===================================================================
--- community-testing-any/PKGBUILD	                        (rev 0)
+++ community-testing-any/PKGBUILD	2021-05-10 18:02:37 UTC (rev 929585)
@@ -0,0 +1,53 @@
+# Maintainer: Antonio Rojas <arojas at archlinux.org>
+
+pkgname=sagemath-doc
+pkgver=9.3
+pkgrel=1
+pkgdesc="HTML documentation for SageMath"
+arch=(any)
+url="http://www.sagemath.org"
+license=(GPL)
+depends=(gap-doc python-pplpy)
+makedepends=(sagemath python-pyzmq python-docutils python-jupyter_client python-pkgconfig cython python-ipywidgets thebe)
+source=(https://github.com/sagemath/sage/archive/$pkgver/sagemath-$pkgver.tar.gz
+        sagemath-sphinx4.patch)
+sha256sums=('d3b104a83e140cda563ae0b44fa3ec2b3545660f120fab78dde6ceb5fb1ed991'
+            '5a1b6dff6d855c7e21ec7969809b719988e05e9eab77f230fef370cccff28d45')
+options=(!strip) # nothing to strip, save packaging time
+
+prepare() {
+  cd sage-$pkgver
+
+  patch -p1 < ../sagemath-sphinx4.patch # Fix build with Sphinx 4
+
+  SAGE_ROOT="$PWD" PATH="$PWD/build/bin:$PATH" src/doc/bootstrap
+  rm -r src/sage # Use the installed sage, not the one from the source tree
+}
+
+build() {
+  cd sage-$pkgver/src
+
+  export SAGE_SRC="$PWD" \
+         SAGE_DOC="$PWD"/doc \
+         MATHJAX_DIR=/usr/share/mathjax2 \
+         SAGE_NUM_THREADS=10 \
+         LANG=C
+  python -m sage_docbuild --no-pdf-links --mathjax all html
+}
+
+package() {
+  cd sage-$pkgver/src/doc
+ 
+  mkdir -p "$pkgdir"/usr/share/doc/sage
+  cp -r common "$pkgdir"/usr/share/doc/sage
+  cp -r html "$pkgdir"/usr/share/doc/sage
+
+# Replace duplicated files by symlinks (Gentoo)
+  cd "$pkgdir"/usr/share/doc/sage
+  mv html/en/_static{,.tmp}
+  for _dir in `find -name _static` ; do
+    rm -r $_dir
+    ln -s /usr/share/doc/sage/html/en/_static $_dir
+  done
+  mv html/en/_static{.tmp,}
+}

Copied: sagemath-doc/repos/community-testing-any/sagemath-sphinx4.patch (from rev 929584, sagemath-doc/trunk/sagemath-sphinx4.patch)
===================================================================
--- community-testing-any/sagemath-sphinx4.patch	                        (rev 0)
+++ community-testing-any/sagemath-sphinx4.patch	2021-05-10 18:02:37 UTC (rev 929585)
@@ -0,0 +1,148 @@
+diff --git a/src/doc/en/reference/combinat/module_list.rst b/src/doc/en/reference/combinat/module_list.rst
+index a95069590b..f8bfe88c71 100644
+--- a/src/doc/en/reference/combinat/module_list.rst
++++ b/src/doc/en/reference/combinat/module_list.rst
+@@ -364,7 +364,6 @@ Comprehensive Module list
+     sage/combinat/superpartition
+     sage/combinat/symmetric_group_algebra
+     sage/combinat/symmetric_group_representations
+-    sage/combinat/super_tableau
+     sage/combinat/tableau
+     sage/combinat/tableau_residues
+     sage/combinat/tableau_tuple
+diff --git a/src/doc/en/reference/modfrm/index.rst b/src/doc/en/reference/modfrm/index.rst
+index e1f8a483a3..3d5e55dfd6 100644
+--- a/src/doc/en/reference/modfrm/index.rst
++++ b/src/doc/en/reference/modfrm/index.rst
+@@ -23,7 +23,6 @@ Module List
+    sage/modular/modform/hecke_operator_on_qexp
+    sage/modular/modform/numerical
+    sage/modular/modform/vm_basis
+-   sage/modular/modform/ambient
+    sage/modular/modform/half_integral
+    sage/modular/modform/find_generators
+    sage/modular/modform/j_invariant
+diff --git a/src/sage_docbuild/ext/sage_autodoc.py b/src/sage_docbuild/ext/sage_autodoc.py
+index ac9f8538bc..c4523f2a53 100644
+--- a/src/sage_docbuild/ext/sage_autodoc.py
++++ b/src/sage_docbuild/ext/sage_autodoc.py
+@@ -34,13 +34,12 @@ import sys
+ from docutils.statemachine import ViewList
+ 
+ import sphinx
+-from sphinx.ext.autodoc import mock
++from sphinx.ext.autodoc import mock, ObjectMember
+ from sphinx.ext.autodoc.importer import import_object, get_object_members, get_module_members
+ from sphinx.locale import _, __
+ from sphinx.pycode import ModuleAnalyzer
+ from sphinx.errors import PycodeError
+ from sphinx.util import logging
+-from sphinx.util import rpartition, force_decode
+ from sphinx.util.docstrings import prepare_docstring
+ from sphinx.util.inspect import isdescriptor, \
+     safe_getattr, object_description, is_builtin_class_method, \
+@@ -488,10 +487,7 @@ class Documenter(object):
+         # make sure we have Unicode docstrings, then sanitize and split
+         # into lines
+         if isinstance(docstring, str):
+-            return [prepare_docstring(docstring, ignore)]
+-        elif isinstance(docstring, str):  # this will not trigger on Py3
+-            return [prepare_docstring(force_decode(docstring, encoding),
+-                                      ignore)]
++            return [prepare_docstring(docstring)]
+         # ... else it is something strange, let's ignore it
+         return []
+ 
+@@ -536,7 +532,7 @@ class Documenter(object):
+ 
+         # add content from docstrings
+         if not no_docstring:
+-            encoding = self.analyzer and self.analyzer._encoding
++            encoding = self.analyzer
+             docstrings = self.get_doc(encoding)
+             if not docstrings:
+                 # append at least a dummy docstring, so that the event
+@@ -876,13 +872,42 @@ class ModuleDocumenter(Documenter):
+         if self.options.deprecated:
+             self.add_line(u'   :deprecated:', sourcename)
+ 
++    def get_module_members(self):
++        """Get members of target module."""
++        if self.analyzer:
++            attr_docs = self.analyzer.attr_docs
++        else:
++            attr_docs = {}
++
++        members = {}  # type: Dict[str, ObjectMember]
++        for name in dir(self.object):
++            try:
++                value = safe_getattr(self.object, name, None)
++                docstring = attr_docs.get(('', name), [])
++                members[name] = ObjectMember(name, value, docstring="\n".join(docstring))
++            except AttributeError:
++                continue
++
++        # annotation only member (ex. attr: int)
++        try:
++            for name in inspect.getannotations(self.object):
++                if name not in members:
++                    docstring = attr_docs.get(('', name), [])
++                    members[name] = ObjectMember(name, INSTANCEATTR,
++                                                 docstring="\n".join(docstring))
++        except AttributeError:
++            pass
++
++        return members
++
+     def get_object_members(self, want_all):
+         # type: (bool) -> Tuple[bool, List[Tuple[unicode, object]]]
++        members = self.get_module_members()
+         if want_all:
+             if not hasattr(self.object, '__all__'):
+                 # for implicit module members, check __module__ to avoid
+                 # documenting imported objects
+-                return True, get_module_members(self.object)
++                return True, list(members.values())
+             else:
+                 memberlist = self.object.__all__
+                 # Sometimes __all__ is broken...
+@@ -893,14 +918,14 @@ class ModuleDocumenter(Documenter):
+                         '(in module %s) -- ignoring __all__' %
+                         (memberlist, self.fullname))
+                     # fall back to all members
+-                    return True, get_module_members(self.object)
++                    return True, list(members.values())
+         else:
+             memberlist = self.options.members or []
+         ret = []
+         for mname in memberlist:
+-            try:
+-                ret.append((mname, safe_getattr(self.object, mname)))
+-            except AttributeError:
++            if mname in members:
++                ret.append(members[mname])
++            else:
+                 logger.warning(
+                     'missing attribute mentioned in :members: or __all__: '
+                     'module %s, attribute %s' %
+@@ -951,7 +976,7 @@ class ClassLevelDocumenter(Documenter):
+                 # ... if still None, there's no way to know
+                 if mod_cls is None:
+                     return None, []
+-            modname, cls = rpartition(mod_cls, '.')  # type: ignore
++            modname, _, cls = mod_cls.rpartition('.')  # type: ignore
+             parents = [cls]
+             # if the module name is still missing, get it like above
+             if not modname:
+@@ -1275,10 +1300,7 @@ class ClassDocumenter(DocstringSignatureMixin, ModuleLevelDocumenter):
+         doc = []
+         for docstring in docstrings:
+             if isinstance(docstring, str):
+-                doc.append(prepare_docstring(docstring, ignore))
+-            elif isinstance(docstring, str):  # this will not trigger on Py3
+-                doc.append(prepare_docstring(force_decode(docstring, encoding),
+-                                             ignore))
++                doc.append(prepare_docstring(docstring))
+         return doc
+ 
+     def add_content(self, more_content, no_docstring=False):



More information about the arch-commits mailing list