Skip to content

Commit

Permalink
Trac #33795: Move handling of "sage --docbuild" back to src/bin/sage
Browse files Browse the repository at this point in the history
(from https://trac.sagemath.org/ticket/33650#comment:32)

It was moved in #29111 to `build/bin/sage-site`, but it does have some
(limited - #30475) functionality for users.

'''sage-docbuild''' would be declared as an `install-requires` of
'''sagemath-standard'''. #29941 also declares it as an `extras-require`
of '''sagemath-environment'''.

URL: https://trac.sagemath.org/33795
Reported by: mkoeppe
Ticket author(s): Kwankyu Lee
Reviewer(s): Matthias Koeppe
  • Loading branch information
Release Manager committed Jul 8, 2022
2 parents 63f461c + fc9b96f commit f513e8f
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 31 deletions.
31 changes: 0 additions & 31 deletions build/bin/sage-site
Original file line number Diff line number Diff line change
Expand Up @@ -215,37 +215,6 @@ if [ "$1" = '-info' -o "$1" = '--info' ]; then
exit 0
fi

#####################################################################
# Building the documentation.
#####################################################################

if [ "$1" = "-docbuild" -o "$1" = "--docbuild" ]; then
# Redirect stdin from /dev/null. This helps with running TeX which
# tends to ask interactive questions if something goes wrong. These
# cause the build to hang. If stdin is /dev/null, TeX just aborts.
shift

# Trac #30002: ensure an English locale so that it is possible to
# scrape out warnings by pattern matching.
export LANG=C
export LANGUAGE=C

# See #30351: bugs in macOS implementations of openblas/libgopm can cause
# docbuild to hang if multiple OpenMP threads are allowed.
if [ `uname` = 'Darwin' ]; then
export OMP_NUM_THREADS=1
fi

# Trac #33650: Make sure that user configuration of Jupyter does not
# shadow our sagemath kernel when jupyter-sphinx is invoked
export JUPYTER_CONFIG_DIR=/doesnotexist
export JUPYTER_CONFIG_PATH=/doesnotexist
export JUPYTER_DATA_DIR=/doesnotexist
export JUPYTER_PATH=/doesnotexist

exec sage-python -m sage_docbuild "$@" </dev/null
fi

if [ "$1" = '-git-branch' -o "$1" = '--git-branch' ]; then
shift
exec git --git-dir="$SAGE_ROOT"/.git rev-parse --abbrev-ref HEAD
Expand Down
31 changes: 31 additions & 0 deletions src/bin/sage
Original file line number Diff line number Diff line change
Expand Up @@ -1009,6 +1009,37 @@ if [ "$1" = '-pytest' -o "$1" = '--pytest' ]; then
fi
fi

#####################################################################
# Building the Sage documentation
#####################################################################

if [ "$1" = "-docbuild" -o "$1" = "--docbuild" ]; then
shift

# Trac #30002: ensure an English locale so that it is possible to
# scrape out warnings by pattern matching.
export LANG=C
export LANGUAGE=C

# See #30351: bugs in macOS implementations of openblas/libgopm can cause
# docbuild to hang if multiple OpenMP threads are allowed.
if [ `uname` = 'Darwin' ]; then
export OMP_NUM_THREADS=1
fi

# Trac #33650: Make sure that user configuration of Jupyter does not
# shadow our sagemath kernel when jupyter-sphinx is invoked
export JUPYTER_CONFIG_DIR=/doesnotexist
export JUPYTER_CONFIG_PATH=/doesnotexist
export JUPYTER_DATA_DIR=/doesnotexist
export JUPYTER_PATH=/doesnotexist

# Redirect stdin from /dev/null. This helps with running TeX which
# tends to ask interactive questions if something goes wrong. These
# cause the build to hang. If stdin is /dev/null, TeX just aborts.
exec sage-python -m sage_docbuild "$@" </dev/null
fi

#####################################################################
# Creating and handling Sage distributions
#####################################################################
Expand Down

0 comments on commit f513e8f

Please sign in to comment.