sagemath / sage

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

Simplify Sphinxify #8102

Closed e14f4152-4982-4ace-8c95-73a0599b109b closed 14 years ago

e14f4152-4982-4ace-8c95-73a0599b109b commented 14 years ago

Simplifying sagenb.misc.sphinxify and importing sphinx.application.Sphinx on demand should make docstrings render faster and reduce Sage startup time.

CC: @TimDumol

Component: notebook

Author: Mitesh Patel

Reviewer: John Palmieri

Merged: sagenb-0.7.4

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

e14f4152-4982-4ace-8c95-73a0599b109b commented 14 years ago

Attachment: trac_8102-simplify_sphinxify.patch.gz

Simplify sphinxify.py. Some pep8 tweaks. sagenb repo.

e14f4152-4982-4ace-8c95-73a0599b109b commented 14 years ago
comment:1

The patch also includes some pep8 tweaks.

e14f4152-4982-4ace-8c95-73a0599b109b commented 14 years ago
comment:2

Specifically,

/usr/bin/pep8 --repeat --show-source --ignore=E251,E301,E302,E501 sphinxify.py

And to test the startup imports / time: sage -startuptime

jhpalmieri commented 14 years ago
comment:3

In line 89

confdir = os.path.join(SAGE_DOC, 'en', 'introspect') 

won't there be problems if SAGE_DOC is None? I guess earlier in the file, you could change the last line in the following:

try:
    from sage.misc.misc import SAGE_DOC
except ImportError:
    SAGE_DOC = ""  # used to be None

Otherwise it looks good.

e14f4152-4982-4ace-8c95-73a0599b109b commented 14 years ago

Attachment: trac_8102-simplify_sphinxify.2.patch.gz

Replace SAGE_DOC = None with SAGE_DOC = ''. Replaces previous.

e14f4152-4982-4ace-8c95-73a0599b109b commented 14 years ago
comment:4

Thanks for catching that exception. V2 includes the change.

jhpalmieri commented 14 years ago

Reviewer: John Palmieri

e14f4152-4982-4ace-8c95-73a0599b109b commented 14 years ago

Merged: sagenb-0.7.4