Skip to content

Commit

Permalink
Trac #25786: Fix introspection with ? when doc source is not available
Browse files Browse the repository at this point in the history
Currently, introspection does not work in [https://github.com/conda-
forge/sagelib-feedstock/issues/39 conda] and Arch Linux (if the
sagemath-doc package is not installed):
{{{
sage: ZZ?
…
/usr/lib/python2.7/site-packages/sage/misc/sagedoc.pyc in
process_extlinks(s, embedded)
    497     oldpath = sys.path
    498     sys.path = [os.path.join(SAGE_DOC_SRC, 'common')] + oldpath
--> 499     from conf import extlinks
    500     sys.path = oldpath
    501     for key in extlinks:

ImportError: cannot import name extlinks
}}}

The problem is that `src/doc/common/conf.py` is not in the place that
Sage expects.

I don't think that we should require the documentation configuration to
be installed for Sage to work.

A docker image to play with this is being built here:
https://gitlab.com/sagemath/dev/sage/pipelines/25262253

URL: https://trac.sagemath.org/25786
Reported by: saraedum
Ticket author(s): Julian Rüth, Isuru Fernando
Reviewer(s): Julian Rüth, Isuru Fernando, François Bissey
  • Loading branch information
Release Manager committed Jul 22, 2019
2 parents 8c6e4d5 + a401a17 commit 7bab17d
Show file tree
Hide file tree
Showing 39 changed files with 92 additions and 155 deletions.
6 changes: 2 additions & 4 deletions src/doc/ca/intro/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

import sys, os
from sage.env import SAGE_DOC_SRC
sys.path.append(SAGE_DOC_SRC)
from common.conf import *
from sage.docs.conf import release
from sage.docs.conf import * # NOQA

# General information about the project.
project = u"Introducció de Sage"
Expand Down
Empty file removed src/doc/common/__init__.py
Empty file.
6 changes: 2 additions & 4 deletions src/doc/de/a_tour_of_sage/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,8 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

import sys, os
from sage.env import SAGE_DOC_SRC
sys.path.append(SAGE_DOC_SRC)
from common.conf import *
from sage.docs.conf import release
from sage.docs.conf import * # NOQA

# General information about the project.
project = u"Ein Rundgang durch Sage"
Expand Down
6 changes: 2 additions & 4 deletions src/doc/de/thematische_anleitungen/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

import sys, os
from sage.env import SAGE_DOC_SRC
sys.path.append(SAGE_DOC_SRC)
from common.conf import *
from sage.docs.conf import release
from sage.docs.conf import * # NOQA

# General information about the project.
project = u"Thematische Anleitungen"
Expand Down
6 changes: 2 additions & 4 deletions src/doc/de/tutorial/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

import sys, os
from sage.env import SAGE_DOC_SRC
sys.path.append(SAGE_DOC_SRC)
from common.conf import *
from sage.docs.conf import release
from sage.docs.conf import * # NOQA

# General information about the project.
project = u"Sage Tutorial"
Expand Down
6 changes: 2 additions & 4 deletions src/doc/en/a_tour_of_sage/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

import sys, os
from sage.env import SAGE_DOC_SRC
sys.path.append(SAGE_DOC_SRC)
from common.conf import *
from sage.docs.conf import release
from sage.docs.conf import * # NOQA

# General information about the project.
project = u'A Tour of Sage'
Expand Down
6 changes: 2 additions & 4 deletions src/doc/en/constructions/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

import sys, os
from sage.env import SAGE_DOC_SRC
sys.path.append(SAGE_DOC_SRC)
from common.conf import *
from sage.docs.conf import release
from sage.docs.conf import * # NOQA

# General information about the project.
project = u"Sage Constructions"
Expand Down
6 changes: 2 additions & 4 deletions src/doc/en/developer/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

import sys, os
from sage.env import SAGE_DOC_SRC
sys.path.append(SAGE_DOC_SRC)
from common.conf import *
from sage.docs.conf import release
from sage.docs.conf import * # NOQA

