Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions build/make/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ SAGE_DOCS_DISABLED_MESSAGE = This Sage build is configured with "configure --dis
# Where the Sage distribution installs Python packages.
# This can be overridden by 'make SAGE_VENV=/some/venv'.
SAGE_VENV = @SAGE_VENV@
JUPYTER_VENV = @JUPYTER_VENV@

# Generate/install sage-specific .pc files.
# see build/pkgs/gsl/spkg-configure.m4
Expand Down Expand Up @@ -184,7 +185,7 @@ $(SAGE_LOCAL)/$(SPKG_INST_RELDIR)/.dummy:


# Filtered by installation tree
$(foreach tree,SAGE_LOCAL SAGE_VENV SAGE_DOCS, \
$(foreach tree,SAGE_LOCAL SAGE_VENV JUPYTER_VENV SAGE_DOCS, \
$(eval $(tree)_INSTALLED_PACKAGE_INSTS = \
$(foreach pkgname,$(INSTALLED_PACKAGES), \
$(if $(findstring $(tree),$(trees_$(pkgname))), \
Expand Down Expand Up @@ -252,6 +253,8 @@ $(inst_python3_venv): | $(SAGE_VENV)/$(SPKG_INST_RELDIR)
touch "$@"
endif



# Build everything and start Sage.
# Note that we put the "doc" target first in the rule below because
# the doc build takes the most time and should be started as soon as
Expand All @@ -273,7 +276,8 @@ base-toolchain: _clean-broken-gcc base
# All targets except for the base packages and except the documentation
all-sage: \
$(SAGE_LOCAL_INSTALLED_PACKAGE_INSTS) $(SAGE_LOCAL_UNINSTALLED_PACKAGES_UNINSTALLS) \
$(SAGE_VENV_INSTALLED_PACKAGE_INSTS) $(SAGE_VENV_UNINSTALLED_PACKAGES_UNINSTALLS)
$(SAGE_VENV_INSTALLED_PACKAGE_INSTS) $(SAGE_VENV_UNINSTALLED_PACKAGES_UNINSTALLS) \
$(JUPYTER_VENV_INSTALLED_PACKAGE_INSTS) $(JUPYTER_VENV_UNINSTALLED_PACKAGES_UNINSTALLS)

# Same but filtered by installation trees:
all-build-local: toolchain-deps
Expand All @@ -286,6 +290,11 @@ all-build-venv: toolchain-deps

all-sage-venv: $(SAGE_VENV_INSTALLED_PACKAGE_INSTS) $(SAGE_VENV_UNINSTALLED_PACKAGES_UNINSTALLS)

all-build-jupyter: toolchain-deps
+$(MAKE_REC) all-jupyter-venv

all-jupyter-venv: $(JUPYTER_VENV_INSTALLED_PACKAGE_INSTS) $(JUPYTER_VENV_UNINSTALLED_PACKAGES_UNINSTALLS)

all-build-docs: toolchain-deps
+$(MAKE_REC) all-sage-docs

Expand Down
1 change: 1 addition & 0 deletions build/pkgs/anyio/trees.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
JUPYTER_VENV
1 change: 1 addition & 0 deletions build/pkgs/argon2_cffi/trees.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
JUPYTER_VENV
1 change: 1 addition & 0 deletions build/pkgs/argon2_cffi_bindings/trees.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
JUPYTER_VENV
1 change: 1 addition & 0 deletions build/pkgs/arrow/trees.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
JUPYTER_VENV
1 change: 1 addition & 0 deletions build/pkgs/async_lru/trees.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
JUPYTER_VENV
1 change: 1 addition & 0 deletions build/pkgs/beautifulsoup4/trees.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
JUPYTER_VENV
1 change: 1 addition & 0 deletions build/pkgs/bleach/trees.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
JUPYTER_VENV
1 change: 1 addition & 0 deletions build/pkgs/defusedxml/trees.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
JUPYTER_VENV
1 change: 1 addition & 0 deletions build/pkgs/fastjsonschema/trees.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
JUPYTER_VENV
1 change: 1 addition & 0 deletions build/pkgs/fqdn/trees.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
JUPYTER_VENV
1 change: 1 addition & 0 deletions build/pkgs/ipympl/trees.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
JUPYTER_VENV
1 change: 1 addition & 0 deletions build/pkgs/isoduration/trees.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
JUPYTER_VENV
1 change: 1 addition & 0 deletions build/pkgs/json5/trees.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
JUPYTER_VENV
1 change: 1 addition & 0 deletions build/pkgs/jsonpointer/trees.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
JUPYTER_VENV
1 change: 1 addition & 0 deletions build/pkgs/jsonschema/trees.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
JUPYTER_VENV
1 change: 1 addition & 0 deletions build/pkgs/jsonschema_specifications/trees.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
JUPYTER_VENV
1 change: 1 addition & 0 deletions build/pkgs/jupyter_events/trees.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
JUPYTER_VENV
1 change: 1 addition & 0 deletions build/pkgs/jupyter_jsmol/trees.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
JUPYTER_VENV
1 change: 1 addition & 0 deletions build/pkgs/jupyter_lsp/trees.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
JUPYTER_VENV
1 change: 1 addition & 0 deletions build/pkgs/jupyter_server/trees.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
JUPYTER_VENV
1 change: 1 addition & 0 deletions build/pkgs/jupyter_server_terminals/trees.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
JUPYTER_VENV
1 change: 1 addition & 0 deletions build/pkgs/jupyterlab/trees.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
JUPYTER_VENV
1 change: 1 addition & 0 deletions build/pkgs/jupyterlab_mathjax2/trees.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
JUPYTER_VENV
1 change: 1 addition & 0 deletions build/pkgs/jupyterlab_server/trees.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
JUPYTER_VENV
1 change: 1 addition & 0 deletions build/pkgs/mistune/trees.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
JUPYTER_VENV
1 change: 1 addition & 0 deletions build/pkgs/nbclient/trees.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
JUPYTER_VENV
1 change: 1 addition & 0 deletions build/pkgs/nbconvert/trees.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
JUPYTER_VENV
1 change: 1 addition & 0 deletions build/pkgs/nbformat/trees.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
JUPYTER_VENV
1 change: 1 addition & 0 deletions build/pkgs/notebook/trees.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
JUPYTER_VENV
1 change: 1 addition & 0 deletions build/pkgs/notebook_shim/trees.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
JUPYTER_VENV
1 change: 1 addition & 0 deletions build/pkgs/overrides/trees.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
JUPYTER_VENV
1 change: 1 addition & 0 deletions build/pkgs/pandocfilters/trees.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
JUPYTER_VENV
1 change: 1 addition & 0 deletions build/pkgs/prometheus_client/trees.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
JUPYTER_VENV
6 changes: 6 additions & 0 deletions build/pkgs/python3/spkg-configure.m4
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,12 @@ To build Sage with a different system python, use ./configure --with-python=/pat
[no], [SAGE_VENV='${SAGE_LOCAL}'],dnl Quoted so that it is resolved at build time by shell/Makefile
[yes], [SAGE_VENV='${SAGE_LOCAL}'/var/lib/sage/venv-python$PYTHON_VERSION]
)

AS_CASE([$SAGE_VENV],
[no], [JUPYTER_VENV='${SAGE_VENV}'],dnl Quoted so that it is resolved at build time by shell/Makefile
[yes], [JUPYTER_VENV='${SAGE_LOCAL}'/var/lib/sage/jupyter-venv-python$PYTHON_VERSION]
)

dnl These temporary directories are created by the check above
dnl and need to be cleaned up to prevent the "rm -f conftest*"
dnl (that a bunch of other checks do) from emitting warnings about
Expand Down
1 change: 1 addition & 0 deletions build/pkgs/python_json_logger/trees.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
JUPYTER_VENV
1 change: 1 addition & 0 deletions build/pkgs/pyyaml/trees.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
JUPYTER_VENV
1 change: 1 addition & 0 deletions build/pkgs/referencing/trees.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
JUPYTER_VENV
1 change: 1 addition & 0 deletions build/pkgs/rfc3339_validator/trees.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
JUPYTER_VENV
1 change: 1 addition & 0 deletions build/pkgs/rfc3986_validator/trees.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
JUPYTER_VENV
1 change: 1 addition & 0 deletions build/pkgs/sagenb_export/trees.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
JUPYTER_VENV
1 change: 1 addition & 0 deletions build/pkgs/send2trash/trees.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
JUPYTER_VENV
1 change: 1 addition & 0 deletions build/pkgs/sniffio/trees.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
JUPYTER_VENV
1 change: 1 addition & 0 deletions build/pkgs/soupsieve/trees.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
JUPYTER_VENV
1 change: 1 addition & 0 deletions build/pkgs/terminado/trees.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
JUPYTER_VENV
1 change: 1 addition & 0 deletions build/pkgs/tinycss2/trees.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
JUPYTER_VENV
1 change: 1 addition & 0 deletions build/pkgs/types_python_dateutil/trees.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
JUPYTER_VENV
1 change: 1 addition & 0 deletions build/pkgs/uri_template/trees.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
JUPYTER_VENV
1 change: 1 addition & 0 deletions build/pkgs/webcolors/trees.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
JUPYTER_VENV
1 change: 1 addition & 0 deletions build/pkgs/webencodings/trees.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
JUPYTER_VENV
1 change: 1 addition & 0 deletions build/pkgs/websocket_client/trees.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
JUPYTER_VENV
18 changes: 18 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,12 @@ AC_ARG_WITH([sage-venv],
[SAGE_VENV="auto"])
AC_SUBST([SAGE_VENV])

AC_ARG_WITH([jupyter-venv],
[AS_HELP_STRING([--with-jupyter-venv={yes,no (default),JUPYTER_VENV}],
[put Jupyter frontend packages into an installation hierarchy separate from sage-venv])],
[JUPYTER_VENV="$withval"],
[JUPYTER_VENV="no"])

AC_SUBST([SAGE_DOCS], ['${SAGE_LOCAL}'])dnl Quoted so that it is resolved at build time by shell/Makefile

#---------------------------------------------------------
Expand Down Expand Up @@ -506,6 +512,9 @@ AC_ARG_ENABLE([cvxopt],
AC_ARG_ENABLE([notebook],
AS_HELP_STRING([--disable-notebook],
[disable build of the Jupyter notebook and related packages]), [
AS_VAR_IF([enableval], [no], [dnl Disable by disabling the install tree for jupyter frontend packages
AS_VAR_SET([JUPYTER_VENV], [])dnl
])
for pkg in notebook nbconvert beautifulsoup4 sagenb_export nbformat nbclient terminado send2trash prometheus_client mistune pandocfilters bleach defusedxml jsonschema jupyter_jsmol argon2_cffi argon2_cffi_bindings webencodings tinycss2 ipympl soupsieve fastjsonschema anyio arrow async_lru fqdn isoduration json5 jsonpointer jsonschema_specifications jupyter_events jupyter_lsp jupyter_server jupyter_server_terminals jupyterlab jupyterlab_mathjax2 notebook_shim overrides python_json_logger pyyaml referencing rfc3339_validator rfc3986_validator sniffio types_python_dateutil uri_template webcolors websocket_client; do
AS_VAR_SET([SAGE_ENABLE_$pkg], [$enableval])
done
Expand Down Expand Up @@ -619,9 +628,18 @@ AC_CONFIG_COMMANDS(links, [
], [
AC_MSG_NOTICE([cannot create convenience symlink $SYMLINK -> $SAGE_VENV because the file exists and is not a symlink; this is harmless])
])
SYMLINK="${ac_top_build_prefix}jupyter-venv"
AS_IF([test -L "$SYMLINK" -o ! -e "$SYMLINK"], [
AC_MSG_NOTICE([creating convenience symlink $SYMLINK -> $JUPYTER_VENV])
rm -f "$SYMLINK"
ln -sf "$JUPYTER_VENV" "$SYMLINK"
], [
AC_MSG_NOTICE([cannot create convenience symlink $SYMLINK -> $JUPYTER_VENV because the file exists and is not a symlink; this is harmless])
])
], [
SAGE_LOCAL="$SAGE_LOCAL"
eval SAGE_VENV="$SAGE_VENV"dnl eval so as to evaluate the embedded ${SAGE_LOCAL}
eval JUPYTER_VENV="$JUPYTER_VENV"dnl
])

AC_OUTPUT()
Expand Down
25 changes: 24 additions & 1 deletion src/doc/bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,31 @@ equivalent system packages.

EOF
for PKG_BASE in $(sage-package list --has-file SPKG.rst :standard: | grep -v '^sagemath_'); do
echo "* :ref:\`spkg_$PKG_BASE\`"
PKG_SCRIPTS=build/pkgs/$PKG_BASE
case $(cat $PKG_SCRIPTS/trees.txt 2>/dev/null) in
JUPYTER_VENV) ;;
*) echo "* :ref:\`spkg_$PKG_BASE\`";;
esac
done >> "$OUTPUT_INDEX"
cat >> "$OUTPUT_INDEX" <<EOF

Standard Packages (Jupyter Frontend)
------------------------------------

The Sage distribution includes the Jupyter Notebook and JupyterLab.
It installs them automatically if it does not find
equivalent system packages, unless ``./configure --disable-notebook``
is used.

EOF

for PKG_BASE in $(sage-package list --has-file SPKG.rst :standard: | grep -v '^sagemath_'); do
PKG_SCRIPTS=build/pkgs/$PKG_BASE
case $(cat $PKG_SCRIPTS/trees.txt 2>/dev/null) in
JUPYTER_VENV) echo "* :ref:\`spkg_$PKG_BASE\`";;
esac
done >> "$OUTPUT_INDEX"

cat >> "$OUTPUT_INDEX" <<EOF

Optional Packages
Expand Down