sagemath / sage

Main repository of SageMath
https://www.sagemath.org
Other
1.44k stars 480 forks source link

Update Sphinx to 1.4.1 #18497

Closed a-andre closed 8 years ago

a-andre commented 9 years ago

Changes: http://sphinx-doc.org/changes.html

Tarballs:

Depends on #20496 Depends on #20498

CC: @kiwifb

Component: packages: standard

Keywords: days77

Author: André Apitzsch, Jeroen Demeyer

Branch/Commit: bdc3f0b

Reviewer: Steven Trogdon, John Palmieri

Issue created by migration from https://trac.sagemath.org/ticket/18497

a-andre commented 9 years ago

Commit: c913a28

a-andre commented 9 years ago

Branch: u/aapitzsch/ticket/18497

a-andre commented 9 years ago
comment:1

The given branch misses some dependencies (babel, snowballstemmer). Installing them via pip makes Sphinx build. But documentation failed to build.

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 9 years ago

Changed commit from c913a28 to 832afb7

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 9 years ago

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

ede0305update sphinx package to 1.3.1
7d29133fix some deprecation warnings
557a33crebase sage_autodoc changes on sphinx.ext.autodoc version 1.3.1
bdf70fefix orphan setting
832afb7fix warning "more than one target found for cross-reference u'groebner_basis'"
a-andre commented 9 years ago
comment:3

Any ideas how to fix

Traceback (most recent call last):
  File "/opt/sage/src/doc/common/builder.py", line 1626, in <module>
    getattr(get_builder(name), type)()
  File "/opt/sage/src/doc/common/builder.py", line 292, in _wrapper
    getattr(get_builder(document), 'inventory')(*args, **kwds)
  File "/opt/sage/src/doc/common/builder.py", line 503, in _wrapper
    x.get(99999)
  File "/opt/sage/local/lib/python/multiprocessing/pool.py", line 558, in get
    raise self._value
OSError: [categorie] /opt/sage/src/doc/en/reference/categories/sage/categories/category.rst:370: WARNING: don't know which module to import for autodocumenting u'_super_categories' (try placing a "module" or "currentmodule" directive in the document, or giving an explicit module name)

without changing

.. automethod:: _super_categories

to

.. automethod:: Category._super_categories

because there are a lot of these warnings.

jdemeyer commented 9 years ago

Description changed:

--- 
+++ 
@@ -2,3 +2,4 @@

 http://sphinx-doc.org/changes.html

+Tarball: [https://pypi.python.org/packages/source/S/Sphinx/Sphinx-1.3.1.tar.gz](https://pypi.python.org/packages/source/S/Sphinx/Sphinx-1.3.1.tar.gz)
strogdon commented 9 years ago
comment:5

While building sphinx I get:

Installed /64bitdev/storage/sage-git_develop/sage/local/lib/python2.7/site-packages/Sphinx-1.3.1-py2.7.egg
Processing dependencies for Sphinx==1.3.1
Searching for snowballstemmer>=1.1
Reading https://pypi.python.org/simple/snowballstemmer/
Download error on https://pypi.python.org/simple/snowballstemmer/: [Errno 110] Connection timed out -- Some packages may not be found!
Couldn't find index page for 'snowballstemmer' (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading https://pypi.python.org/simple/
Download error on https://pypi.python.org/simple/: [Errno 110] Connection timed out -- Some packages may not be found!
No local packages or download links found for snowballstemmer>=1.1
error: Could not find suitable distribution for Requirement.parse('snowballstemmer>=1.1')
Error building Sphinx: 'Error installing Sphinx'

wget works just fine in downloading snowballstemmer from pypi.python.org/simple/snowballstemmer

strogdon commented 9 years ago
comment:6

The inability to download snowballstemmer>=1.1 seems to be because of

export http_proxy=http://192.0.2.0:5187/

in build/bin/sage-spkg. This was supposedly fixed in #14243. Am I the only one getting this?

jdemeyer commented 9 years ago
comment:7

Replying to @strogdon:

The inability to download snowballstemmer>=1.1 seems to be because of

export http_proxy=http://192.0.2.0:5187/

in build/bin/sage-spkg. This was supposedly fixed in #14243. Am I the only one getting this?

I don't see how #14243 is related. The proxy is obviously intentional, read the comment.

strogdon commented 9 years ago
comment:8

Replying to @jdemeyer:

I don't see how #14243 is related. The proxy is obviously intentional, read the comment.

You're right about #14243 not being related. I was a bit hasty. And I realize the proxy is intentional. But what's the work-around here to allow Sphinx to install correctly? If I'm not mistaken, the proxy is blocking snowballstemmer download. But maybe there is something else.

jdemeyer commented 9 years ago
comment:9

Replying to @strogdon:

But what's the work-around here to allow Sphinx to install correctly?

Add a snowballstemmer package.

jhpalmieri commented 8 years ago
comment:10

This works for me, but not perfectly. In addition to the changes here, I used sage --pip install to install snowballstemmer and alabaster. I also had to change exclude_trees to exclude_patterns wherever it occurred in doc/common: exclude_trees was deprecated before and has now been removed. (This was in src/doc/common/conf.py, src/doc/en/reference/conf.py, src/doc/en/reference/conf_sub.py.)

I ran into the issue mentioned in comment:3, so I made those references more explicit (changed _blah to Category._blah, etc.). Then the file sage/lfunctions/zero_sums.pyx was giving me errors I didn't understand, for example

OSError: [lfunction] docstring of sage.lfunctions.zero_sums.LFunctionZeroSum_EllipticCurve:0: ERROR: Unknown interpreted text role "class".

So I removed it from the reference manual. I'll keep looking at that file, though.

Then in the second pass through the reference manual, the build stopped with complaints about missing references or citations. Maybe Sphinx is pickier now, and wants the reference before any citations to it, so I moved some of them to the top-level docstring in the file, and that helped. There is a few cross-file references, and I don't know what to do about that one except to run Sphinx again and hope it resolves the reference. The build completed this way.

By the way, Sphinx 1.3.2 (a bug-fix release) is supposed to be released in a few days.

strogdon commented 8 years ago
comment:11

I have tried the same (I missed the exclude_trees deprecation) and I too see in the build log

[lfunction] docstring of sage.lfunctions.zero_sums.LFunctionZeroSum_EllipticCurve:0: ERROR: Unknown interpreted text role "class".
[lfunction] docstring of sage.lfunctions.zero_sums.LFunctionZeroSum_EllipticCurve.analytic_rank_upper_bound:83: ERROR: Unknown interpreted text role "func".
[lfunction] docstring of sage.lfunctions.zero_sums.LFunctionZeroSum_EllipticCurve.analytic_rank_upper_bound:83: ERROR: Unknown interpreted text role "meth".
[lfunction] docstring of sage.lfunctions.zero_sums.LFunctionZeroSum_EllipticCurve.analytic_rank_upper_bound:83: ERROR: Unknown interpreted text role "func".
[lfunction] docstring of sage.lfunctions.zero_sums.LFunctionZeroSum_abstract:0: ERROR: Unknown interpreted text role "class".
[lfunction] docstring of sage.lfunctions.zero_sums.LFunctionZeroSum_abstract.cnlist:19: ERROR: Unknown interpreted text role "meth".
[lfunction] docstring of sage.lfunctions.zero_sums.LFunctionZeroSum_abstract.completed_logarithmic_derivative:39: ERROR: Unknown interpreted text role "meth".
[lfunction] docstring of sage.lfunctions.zero_sums.LFunctionZeroSum_abstract.zerosum:66: ERROR: Unknown interpreted text role "meth".

And I have been searching high and low to figure out the issue. Also, if alabaster is not needed then sphinx will have to be patched to prevent it from being imported. Something like:

--- Sphinx-1.3.1/sphinx/application.py  2015-09-11 22:55:30.000000000 -0500
+++ Sphinx-1.3.1/sphinx/application.py  2015-09-15 17:56:42.000000000 -0500
@@ -135,8 +135,8 @@
         # extension loading support for alabaster theme
         # self.config.html_theme is not set from conf.py at here
         # for now, sphinx always load a 'alabaster' extension.
-        if 'alabaster' not in self.config.extensions:
-            self.config.extensions.append('alabaster')
+        #if 'alabaster' not in self.config.extensions:
+        #    self.config.extensions.append('alabaster')

         # load all user-given extension modules
         for extension in self.config.extensions:
jhpalmieri commented 8 years ago

Changed branch from u/aapitzsch/ticket/18497 to u/jhpalmieri/ticket/18497

jhpalmieri commented 8 years ago

Changed commit from 832afb7 to 717f4e8

jhpalmieri commented 8 years ago
comment:13

I don't know why, but this change fixes the problem with lfunctions/zero_sum.pyx:

diff --git a/src/sage/lfunctions/zero_sums.pyx b/src/sage/lfunctions/zero_sums.pyx
index 6c4535c..ff1dd86 100644
--- a/src/sage/lfunctions/zero_sums.pyx
+++ b/src/sage/lfunctions/zero_sums.pyx
@@ -1341,7 +1341,6 @@ cdef class LFunctionZeroSum_EllipticCurve(LFunctionZeroSum_abstract):

         return small_primes, modulus, residue_chunks

-    @parallel(ncpus=NCPUS)
     def _sum_over_residues(self, residue_sum_data):
         r"""
         Return the p-power sum over residues in a residue chunk

I have created a branch for testing purposes which does this and the other changes I outlined above. It is not at all ready for review. Issues:


New commits:

ad08dd1Merge branch 'develop' into t/18497/ticket/18497
717f4e8trac 18497: in docbuilding, use exclude_patterns instead of exclude_trees.
strogdon commented 8 years ago
comment:14

When I first started making changes to deal with the issue mentioned in comment:#3 I only had to make changes to these files

sage/categories/category.py
sage/categories/category_with_axiom.py
sage/sets/cartesian_product.py
sage/combinat/permutation.py

I thought this odd and suspected that something else was the reason requiring the changes.

jhpalmieri commented 8 years ago
comment:15

I wouldn't be surprised if something else was causing those problems. I didn't do a careful case-by-case test to see which changes were necessary.

jdemeyer commented 8 years ago
comment:16

The huge change to sage_autodoc.py really scares me a lot. I already have several tickets concerning the docbuilding sitting in needs_review and this ticket here will almost certainly cause a lot of conflicts.

I would much prefer to stick with the current version of Sphinx (unless you have a good reason to upgrade) and first clean up the Sphinx mess.

jdemeyer commented 8 years ago
comment:17

See also https://github.com/OpenDreamKit/OpenDreamKit/issues/87

jhpalmieri commented 8 years ago
comment:18

Sphinx 1.3.2 has now been released.

jdemeyer commented 8 years ago
comment:19

Again: I would much rather first clean up the Sphinx mess before upgrading it.

jhpalmieri commented 8 years ago
comment:20

I understand that, I'm just adding the link for future reference.

jhpalmieri commented 8 years ago

Description changed:

--- 
+++ 
@@ -2,4 +2,6 @@

 http://sphinx-doc.org/changes.html

-Tarball: [https://pypi.python.org/packages/source/S/Sphinx/Sphinx-1.3.1.tar.gz](https://pypi.python.org/packages/source/S/Sphinx/Sphinx-1.3.1.tar.gz)
+Tarball: [https://pypi.python.org/packages/source/S/Sphinx/Sphinx-1.3.2.tar.gz](https://pypi.python.org/packages/source/S/Sphinx/Sphinx-1.3.2.tar.gz)
+
+
jhpalmieri commented 8 years ago

Description changed:

--- 
+++ 
@@ -2,6 +2,6 @@

 http://sphinx-doc.org/changes.html

-Tarball: [https://pypi.python.org/packages/source/S/Sphinx/Sphinx-1.3.2.tar.gz](https://pypi.python.org/packages/source/S/Sphinx/Sphinx-1.3.2.tar.gz)
+Tarball: [https://pypi.python.org/packages/source/S/Sphinx/Sphinx-1.3.3.tar.gz](https://pypi.python.org/packages/source/S/Sphinx/Sphinx-1.3.3.tar.gz)
slel commented 8 years ago
comment:22

Sphinx 1.3.5 was released on 2016-01-24.

slel commented 8 years ago

Description changed:

--- 
+++ 
@@ -1,7 +1,7 @@
-Adds support for python 3.4.
+Upgrade to [Sphinx 1.3.5, released on 2016-01-24](https://groups.google.com/d/msg/sphinx-dev/FtrXpX92euA/xlb6SDvdCQAJ).

-http://sphinx-doc.org/changes.html
+Changes: http://sphinx-doc.org/changes.html

-Tarball: [https://pypi.python.org/packages/source/S/Sphinx/Sphinx-1.3.3.tar.gz](https://pypi.python.org/packages/source/S/Sphinx/Sphinx-1.3.3.tar.gz)
+Tarball: [https://pypi.python.org/packages/source/S/Sphinx/Sphinx-1.3.5.tar.gz#md5=14bc6413d9863e36fd7204770bd6fcfe](https://pypi.python.org/packages/source/S/Sphinx/Sphinx-1.3.5.tar.gz#md5=14bc6413d9863e36fd7204770bd6fcfe)
strogdon commented 8 years ago
comment:23

If this ever gets up steam again it appears that the inline-latex.patch may no longer be needed. The following

https://github.com/sphinx-doc/sphinx/issues/1480 https://github.com/sphinx-doc/sphinx/pull/2188

are supposedly addressed in 1.3.5 (actually fixed in 1.3.4).

jdemeyer commented 8 years ago
comment:25

Replying to @strogdon:

If this ever gets up steam again

See [comment:19] and also the prospect of Sage Days dedicated to (amongst other things) Sphinx, organized by Nicolas Thiéry.

jdemeyer commented 8 years ago

Changed dependencies from #17313 to #20359

jdemeyer commented 8 years ago

Author: Jeroen Demeyer

jdemeyer commented 8 years ago

Changed author from Jeroen Demeyer to André Apitzsch, Jeroen Demeyer

jdemeyer commented 8 years ago

Changed branch from u/jhpalmieri/ticket/18497 to u/jdemeyer/ticket/18497

jdemeyer commented 8 years ago

Description changed:

--- 
+++ 
@@ -1,7 +1,5 @@
-Upgrade to [Sphinx 1.3.5, released on 2016-01-24](https://groups.google.com/d/msg/sphinx-dev/FtrXpX92euA/xlb6SDvdCQAJ).
+Upgrade to Sphinx 1.4

 Changes: http://sphinx-doc.org/changes.html

-Tarball: [https://pypi.python.org/packages/source/S/Sphinx/Sphinx-1.3.5.tar.gz#md5=14bc6413d9863e36fd7204770bd6fcfe](https://pypi.python.org/packages/source/S/Sphinx/Sphinx-1.3.5.tar.gz#md5=14bc6413d9863e36fd7204770bd6fcfe)
-
-
+Tarball: [https://pypi.python.org/packages/source/S/Sphinx/Sphinx-1.4.tar.gz](https://pypi.python.org/packages/source/S/Sphinx/Sphinx-1.4.tar.gz)
jdemeyer commented 8 years ago

Changed commit from 717f4e8 to 2cb637c

jdemeyer commented 8 years ago

New commits:

8d9c05aMove upstream changes to autodoc into Sage
90367d8update sphinx package to 1.3.1
6f42e1efix some deprecation warnings
9961661fix orphan setting
f24c34ffix warning "more than one target found for cross-reference u'groebner_basis'"
2cb637ctrac 18497: in docbuilding, use exclude_patterns instead of exclude_trees.
jdemeyer commented 8 years ago
comment:30

Rebased on #20359 except for the changes to sage_autodoc.py and the changes to .. automethod::.

jdemeyer commented 8 years ago

Description changed:

--- 
+++ 
@@ -2,4 +2,6 @@

 Changes: http://sphinx-doc.org/changes.html

-Tarball: [https://pypi.python.org/packages/source/S/Sphinx/Sphinx-1.4.tar.gz](https://pypi.python.org/packages/source/S/Sphinx/Sphinx-1.4.tar.gz)
+Tarballs:
+* [https://pypi.python.org/packages/source/i/imagesize/imagesize-0.7.0.tar.gz](https://pypi.python.org/packages/source/i/imagesize/imagesize-0.7.0.tar.gz)
+* [https://pypi.python.org/packages/source/S/Sphinx/Sphinx-1.4.tar.gz](https://pypi.python.org/packages/source/S/Sphinx/Sphinx-1.4.tar.gz)
jdemeyer commented 8 years ago

Description changed:

--- 
+++ 
@@ -4,4 +4,5 @@

 Tarballs:
 * [https://pypi.python.org/packages/source/i/imagesize/imagesize-0.7.0.tar.gz](https://pypi.python.org/packages/source/i/imagesize/imagesize-0.7.0.tar.gz)
+* [https://pypi.python.org/packages/source/s/snowballstemmer/snowballstemmer-1.2.1.tar.gz](https://pypi.python.org/packages/source/s/snowballstemmer/snowballstemmer-1.2.1.tar.gz)
 * [https://pypi.python.org/packages/source/S/Sphinx/Sphinx-1.4.tar.gz](https://pypi.python.org/packages/source/S/Sphinx/Sphinx-1.4.tar.gz)
jdemeyer commented 8 years ago

Description changed:

--- 
+++ 
@@ -3,6 +3,7 @@
 Changes: http://sphinx-doc.org/changes.html

 Tarballs:
+* [https://pypi.python.org/packages/source/B/Babel/Babel-2.2.0.tar.gz](https://pypi.python.org/packages/source/B/Babel/Babel-2.2.0.tar.gz)
 * [https://pypi.python.org/packages/source/i/imagesize/imagesize-0.7.0.tar.gz](https://pypi.python.org/packages/source/i/imagesize/imagesize-0.7.0.tar.gz)
 * [https://pypi.python.org/packages/source/s/snowballstemmer/snowballstemmer-1.2.1.tar.gz](https://pypi.python.org/packages/source/s/snowballstemmer/snowballstemmer-1.2.1.tar.gz)
 * [https://pypi.python.org/packages/source/S/Sphinx/Sphinx-1.4.tar.gz](https://pypi.python.org/packages/source/S/Sphinx/Sphinx-1.4.tar.gz)
jdemeyer commented 8 years ago

Description changed:

--- 
+++ 
@@ -3,7 +3,6 @@
 Changes: http://sphinx-doc.org/changes.html

 Tarballs:
-* [https://pypi.python.org/packages/source/B/Babel/Babel-2.2.0.tar.gz](https://pypi.python.org/packages/source/B/Babel/Babel-2.2.0.tar.gz)
 * [https://pypi.python.org/packages/source/i/imagesize/imagesize-0.7.0.tar.gz](https://pypi.python.org/packages/source/i/imagesize/imagesize-0.7.0.tar.gz)
 * [https://pypi.python.org/packages/source/s/snowballstemmer/snowballstemmer-1.2.1.tar.gz](https://pypi.python.org/packages/source/s/snowballstemmer/snowballstemmer-1.2.1.tar.gz)
 * [https://pypi.python.org/packages/source/S/Sphinx/Sphinx-1.4.tar.gz](https://pypi.python.org/packages/source/S/Sphinx/Sphinx-1.4.tar.gz)
jdemeyer commented 8 years ago

Changed dependencies from #20359 to #20359, #20374

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 8 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

8d5347dUpgrade to Sphinx 1.4
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 8 years ago

Changed commit from 2cb637c to 8d5347d

jdemeyer commented 8 years ago

Changed dependencies from #20359, #20374 to #20359, #14840

strogdon commented 8 years ago
comment:37

I get

Building reference manual, first pass.

Error building the documentation.
Traceback (most recent call last):
  File "/64bitdev/storage/sage-git_develop/sage/local/lib/python/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/64bitdev/storage/sage-git_develop/sage/local/lib/python/runpy.py", line 72, in _run_code

  File "/64bitdev/storage/sage-git_develop/sage/local/lib/python2.7/site-packages/sage_setup/docbuild/__main__.py", line 2, in <module>
    main()
  File "/64bitdev/storage/sage-git_develop/sage/local/lib/python2.7/site-packages/sage_setup/docbuild/__init__.py", line 1629, in main
    builder()
  File "/64bitdev/storage/sage-git_develop/sage/local/lib/python2.7/site-packages/sage_setup/docbuild/__init__.py", line 284, in _wrapper
    getattr(get_builder(document), 'inventory')(*args, **kwds)
  File "/64bitdev/storage/sage-git_develop/sage/local/lib/python2.7/site-packages/sage_setup/docbuild/__init__.py", line 495, in _wrapper
    x.get(99999)
  File "/64bitdev/storage/sage-git_develop/sage/local/lib/python/multiprocessing/pool.py", line 567, in get
    raise self._value
TypeError: frompickle() takes exactly 3 arguments (2 given)

In

local/lib/python2.7/site-packages/sage_setup/docbuild/__init__.py

there is

env = BuildEnvironment.frompickle(config, env_pickle)

And in

local/lib/python2.7/site-packages/Sphinx-1.4-py2.7.egg/sphinx/environment.py

there is

def frompickle(srcdir, config, filename):

It looks like the srcdir is new. I believe I've merged everything.

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 8 years ago

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

161ac3bSplit up the sagenb distribution
100a6dbMerge branch 'ticket/14840' into t/18497/ticket/18497
ba6c218Upgrade to Sphinx 1.4
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 8 years ago

Changed commit from 8d5347d to ba6c218

jdemeyer commented 8 years ago
comment:40

This now builds Sphinx correctly. I agree with the problem on [comment:37] but have not investigated yet.