# General information about the project.
project = u"Sage Developer's Guide"
Expand Down
8 changes: 2 additions & 6 deletions src/doc/en/faq/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,8 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

import os
import sys

from sage.env import SAGE_DOC_SRC
sys.path.append(SAGE_DOC_SRC)
from common.conf import *
from sage.docs.conf import release
from sage.docs.conf import *

# General information about the project.
project = u"Sage FAQ"
Expand Down
6 changes: 2 additions & 4 deletions src/doc/en/installation/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

import sys, os
from sage.env import SAGE_DOC_SRC
sys.path.append(SAGE_DOC_SRC)
from common.conf import *
from sage.docs.conf import release
from sage.docs.conf import * # NOQA

# General information about the project.
project = u"Sage Installation Guide"
Expand Down
1 change: 0 additions & 1 deletion src/doc/en/introspect/__init__.py

This file was deleted.

21 changes: 0 additions & 21 deletions src/doc/en/introspect/conf.py

This file was deleted.

1 change: 0 additions & 1 deletion src/doc/en/introspect/static/empty

This file was deleted.

3 changes: 0 additions & 3 deletions src/doc/en/introspect/templates/layout.html

This file was deleted.

6 changes: 2 additions & 4 deletions src/doc/en/prep/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

import sys, os
from sage.env import SAGE_DOC_SRC
sys.path.append(SAGE_DOC_SRC)
from common.conf import *
from sage.docs.conf import release
from sage.docs.conf import * # NOQA


# General information about the project.
Expand Down
6 changes: 3 additions & 3 deletions src/doc/en/reference/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

import sys, os
import os
from sage.env import SAGE_DOC_SRC, SAGE_DOC
sys.path.append(SAGE_DOC_SRC)
from common.conf import *
from sage.docs.conf import release, latex_elements, exclude_patterns
from sage.docs.conf import *

ref_src = os.path.join(SAGE_DOC_SRC, 'en', 'reference')
ref_out = os.path.join(SAGE_DOC, 'html', 'en', 'reference')
Expand Down
6 changes: 3 additions & 3 deletions src/doc/en/reference/conf_sub.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

import sys, os
import os
from sage.env import SAGE_DOC_SRC, SAGE_DOC
sys.path.append(SAGE_DOC_SRC)
from common.conf import *
from sage.docs.conf import release, exclude_patterns
from sage.docs.conf import *

from six.moves import range

Expand Down
7 changes: 2 additions & 5 deletions src/doc/en/thematic_tutorials/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,8 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

import os
import sys
from sage.env import SAGE_DOC_SRC
sys.path.append(SAGE_DOC_SRC)
from common.conf import *
from sage.docs.conf import release
from sage.docs.conf import *

# General information about the project.
project = u"Thematic Tutorials"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

import sys, os
from sage.env import SAGE_DOC_SRC
sys.path.append(SAGE_DOC_SRC)
from common.conf import *
from sage.docs.conf import release
from sage.docs.conf import * # NOQA

# General information about the project.
name = 'bordeaux_2008'
Expand Down
6 changes: 2 additions & 4 deletions src/doc/en/thematic_tutorials/numerical_sage/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

import sys, os
from sage.env import SAGE_DOC_SRC
sys.path.append(SAGE_DOC_SRC)
from common.conf import *
from sage.docs.conf import release
from sage.docs.conf import * # NOQA

# General information about the project.
project = u'Numerical Computing with Sage'
Expand Down
6 changes: 2 additions & 4 deletions src/doc/en/tutorial/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

import sys, os
from sage.env import SAGE_DOC_SRC
sys.path.append(SAGE_DOC_SRC)
from common.conf import *
from sage.docs.conf import release
from sage.docs.conf import * # NOQA

# General information about the project.
project = u"Sage Tutorial"
Expand Down
6 changes: 2 additions & 4 deletions src/doc/en/website/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

import sys, os
from sage.env import SAGE_DOC_SRC
sys.path.append(SAGE_DOC_SRC)
from common.conf import *
from sage.docs.conf import release
from sage.docs.conf import * # NOQA

