Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
doctests: use dochtml as default option only when html docs are insta…
Browse files Browse the repository at this point in the history
…lled
  • Loading branch information
tornaria committed Dec 26, 2021
1 parent 42a76c3 commit 4e364ea
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/bin/sage-runtests
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@ import sys
DOT_SAGE = os.environ.get('DOT_SAGE', os.path.join(os.environ.get('HOME'),
'.sage'))
SAGE_ROOT = os.environ.get('SAGE_ROOT')
SAGE_DOC = os.environ.get('SAGE_DOC')

# Override to not pick up user configuration, see Trac #20270
os.environ['SAGE_STARTUP_FILE'] = os.path.join(DOT_SAGE, 'init-doctests.sage')


def _get_optional_defaults():
"""Return the default value for the --optional flag."""
optional = ['sage', 'dochtml', 'optional']
optional = ['sage', 'optional']

# This should be good-enough to determine if we are in a sage source
# repository working tree
Expand All @@ -24,6 +25,10 @@ def _get_optional_defaults():
os.path.isfile(os.path.join(SAGE_ROOT, 'sage'))):
optional.append('build')

# Check if the html docs are installed
if (SAGE_DOC and os.path.isdir(os.path.join(SAGE_DOC, 'html'))):
optional.append('dochtml')

return ','.join(optional)


Expand Down

0 comments on commit 4e364ea

Please sign in to comment.