Ticket #6495: trac_6495-sphinx-grammar.patch

File trac_6495-sphinx-grammar.patch, 2.2 KB (added by jhpalmieri, 9 years ago)

patch for Sphinx spkg; for review only

  • SPKG.txt

    # 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  
    6565     the huge index of the Sage reference manual when building the PDF
    6666     version of that manual.
     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.
    6873 * To do: autogenerate the file sage_autodoc.py from
    6974   src/sphinx/ext/autodoc.py.  sage_autodoc.py is currently in
    7075   SAGE_ROOT/devel/sage/doc/common and is tracked in the Sage library
    8085== Changelog ==
     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.
    8292=== sphinx-1.1.2.p1 (Jeroen Demeyer, 28 February 2012) ===
    8393 * #12572: add extra_mem_top=2000000 to the environment when running
    8494   latex.  This increases the amount of main memory available.
  • new file create_grammar_pickle.py

    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.
     3from os import path
     4from sphinx import package_dir
     5from sphinx.pycode.pgen2 import driver
     7_grammarfile = path.join(package_dir, 'pycode', 'Grammar.txt')
     8pygrammar = driver.load_grammar(_grammarfile)
  • spkg-install

    diff --git a/spkg-install b/spkg-install
    a b  
    4949success "Error copying sphinx-build to $SAGE_LOCAL/bin/"
     52echo "Creating grammar pickle..."
     53python create_grammar_pickle.py
     54success 'Error creating the grammar pickle'
    5357echo "Deleting old Sage documentation output..."
    5458for docdir in "$SAGE_ROOT"/devel/sage-*/doc/output; do