# General information about the project.
project = u'Sage Documentation'
Expand Down
7 changes: 2 additions & 5 deletions src/doc/es/a_tour_of_sage/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,8 @@
# All configuration values have a default; values that are commented
# out serve to show the default.

import sys
import os
from sage.env import SAGE_DOC_SRC
sys.path.append(SAGE_DOC_SRC)
from common.conf import *
from sage.docs.conf import release
from sage.docs.conf import *

# General information about the project.
project = u'Un Tour Por Sage'
Expand Down
7 changes: 2 additions & 5 deletions src/doc/es/tutorial/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,8 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

import sys
import os
from sage.env import SAGE_DOC_SRC
sys.path.append(SAGE_DOC_SRC)
from common.conf import *
from sage.docs.conf import release
from sage.docs.conf import *

# General information about the project.
project = u"Sage Tutorial"
Expand Down
6 changes: 2 additions & 4 deletions src/doc/fr/a_tour_of_sage/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

import sys, os
from sage.env import SAGE_DOC_SRC
sys.path.append(SAGE_DOC_SRC)
from common.conf import *
from sage.docs.conf import release, latex_elements
from sage.docs.conf import * # NOQA

# General information about the project.
project = u'Sage en quelques mots'
Expand Down
6 changes: 2 additions & 4 deletions src/doc/fr/tutorial/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

import sys, os
from sage.env import SAGE_DOC_SRC
sys.path.append(SAGE_DOC_SRC)
from common.conf import *
from sage.docs.conf import release, latex_elements
from sage.docs.conf import * # NOQA

# General information about the project.
project = u"Tutoriel Sage"
Expand Down
6 changes: 2 additions & 4 deletions src/doc/hu/a_tour_of_sage/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,8 @@
# All configuration values have a default; values that are commented
# out serve to show the default.

import sys, os
from sage.env import SAGE_DOC_SRC
sys.path.append(SAGE_DOC_SRC)
from common.conf import *
from sage.docs.conf import release
from sage.docs.conf import * # NOQA

# General information about the project.
project = u'A Sage bemutatása'
Expand Down
6 changes: 2 additions & 4 deletions src/doc/it/a_tour_of_sage/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

import sys, os
from sage.env import SAGE_DOC_SRC
sys.path.append(SAGE_DOC_SRC)
from common.conf import *
from sage.docs.conf import release, latex_elements
from sage.docs.conf import * # NOQA

# General information about the project.
project = u'Esplora Sage'
Expand Down
6 changes: 2 additions & 4 deletions src/doc/ja/a_tour_of_sage/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

import sys, os
from sage.env import SAGE_DOC_SRC
sys.path.append(SAGE_DOC_SRC)
from common.conf import *
from sage.docs.conf import release, latex_elements
from sage.docs.conf import * # NOQA

# General information about the project.
project = u"Sage ガイドツアー"
Expand Down
6 changes: 2 additions & 4 deletions src/doc/ja/tutorial/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

import sys, os
from sage.env import SAGE_DOC_SRC
sys.path.append(SAGE_DOC_SRC)
from common.conf import *
from sage.docs.conf import release, latex_elements
from sage.docs.conf import * # NOQA

# General information about the project.
project = u"Sage チュートリアル"
Expand Down
6 changes: 2 additions & 4 deletions src/doc/pt/a_tour_of_sage/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

import sys, os
from sage.env import SAGE_DOC_SRC
sys.path.append(SAGE_DOC_SRC)
from common.conf import *
from sage.docs.conf import release
from sage.docs.conf import * # NOQA

# General information about the project.
project = u'Uma Turnê pelo Sage'
Expand Down
6 changes: 2 additions & 4 deletions src/doc/pt/tutorial/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

import sys, os
from sage.env import SAGE_DOC_SRC
sys.path.append(SAGE_DOC_SRC)
from common.conf import *
from sage.docs.conf import release
from sage.docs.conf import * # NOQA

# General information about the project.
project = u"Tutorial Sage"
Expand Down
Loading

0 comments on commit 7bab17d

Please sign in to comment.