# HG changeset patch
# User J. H. Palmieri <palmieri@math.washington.edu>
# Date 1360786049 28800
# Node ID 214726b7153f610750103f3b1744355abc4e236e
# Parent 553b46bdb3f5fc4322ee0c2cb5d95424b2e0de7b
#6495: Create the grammar pickle upon installation
by running the script create_grammar_pickle.py. This helps to avoid
race conditions when building the documentation in parallel.
diff --git a/SPKG.txt b/SPKG.txt
a
|
b
|
|
65 | 65 | the huge index of the Sage reference manual when building the PDF |
66 | 66 | version of that manual. |
67 | 67 | |
| 68 | * The script create_grammar_pickle.py creates the file |
| 69 | Grammar2.7.pickle in site-packages/Sphinx-.../sphinx/pycode/. This |
| 70 | helps to avoid race conditions when building the documentation in |
| 71 | parallel. |
| 72 | |
68 | 73 | * To do: autogenerate the file sage_autodoc.py from |
69 | 74 | src/sphinx/ext/autodoc.py. sage_autodoc.py is currently in |
70 | 75 | SAGE_ROOT/devel/sage/doc/common and is tracked in the Sage library |
… |
… |
|
79 | 84 | |
80 | 85 | == Changelog == |
81 | 86 | |
| 87 | === sphinx-1.1.2.p2 (John Palmieri, 13 February 2013) === |
| 88 | * #6495: create the grammar pickle upon installation, by running the |
| 89 | script create_grammar_pickle.py. This helps to avoid race |
| 90 | conditions when building the documentation in parallel. |
| 91 | |
82 | 92 | === sphinx-1.1.2.p1 (Jeroen Demeyer, 28 February 2012) === |
83 | 93 | * #12572: add extra_mem_top=2000000 to the environment when running |
84 | 94 | latex. This increases the amount of main memory available. |
diff --git a/create_grammar_pickle.py b/create_grammar_pickle.py
new file mode 100644
-
|
+
|
|
| 1 | # Code taken from sphinx/pycode/__init__.py to generate the grammar pickle. |
| 2 | |
| 3 | from os import path |
| 4 | from sphinx import package_dir |
| 5 | from sphinx.pycode.pgen2 import driver |
| 6 | |
| 7 | _grammarfile = path.join(package_dir, 'pycode', 'Grammar.txt') |
| 8 | pygrammar = driver.load_grammar(_grammarfile) |
diff --git a/spkg-install b/spkg-install
a
|
b
|
|
49 | 49 | success "Error copying sphinx-build to $SAGE_LOCAL/bin/" |
50 | 50 | echo |
51 | 51 | |
| 52 | echo "Creating grammar pickle..." |
| 53 | python create_grammar_pickle.py |
| 54 | success 'Error creating the grammar pickle' |
| 55 | echo |
52 | 56 | |
53 | 57 | echo "Deleting old Sage documentation output..." |
54 | 58 | for docdir in "$SAGE_ROOT"/devel/sage-*/doc/output; do |