New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
update Sphinx to version 0.6.2 or 0.6.3 #6586
Comments
comment:1
Oh, I forgot: you need to apply the patch at #6585 for the reference manual to build. This version of Sphinx also prints a lot of new warnings, too. |
comment:2
I installed the updated SPKG with
and applied the patch at #6585. When doing
I got the following errors:
|
comment:3
I think I got this error, too. Once I deleted doc/output, things worked for me. (I think there is something stored in the old version of the documentation which confuses the new version of Sphinx.) |
comment:5
The upgraded Sphinx SPKG can't handle binary encodings in the file:
In particular, the following sections from that source file: line:2233
line:2294
line:2839
When these lines are removed, the HTML version of the reference manual builds OK. So a possible fix for line 2233 is to replace everything in the TEST block starting from that line by:
We can do something similar for line 2294; replace everything in the TEST block starting from line 2294 by:
As for the TEST block starting from line 2839, I have no idea how to fix it so that the reference manual would successfully builds. Someone on the sage-combinat team to the rescue? |
comment:6
Replying to @jhpalmieri:
I think that this patch fixes the issue with binary encodings; at least it did for me. |
comment:7
With the patch at #6585 and the SPKG, building the reference manual on sage.math takes much longer than previously. |
comment:8
Replying to @sagetrac-mvngu:
I agree: on my mac, it took 28 minutes to build the html version with the old one, and 43 minutes with the new one. With the --jsmath option on, the old one took 6 minutes and the new one took 15 minutes. I was getting similar comparisons on sage.math. (This is with me deleting devel/sage/doc/output between each build, to level the playing field.) It's strange: for the tutorial and developer's guide, building is about the same or slightly faster with the new version. I also made a modified version of the developer's guide by duplicating some sections (so that the resulting PDF file was 559 pages); the new version was slightly faster there, too. Maybe it's all of the math in the reference manual? Maybe it's the large number of files? Maybe it's the autogeneration of files? |
comment:9
Cursory profiling with #6187's "testreference" target indicates that the rewritten Perhaps there's a more efficient, parallelizable representation. Can we subclass and/or Cythonize sphinx.ext.autodoc.Documenter? |
comment:10
Minor progress: It seems that a custom autodoc-skip-member method now overrides Sphinx's default behavior, which is to skip private methods (
in |
comment:11
Apparently, the culprit is
According to the analyzer, there are just two places to find such docstrings in the Sage library:
This does reduce build time and memory usage, but I don't know if the output is identical. |
comment:12
For
The differences are in
|
comment:13
Clearly, it's time for a break. |
comment:14
Nice observation. Making the change with weak_references does indeed speed things up:
With no other changes, it includes all of the private methods, as already pointed out (and I assume it did before using weakref -- this may account for some of the increased time, since it's producing more output), but it also includes (for some classes, anyway), an entry for
|
comment:15
Actually, noticing |
comment:16
See #6664 for the |
comment:17
Also, I've asked about the merits of the |
Example inheritance diagram for "The Steenrod algebra". This is just for fun. |
comment:18
Attachment: inheritance_example.patch.gz The new inheritance diagram extension has potential. I've attached a minimal example. Please do not merge it. The options are limited, however. For example, I could not find a directive that auto-generates a diagram for each module. Also, it seems there's no way to color-code the nodes/classes, e.g., to indicate their modular provenance. Maybe it's possible to do one or more of these ourselves, in |
comment:19
I should add that this requires a local installation of GraphViz. |
Attachment: deps.gz diff between old and new install |
Attachment: install.patch.gz Attachment: deps.patch.gz diff between old and new deps |
This comment has been minimized.
This comment has been minimized.
comment:52
Both the latest Sphinx and Jinja2 packages appear to install without network activity. The changes to To the extent that it counts, my review is positive. |
Changed reviewer from Mitesh Patel to Mitesh Patel, Tim Dumol |
comment:53
Documentation builds perfectly. Sphinx 0.6.3 takes only 2 minutes more Haven't done a complete install yet, but I'll do so once I finish downloading the 4.1.2.alpha2 tarball. |
Changed reviewer from Mitesh Patel, Tim Dumol to John Cremona, Tim Dumol, Mitesh Patel |
comment:54
I updated There's a failed test: mpatel@sage sage-200$ ./sage -t devel/sage/sage/misc/trace.py
sage -t "devel/sage/sage/misc/trace.py"
**********************************************************************
File "/scratch/mpatel/source/sage-200/devel/sage/sage/misc/trace.py", line 61:
sage: print s.before[s.before.find('-'):]
Expected:
---...
ipdb> c
2 * 5
Got:
--Call--
> /scratch/mpatel/source/sage-200/local/lib/python2.6/site-packages/sage/rings/arith.py(1944)factor()
1943
-> 1944 def factor(n, proof=None, int_=False, algorithm='pari', verbose=0, **kwds):
1945 """
ipdb> c
2 * 5
<BLANKLINE>
**********************************************************************
1 items had failures:
1 of 10 in __main__.example_1
***Test Failed*** 1 failures.
For whitespace errors, see the file /scratch/mpatel/source/sage-200/tmp/.doctest_trace.py
[3.7 s]
exit code: 1024
----------------------------------------------------------------------
The following tests failed:
sage -t "devel/sage/sage/misc/trace.py"
Total time for all tests: 3.7 seconds I think it's not related to this ticket. |
comment:55
Problem: Somehow, Sphinx 0.6.3 breaks the sidebar toggle (cf. #6507) in the live docs. In Firebug's console: unexpected end of XML source
<span class="math">('#searchbox').show(0); |
comment:56
Patching Sphinx 0.6.3 should fix this and perhaps also a similar problem reported on sage-devel: --- sphinx/themes/basic/layout.html.orig 2009-10-04 17:07:16.000000000 -0700
+++ sphinx/themes/basic/layout.html 2009-10-04 17:07:28.000000000 -0700
@@ -81,7 +81,7 @@
{{ _('Enter search terms or a module, class or function name.') }}
</p>
</div>
- <script type="text/javascript">$('#searchbox').show(0);</script>
+ <script type="text/javascript">jQuery('#searchbox').show(0);</script>
{%- endif %}
{%- endblock %}
</div> |
comment:57
Or perhaps not. |
comment:58
mpatel: The problem with the sidebar is caused by compression. Line comments ("//") are used in the sidebar code, therefore when the code is compressed, the entire function is commented out. Changing the line comments to block comments ("/* */") fixed the problem for me. |
comment:59
A patch for the doc sidebar problem is now up at #7126. |
comment:60
If this comment at #7126 is correct, we should still patch |
comment:62
Merged both the jinja2 and sphinx in spkg. |
Merged: sage-4.2.alpha0 |
As the summary says. The spkg can be found at
http://sage.math.washington.edu/home/palmieri/SPKG/sphinx-0.6.3.p1.spkg
After installing it and before building any docs, you will probably need to delete the directory SAGE_ROOT/devel/sage/doc/output -- this holds cached information which may not be compatible between different versions of Sphinx.
Sphinx 0.6.3 also uses Jinja2. Sage includes Jinja, not Jinja2. As long as you're connected to a network, the installation of Sphinx 0.6.3 downloads Jinja2 and installs it -- it can coexist with Jinja, so it shouldn't mess anything up. If you're not connected to a network, and for putting in the Sage tar ball, there is an spkg for Jinja2:
http://sage.math.washington.edu/home/palmieri/SPKG/jinja2-2.1.1.p0.spkg
For producing a new Sage tarball, since we're adding a new spkg, I think we need to modify the files
spkg/install
andspkg/standard/deps
; I've attached new versions of these.Finally, the patch below ("inheritance_example.patch") is not required. It provides an illustration of a new capability of Sphinx 0.6.3 (and I think it's quite nice), but it's not something that needs to be installed or reviewed for this ticket.
CC: @mwhansen @sagetrac-sage-combinat
Component: packages: standard
Author: John Palmieri
Reviewer: John Cremona, Tim Dumol, Mitesh Patel
Merged: sage-4.2.alpha0
Issue created by migration from https://trac.sagemath.org/ticket/6586
The text was updated successfully, but these errors were encountered: