From 0965056b6ce2e56287530e8b90eae99584589943 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 27 Jul 2024 15:50:55 -0700 Subject: [PATCH 01/51] pkgs/sagemath-doc-html: New; build/pkgs/sagemath_doc_html/bootstrap: Move here from src/doc --- .ci/write-dockerfile.sh | 1 - .gitignore | 1 + Makefile | 2 +- build/pkgs/sagemath_doc_html/bootstrap | 185 +++++++++++++++++- build/pkgs/sagemath_doc_html/bootstrap_m4 | 1 + build/pkgs/sagemath_doc_html/spkg-install | 23 ++- build/pkgs/sagemath_doc_html/spkg-src | 24 +++ build/pkgs/sagemath_doc_html/src | 2 +- pkgs/sage-conf_conda/MANIFEST.in | 1 - .../sage_root/src/doc/bootstrap | 3 - pkgs/sagemath-doc-html/MANIFEST.in | 4 + pkgs/sagemath-doc-html/README.rst | 29 +++ pkgs/sagemath-doc-html/VERSION.txt | 1 + pkgs/sagemath-doc-html/doc | 1 + pkgs/sagemath-doc-html/pyproject.toml.m4 | 30 +++ pkgs/sagemath-doc-html/setup.py | 7 + src/doc/bootstrap | 182 ----------------- src/doc/en/developer/portability_testing.rst | 3 +- 18 files changed, 305 insertions(+), 195 deletions(-) mode change 120000 => 100755 build/pkgs/sagemath_doc_html/bootstrap create mode 120000 build/pkgs/sagemath_doc_html/bootstrap_m4 create mode 100755 build/pkgs/sagemath_doc_html/spkg-src delete mode 100755 pkgs/sage-conf_pypi/sage_root/src/doc/bootstrap create mode 100644 pkgs/sagemath-doc-html/MANIFEST.in create mode 100644 pkgs/sagemath-doc-html/README.rst create mode 100644 pkgs/sagemath-doc-html/VERSION.txt create mode 120000 pkgs/sagemath-doc-html/doc create mode 100644 pkgs/sagemath-doc-html/pyproject.toml.m4 create mode 100644 pkgs/sagemath-doc-html/setup.py delete mode 100755 src/doc/bootstrap diff --git a/.ci/write-dockerfile.sh b/.ci/write-dockerfile.sh index 75737acf106..e0968eef985 100755 --- a/.ci/write-dockerfile.sh +++ b/.ci/write-dockerfile.sh @@ -277,7 +277,6 @@ FROM with-system-packages AS bootstrapped RUN rm -rf /new /sage/.git $ADD Makefile VERSION.txt COPYING.txt condarc.yml README.md bootstrap bootstrap-conda configure.ac sage .homebrew-build-env tox.ini Pipfile.m4 .gitignore /new/ $ADD config/config.rpath /new/config/config.rpath -$ADD src/doc/bootstrap /new/src/doc/bootstrap $ADD src/bin /new/src/bin $ADD src/Pipfile.m4 src/pyproject.toml src/requirements.txt.m4 src/setup.cfg.m4 src/VERSION.txt /new/src/ $ADD m4 /new/m4 diff --git a/.gitignore b/.gitignore index 70a6739c33b..2d1978da1b3 100644 --- a/.gitignore +++ b/.gitignore @@ -235,6 +235,7 @@ build/pkgs/wheel/version_requirements.txt /pkgs/sagemath-sirocco/pyproject.toml /pkgs/sagemath-tdlib/pyproject.toml /pkgs/sagemath-categories/pyproject.toml +/pkgs/sagemath-doc-*/pyproject.toml /pkgs/sagemath-environment/pyproject.toml /pkgs/sagemath-repl/pyproject.toml /pkgs/sagemath-objects/requirements*.txt diff --git a/Makefile b/Makefile index 53d2c689843..1443d8be836 100644 --- a/Makefile +++ b/Makefile @@ -366,7 +366,7 @@ SPKG_INFO_DEPENDENCIES = \ build/pkgs/*/version_requirements.txt build/pkgs/*/package-version.txt \ build/pkgs/*/distros/*.txt -configure: bootstrap src/doc/bootstrap $(CONFIGURE_DEPENDENCIES) $(SPKG_INFO_DEPENDENCIES) +configure: bootstrap $(CONFIGURE_DEPENDENCIES) $(SPKG_INFO_DEPENDENCIES) ./bootstrap -d install: all diff --git a/build/pkgs/sagemath_doc_html/bootstrap b/build/pkgs/sagemath_doc_html/bootstrap deleted file mode 120000 index 8dfc4b56a30..00000000000 --- a/build/pkgs/sagemath_doc_html/bootstrap +++ /dev/null @@ -1 +0,0 @@ -src/bootstrap \ No newline at end of file diff --git a/build/pkgs/sagemath_doc_html/bootstrap b/build/pkgs/sagemath_doc_html/bootstrap new file mode 100755 index 00000000000..688d6e5d858 --- /dev/null +++ b/build/pkgs/sagemath_doc_html/bootstrap @@ -0,0 +1,184 @@ +#!/usr/bin/env bash + +######################################################################## +# Regenerate auto-generated files, using information in SAGE_ROOT/build/ +# +# This script is run by SAGE_ROOT/bootstrap as part of the bootstrapping phase +# (before configure, before creating source distributions). +# +# The BOOTSTRAP_QUIET variable is set by the top-level +# bootstrap script and controls how verbose we are. +######################################################################## + +set -e + +if [ -z "$SAGE_ROOT" ]; then + echo Please run the top-level bootstrap script of the Sage distribution. + exit 1 +fi + +./bootstrap_m4 + +cd "$SAGE_ROOT" + +OUTPUT_DIR="src/doc/en/installation" +mkdir -p "$OUTPUT_DIR" + +shopt -s extglob + +RECOMMENDED_SPKG_PATTERN="@(_recommended$(for a in $(head -n 1 build/pkgs/_recommended/dependencies); do echo -n "|"$a; done))" +DEVELOP_SPKG_PATTERN="@(_develop$(for a in $(head -n 1 build/pkgs/_develop/dependencies); do echo -n "|"$a; done))" + +for SYSTEM in arch debian fedora homebrew opensuse void; do + SYSTEM_PACKAGES= + OPTIONAL_SYSTEM_PACKAGES= + SAGELIB_SYSTEM_PACKAGES= + SAGELIB_OPTIONAL_SYSTEM_PACKAGES= + RECOMMENDED_SYSTEM_PACKAGES= + DEVELOP_SYSTEM_PACKAGES= + for PKG_BASE in $(sage-package list --has-file distros/$SYSTEM.txt); do + PKG_SCRIPTS=build/pkgs/$PKG_BASE + PKG_TYPE=$(cat $PKG_SCRIPTS/type) + PKG_SYSTEM_PACKAGES=$(sage-get-system-packages $SYSTEM $PKG_BASE) + if [ -n "PKG_SYSTEM_PACKAGES" ]; then + if [ -f $PKG_SCRIPTS/spkg-configure.m4 ]; then + case "$PKG_BASE:$PKG_TYPE" in + *:standard) + SYSTEM_PACKAGES+=" $PKG_SYSTEM_PACKAGES" + ;; + $DEVELOP_SPKG_PATTERN:*) + DEVELOP_SYSTEM_PACKAGES+=" $PKG_SYSTEM_PACKAGES" + ;; + $RECOMMENDED_SPKG_PATTERN:*) + RECOMMENDED_SYSTEM_PACKAGES+=" $PKG_SYSTEM_PACKAGES" + ;; + *) + OPTIONAL_SYSTEM_PACKAGES+=" $PKG_SYSTEM_PACKAGES" + ;; + esac + else + case "$PKG_BASE:$PKG_TYPE" in + $DEVELOP_SPKG_PATTERN:*) + DEVELOP_SYSTEM_PACKAGES+=" $PKG_SYSTEM_PACKAGES" + ;; + *:standard) + SAGELIB_SYSTEM_PACKAGES+=" $PKG_SYSTEM_PACKAGES" + ;; + *) + SAGELIB_OPTIONAL_SYSTEM_PACKAGES+=" $PKG_SYSTEM_PACKAGES" + ;; + esac + fi + fi + done + + if [ "${BOOTSTRAP_QUIET}" = "no" ]; then + echo >&2 $0:$LINENO: installing "$OUTPUT_DIR"/$SYSTEM"*.txt" + fi + echo "$(sage-print-system-package-command $SYSTEM --prompt --wrap --sudo install $(echo $(echo $SYSTEM_PACKAGES | xargs -n 1 echo | sort | uniq)))" > "$OUTPUT_DIR"/$SYSTEM.txt + echo "$(sage-print-system-package-command $SYSTEM --prompt --wrap --sudo install $(echo $(echo $OPTIONAL_SYSTEM_PACKAGES | xargs -n 1 echo | sort | uniq)))" > "$OUTPUT_DIR"/$SYSTEM-optional.txt + echo "$(sage-print-system-package-command $SYSTEM --prompt --wrap --sudo install $(echo $(echo $RECOMMENDED_SYSTEM_PACKAGES | xargs -n 1 echo | sort | uniq)))" > "$OUTPUT_DIR"/$SYSTEM-recommended.txt + echo "$(sage-print-system-package-command $SYSTEM --prompt --wrap --sudo install $(echo $(echo $DEVELOP_SYSTEM_PACKAGES | xargs -n 1 echo | sort | uniq)))" > "$OUTPUT_DIR"/$SYSTEM-develop.txt +done + +OUTPUT_DIR="src/doc/en/reference/spkg" +mkdir -p "$OUTPUT_DIR" +if [ "${BOOTSTRAP_QUIET}" = "no" ]; then + echo >&2 $0:$LINENO: installing "$OUTPUT_DIR"/"*.rst" +fi +(cat < "$OUTPUT_DIR"/index_standard.rst +(cat < "$OUTPUT_DIR"/index_optional.rst +for PKG_BASE in $(sage-package list --has-file SPKG.rst | grep '^sagemath_'); do + echo "* :ref:\`spkg_$PKG_BASE\`" +done > "$OUTPUT_DIR"/index_sagemath.rst +(cat < "$OUTPUT_DIR"/index_experimental.rst +(cat < "$OUTPUT_DIR"/index_alph.rst +sage-package list --has-file SPKG.rst | OUTPUT_DIR=$OUTPUT_DIR OUTPUT_RST=1 xargs -P 99 -n 1 sage-spkg-info diff --git a/build/pkgs/sagemath_doc_html/bootstrap_m4 b/build/pkgs/sagemath_doc_html/bootstrap_m4 new file mode 120000 index 00000000000..40542346a4e --- /dev/null +++ b/build/pkgs/sagemath_doc_html/bootstrap_m4 @@ -0,0 +1 @@ +../sagelib/bootstrap \ No newline at end of file diff --git a/build/pkgs/sagemath_doc_html/spkg-install b/build/pkgs/sagemath_doc_html/spkg-install index 801aa7769fe..cce58b40e22 100755 --- a/build/pkgs/sagemath_doc_html/spkg-install +++ b/build/pkgs/sagemath_doc_html/spkg-install @@ -1,3 +1,20 @@ -#! /usr/bin/env bash -cd $SAGE_ROOT/src/doc -$MAKE doc-html +#!/usr/bin/env bash +# From sage-spkg. +# For type=script packages, the build rule in build/make/Makefile sources +# sage-env but not sage-dist-helpers. +lib="$SAGE_ROOT/build/bin/sage-dist-helpers" +source "$lib" +if [ $? -ne 0 ]; then + echo >&2 "Error: failed to source $lib" + echo >&2 "Is $SAGE_ROOT the correct SAGE_ROOT?" + exit 1 +fi +cd src +if [ "$SAGE_EDITABLE" = yes ]; then + sdh_pip_editable_install . + if [ "$SAGE_WHEELS" = yes ]; then + sdh_setup_bdist_wheel && sdh_store_wheel . + fi +else + sdh_pip_install . +fi diff --git a/build/pkgs/sagemath_doc_html/spkg-src b/build/pkgs/sagemath_doc_html/spkg-src new file mode 100755 index 00000000000..9e824839cbf --- /dev/null +++ b/build/pkgs/sagemath_doc_html/spkg-src @@ -0,0 +1,24 @@ +#!/usr/bin/env bash +# +# Script to prepare an sdist tarball for sagemath_doc_html +# This script is not used during build. +# +# HOW TO MAKE THE TARBALL: +# ./sage --sh build/pkgs/sagemath_doc_html/spkg-src + +if [ -z "$SAGE_ROOT" ] ; then + echo >&2 "Error - SAGE_ROOT undefined ... exiting" + echo >&2 "Maybe run 'sage -sh'?" + exit 1 +fi + +# Exit on failure +set -e + +cd build/pkgs/sagemath_doc_html + +cd src +# Get rid of old *.egg-info/SOURCES.txt +rm -Rf *.egg-info + +python3 -m build --sdist --no-isolation --skip-dependency-check --outdir "$SAGE_DISTFILES" diff --git a/build/pkgs/sagemath_doc_html/src b/build/pkgs/sagemath_doc_html/src index 95e24c1b7a5..545a86211ab 120000 --- a/build/pkgs/sagemath_doc_html/src +++ b/build/pkgs/sagemath_doc_html/src @@ -1 +1 @@ -../../../src/doc \ No newline at end of file +../../../pkgs/sagemath-doc-html \ No newline at end of file diff --git a/pkgs/sage-conf_conda/MANIFEST.in b/pkgs/sage-conf_conda/MANIFEST.in index ea5f85f8c99..e8c6d841083 100644 --- a/pkgs/sage-conf_conda/MANIFEST.in +++ b/pkgs/sage-conf_conda/MANIFEST.in @@ -41,7 +41,6 @@ include sage_root/src/bin/sage-env-config.in include sage_root/src/bin/sage-src-env-config.in include sage_root/src/bin/sage-venv-config include sage_root/src/bin/sage-version.sh -include sage_root/src/doc/bootstrap # FIXME: should move to builds/pkgs/sagemath_doc_html/ global-exclude .tox global-exclude *~* diff --git a/pkgs/sage-conf_pypi/sage_root/src/doc/bootstrap b/pkgs/sage-conf_pypi/sage_root/src/doc/bootstrap deleted file mode 100755 index 2a2bb398b9a..00000000000 --- a/pkgs/sage-conf_pypi/sage_root/src/doc/bootstrap +++ /dev/null @@ -1,3 +0,0 @@ -#! /usr/bin/env bash -# This version of the src/doc/bootstrap script does nothing. -exit 0 diff --git a/pkgs/sagemath-doc-html/MANIFEST.in b/pkgs/sagemath-doc-html/MANIFEST.in new file mode 100644 index 00000000000..a04bbc3b77e --- /dev/null +++ b/pkgs/sagemath-doc-html/MANIFEST.in @@ -0,0 +1,4 @@ +graft doc +# Exclude what is removed by 'make clean' in doc/Makefile +prune doc/en/reference/sage +prune doc/en/reference/*/sage diff --git a/pkgs/sagemath-doc-html/README.rst b/pkgs/sagemath-doc-html/README.rst new file mode 100644 index 00000000000..1117fc4a5a8 --- /dev/null +++ b/pkgs/sagemath-doc-html/README.rst @@ -0,0 +1,29 @@ +====================================================================== + Sage: Open Source Mathematics Software: Documentation in HTML format +====================================================================== + +About SageMath +-------------- + + "Creating a Viable Open Source Alternative to + Magma, Maple, Mathematica, and MATLAB" + + Copyright (C) 2005-2023 The Sage Development Team + + https://www.sagemath.org + +SageMath fully supports all major Linux distributions, recent versions of +macOS, and Windows (using Cygwin or Windows Subsystem for Linux). + +The traditional and recommended way to install SageMath is from source via +Sage-the-distribution (https://www.sagemath.org/download-source.html). +Sage-the-distribution first builds a large number of open source packages from +source (unless it finds suitable versions installed in the system) and then +installs the Sage Library (sagelib, implemented in Python and Cython). + + +About this pip-installable source distribution +---------------------------------------------- + +When installed from source, the distribution `sagemath-doc-html` uses Sphinx +to build the SageMath documentation in HTML format. diff --git a/pkgs/sagemath-doc-html/VERSION.txt b/pkgs/sagemath-doc-html/VERSION.txt new file mode 100644 index 00000000000..47b62e8563a --- /dev/null +++ b/pkgs/sagemath-doc-html/VERSION.txt @@ -0,0 +1 @@ +10.2.rc3 diff --git a/pkgs/sagemath-doc-html/doc b/pkgs/sagemath-doc-html/doc new file mode 120000 index 00000000000..b14ab9a4284 --- /dev/null +++ b/pkgs/sagemath-doc-html/doc @@ -0,0 +1 @@ +../../src/doc \ No newline at end of file diff --git a/pkgs/sagemath-doc-html/pyproject.toml.m4 b/pkgs/sagemath-doc-html/pyproject.toml.m4 new file mode 100644 index 00000000000..f91c350d12b --- /dev/null +++ b/pkgs/sagemath-doc-html/pyproject.toml.m4 @@ -0,0 +1,30 @@ +include(`sage_spkg_versions_toml.m4')dnl' -*- conf-toml -*- +[build-system] +# Minimum requirements for the build system to execute. +requires = [ + SPKG_INSTALL_REQUIRES_setuptools_wheel + SPKG_INSTALL_REQUIRES_sage_docbuild + SPKG_INSTALL_REQUIRES_sphinx + SPKG_INSTALL_REQUIRES_sphinx_copybutton + SPKG_INSTALL_REQUIRES_furo + SPKG_INSTALL_REQUIRES_jupyter_sphinx + SPKG_INSTALL_REQUIRES_sagelib +] +build-backend = "setuptools.build_meta" + +[project] +name = "sagemath-doc-html" +description = "Sage: Open Source Mathematics Software: Documentation in HTML format" +dependencies = [] +dynamic = ["version"] +include(`pyproject_toml_metadata.m4')dnl' + +[project.readme] +file = "README.rst" +content-type = "text/x-rst" + +[tool.setuptools] +include-package-data = false + +[tool.setuptools.dynamic] +version = {file = ["VERSION.txt"]} diff --git a/pkgs/sagemath-doc-html/setup.py b/pkgs/sagemath-doc-html/setup.py new file mode 100644 index 00000000000..bd359feacc9 --- /dev/null +++ b/pkgs/sagemath-doc-html/setup.py @@ -0,0 +1,7 @@ +from setuptools import setup + + +#$MAKE doc-html + + +setup() diff --git a/src/doc/bootstrap b/src/doc/bootstrap deleted file mode 100755 index e99ecd52c28..00000000000 --- a/src/doc/bootstrap +++ /dev/null @@ -1,182 +0,0 @@ -#!/usr/bin/env bash - -######################################################################## -# Regenerate auto-generated files, using information in SAGE_ROOT/build/ -# -# This script is run by SAGE_ROOT/bootstrap as part of the bootstrapping phase -# (before configure, before creating source distributions). -# -# The BOOTSTRAP_QUIET variable is set by the top-level -# bootstrap script and controls how verbose we are. -######################################################################## - -set -e - -if [ -z "$SAGE_ROOT" ]; then - echo Please run the top-level bootstrap script of the Sage distribution. - exit 1 -fi - -cd "$SAGE_ROOT" - -OUTPUT_DIR="src/doc/en/installation" -mkdir -p "$OUTPUT_DIR" - -shopt -s extglob - -RECOMMENDED_SPKG_PATTERN="@(_recommended$(for a in $(head -n 1 build/pkgs/_recommended/dependencies); do echo -n "|"$a; done))" -DEVELOP_SPKG_PATTERN="@(_develop$(for a in $(head -n 1 build/pkgs/_develop/dependencies); do echo -n "|"$a; done))" - -for SYSTEM in arch debian fedora homebrew opensuse void; do - SYSTEM_PACKAGES= - OPTIONAL_SYSTEM_PACKAGES= - SAGELIB_SYSTEM_PACKAGES= - SAGELIB_OPTIONAL_SYSTEM_PACKAGES= - RECOMMENDED_SYSTEM_PACKAGES= - DEVELOP_SYSTEM_PACKAGES= - for PKG_BASE in $(sage-package list --has-file distros/$SYSTEM.txt); do - PKG_SCRIPTS=build/pkgs/$PKG_BASE - PKG_TYPE=$(cat $PKG_SCRIPTS/type) - PKG_SYSTEM_PACKAGES=$(sage-get-system-packages $SYSTEM $PKG_BASE) - if [ -n "PKG_SYSTEM_PACKAGES" ]; then - if [ -f $PKG_SCRIPTS/spkg-configure.m4 ]; then - case "$PKG_BASE:$PKG_TYPE" in - *:standard) - SYSTEM_PACKAGES+=" $PKG_SYSTEM_PACKAGES" - ;; - $DEVELOP_SPKG_PATTERN:*) - DEVELOP_SYSTEM_PACKAGES+=" $PKG_SYSTEM_PACKAGES" - ;; - $RECOMMENDED_SPKG_PATTERN:*) - RECOMMENDED_SYSTEM_PACKAGES+=" $PKG_SYSTEM_PACKAGES" - ;; - *) - OPTIONAL_SYSTEM_PACKAGES+=" $PKG_SYSTEM_PACKAGES" - ;; - esac - else - case "$PKG_BASE:$PKG_TYPE" in - $DEVELOP_SPKG_PATTERN:*) - DEVELOP_SYSTEM_PACKAGES+=" $PKG_SYSTEM_PACKAGES" - ;; - *:standard) - SAGELIB_SYSTEM_PACKAGES+=" $PKG_SYSTEM_PACKAGES" - ;; - *) - SAGELIB_OPTIONAL_SYSTEM_PACKAGES+=" $PKG_SYSTEM_PACKAGES" - ;; - esac - fi - fi - done - - if [ "${BOOTSTRAP_QUIET}" = "no" ]; then - echo >&2 $0:$LINENO: installing "$OUTPUT_DIR"/$SYSTEM"*.txt" - fi - echo "$(sage-print-system-package-command $SYSTEM --prompt --wrap --sudo install $(echo $(echo $SYSTEM_PACKAGES | xargs -n 1 echo | sort | uniq)))" > "$OUTPUT_DIR"/$SYSTEM.txt - echo "$(sage-print-system-package-command $SYSTEM --prompt --wrap --sudo install $(echo $(echo $OPTIONAL_SYSTEM_PACKAGES | xargs -n 1 echo | sort | uniq)))" > "$OUTPUT_DIR"/$SYSTEM-optional.txt - echo "$(sage-print-system-package-command $SYSTEM --prompt --wrap --sudo install $(echo $(echo $RECOMMENDED_SYSTEM_PACKAGES | xargs -n 1 echo | sort | uniq)))" > "$OUTPUT_DIR"/$SYSTEM-recommended.txt - echo "$(sage-print-system-package-command $SYSTEM --prompt --wrap --sudo install $(echo $(echo $DEVELOP_SYSTEM_PACKAGES | xargs -n 1 echo | sort | uniq)))" > "$OUTPUT_DIR"/$SYSTEM-develop.txt -done - -OUTPUT_DIR="src/doc/en/reference/spkg" -mkdir -p "$OUTPUT_DIR" -if [ "${BOOTSTRAP_QUIET}" = "no" ]; then - echo >&2 $0:$LINENO: installing "$OUTPUT_DIR"/"*.rst" -fi -(cat < "$OUTPUT_DIR"/index_standard.rst -(cat < "$OUTPUT_DIR"/index_optional.rst -for PKG_BASE in $(sage-package list --has-file SPKG.rst | grep '^sagemath_'); do - echo "* :ref:\`spkg_$PKG_BASE\`" -done > "$OUTPUT_DIR"/index_sagemath.rst -(cat < "$OUTPUT_DIR"/index_experimental.rst -(cat < "$OUTPUT_DIR"/index_alph.rst -sage-package list --has-file SPKG.rst | OUTPUT_DIR=$OUTPUT_DIR OUTPUT_RST=1 xargs -P 99 -n 1 sage-spkg-info diff --git a/src/doc/en/developer/portability_testing.rst b/src/doc/en/developer/portability_testing.rst index 55cefd0bf60..76a5c94eb2a 100644 --- a/src/doc/en/developer/portability_testing.rst +++ b/src/doc/en/developer/portability_testing.rst @@ -383,7 +383,6 @@ Then, to bootstrap and configure...:: RUN mkdir -p /sage WORKDIR /sage ADD Makefile VERSION.txt README.md bootstrap configure.ac sage ./ - ADD src/doc/bootstrap src/doc/bootstrap ADD m4 ./m4 ADD build ./build RUN ./bootstrap @@ -769,7 +768,7 @@ positional arguments (separated from tox options by ``--``):: local-direct create: /Users/mkoeppe/.../worktree-local/.tox/local-direct local-direct run-test-pre: PYTHONHASHSEED='2211987514' ... - src/doc/bootstrap:48: installing src/doc/en/installation/debian.txt... + bootstrap:48: installing src/doc/en/installation/debian.txt... bootstrap:69: installing 'config/config.rpath' configure.ac:328: installing 'config/compile' configure.ac:113: installing 'config/config.guess' From baa363cbd38e7f205cc0e6bdfff91fddaa78eed6 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Mon, 21 Oct 2024 18:48:58 -0700 Subject: [PATCH 02/51] pkgs/sagemath-doc-html: Use meson-python --- build/pkgs/sagemath_doc_html/dependencies | 2 +- build/pkgs/sagemath_doc_html/install-requires.txt | 1 + build/pkgs/sagemath_doc_html/spkg-install | 11 +++-------- pkgs/sagemath-doc-html/MANIFEST.in | 4 ---- pkgs/sagemath-doc-html/meson.build | 13 +++++++++++++ pkgs/sagemath-doc-html/pyproject.toml.m4 | 13 ++++--------- pkgs/sagemath-doc-html/setup.py | 7 ------- 7 files changed, 22 insertions(+), 29 deletions(-) create mode 100644 build/pkgs/sagemath_doc_html/install-requires.txt delete mode 100644 pkgs/sagemath-doc-html/MANIFEST.in create mode 100644 pkgs/sagemath-doc-html/meson.build delete mode 100644 pkgs/sagemath-doc-html/setup.py diff --git a/build/pkgs/sagemath_doc_html/dependencies b/build/pkgs/sagemath_doc_html/dependencies index 40717629a77..9b152880d97 100644 --- a/build/pkgs/sagemath_doc_html/dependencies +++ b/build/pkgs/sagemath_doc_html/dependencies @@ -1,4 +1,4 @@ -sagelib sphinx sphinx_copybutton sphinx_inline_tabs pplpy_doc | $(SAGERUNTIME) maxima networkx scipy sympy matplotlib pillow mathjax mpmath ipykernel jupyter_client conway_polynomials tachyon ipywidgets sage_docbuild elliptic_curves furo fpylll graphs +sagelib sphinx sphinx_copybutton sphinx_inline_tabs pplpy_doc | $(SAGERUNTIME) maxima networkx scipy sympy matplotlib pillow mathjax mpmath ipykernel jupyter_client conway_polynomials tachyon ipywidgets sage_docbuild elliptic_curves furo fpylll graphs meson_python # Building the documentation has many dependencies, because all # documented modules are imported and because we use matplotlib to diff --git a/build/pkgs/sagemath_doc_html/install-requires.txt b/build/pkgs/sagemath_doc_html/install-requires.txt new file mode 100644 index 00000000000..ca22dbf2936 --- /dev/null +++ b/build/pkgs/sagemath_doc_html/install-requires.txt @@ -0,0 +1 @@ +sagemath-doc-html diff --git a/build/pkgs/sagemath_doc_html/spkg-install b/build/pkgs/sagemath_doc_html/spkg-install index cce58b40e22..e649a86f15f 100755 --- a/build/pkgs/sagemath_doc_html/spkg-install +++ b/build/pkgs/sagemath_doc_html/spkg-install @@ -10,11 +10,6 @@ if [ $? -ne 0 ]; then exit 1 fi cd src -if [ "$SAGE_EDITABLE" = yes ]; then - sdh_pip_editable_install . - if [ "$SAGE_WHEELS" = yes ]; then - sdh_setup_bdist_wheel && sdh_store_wheel . - fi -else - sdh_pip_install . -fi +# Needed because of trees.txt directs us to $SAGE_LOCAL/... +export PIP_FIND_LINKS=$SAGE_VENV/var/lib/sage/wheels +python3 -m pip install --verbose --no-index --no-build-isolation --config-settings=editable-verbose=true --config-settings=compile-args="-j12" --config-settings=compile-args="--verbose" --editable . || sdh_die "Error installing $PKG_NAME" diff --git a/pkgs/sagemath-doc-html/MANIFEST.in b/pkgs/sagemath-doc-html/MANIFEST.in deleted file mode 100644 index a04bbc3b77e..00000000000 --- a/pkgs/sagemath-doc-html/MANIFEST.in +++ /dev/null @@ -1,4 +0,0 @@ -graft doc -# Exclude what is removed by 'make clean' in doc/Makefile -prune doc/en/reference/sage -prune doc/en/reference/*/sage diff --git a/pkgs/sagemath-doc-html/meson.build b/pkgs/sagemath-doc-html/meson.build new file mode 100644 index 00000000000..6edf18d157d --- /dev/null +++ b/pkgs/sagemath-doc-html/meson.build @@ -0,0 +1,13 @@ +project('sagemath-doc-html', + version: '10.2' +) + +py = import('python').find_installation(pure: true) + +html = custom_target('HTML documentation', + output: 'html', + command: ['env', 'SAGE_DOC=' + meson.current_build_dir(), + 'make', '-j20', '-C', join_paths(meson.current_source_dir(), 'doc'), 'doc-html'], + install: true, + install_dir: join_paths('share', 'doc', 'sage') +) diff --git a/pkgs/sagemath-doc-html/pyproject.toml.m4 b/pkgs/sagemath-doc-html/pyproject.toml.m4 index f91c350d12b..d0bc6870a3a 100644 --- a/pkgs/sagemath-doc-html/pyproject.toml.m4 +++ b/pkgs/sagemath-doc-html/pyproject.toml.m4 @@ -2,7 +2,7 @@ include(`sage_spkg_versions_toml.m4')dnl' -*- conf-toml -*- [build-system] # Minimum requirements for the build system to execute. requires = [ - SPKG_INSTALL_REQUIRES_setuptools_wheel + SPKG_INSTALL_REQUIRES_meson_python SPKG_INSTALL_REQUIRES_sage_docbuild SPKG_INSTALL_REQUIRES_sphinx SPKG_INSTALL_REQUIRES_sphinx_copybutton @@ -10,21 +10,16 @@ requires = [ SPKG_INSTALL_REQUIRES_jupyter_sphinx SPKG_INSTALL_REQUIRES_sagelib ] -build-backend = "setuptools.build_meta" +build-backend = 'mesonpy' [project] name = "sagemath-doc-html" +version = "10.2" description = "Sage: Open Source Mathematics Software: Documentation in HTML format" dependencies = [] -dynamic = ["version"] + include(`pyproject_toml_metadata.m4')dnl' [project.readme] file = "README.rst" content-type = "text/x-rst" - -[tool.setuptools] -include-package-data = false - -[tool.setuptools.dynamic] -version = {file = ["VERSION.txt"]} diff --git a/pkgs/sagemath-doc-html/setup.py b/pkgs/sagemath-doc-html/setup.py deleted file mode 100644 index bd359feacc9..00000000000 --- a/pkgs/sagemath-doc-html/setup.py +++ /dev/null @@ -1,7 +0,0 @@ -from setuptools import setup - - -#$MAKE doc-html - - -setup() From 1837273b7f74c5f31e92946683700aecd06cec3f Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Fri, 17 Nov 2023 13:09:31 -0800 Subject: [PATCH 03/51] Install via wheel --- build/pkgs/sagemath_doc_html/spkg-install | 4 ++-- pkgs/sagemath-doc-html/meson.build | 9 ++++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/build/pkgs/sagemath_doc_html/spkg-install b/build/pkgs/sagemath_doc_html/spkg-install index e649a86f15f..dfa3b02d2d9 100755 --- a/build/pkgs/sagemath_doc_html/spkg-install +++ b/build/pkgs/sagemath_doc_html/spkg-install @@ -10,6 +10,6 @@ if [ $? -ne 0 ]; then exit 1 fi cd src -# Needed because of trees.txt directs us to $SAGE_LOCAL/... +# Needed because we have trees.txt, which directs us to $SAGE_LOCAL/... export PIP_FIND_LINKS=$SAGE_VENV/var/lib/sage/wheels -python3 -m pip install --verbose --no-index --no-build-isolation --config-settings=editable-verbose=true --config-settings=compile-args="-j12" --config-settings=compile-args="--verbose" --editable . || sdh_die "Error installing $PKG_NAME" +sdh_pip_install --no-build-isolation . diff --git a/pkgs/sagemath-doc-html/meson.build b/pkgs/sagemath-doc-html/meson.build index 6edf18d157d..13b7a8f1831 100644 --- a/pkgs/sagemath-doc-html/meson.build +++ b/pkgs/sagemath-doc-html/meson.build @@ -2,12 +2,15 @@ project('sagemath-doc-html', version: '10.2' ) -py = import('python').find_installation(pure: true) +docdir = get_option('datadir') / 'share' / 'doc' / 'sage' html = custom_target('HTML documentation', - output: 'html', + output: 'index.html', command: ['env', 'SAGE_DOC=' + meson.current_build_dir(), 'make', '-j20', '-C', join_paths(meson.current_source_dir(), 'doc'), 'doc-html'], install: true, - install_dir: join_paths('share', 'doc', 'sage') + install_dir: docdir ) + +install_subdir(meson.current_build_dir() / 'html', + install_dir: docdir) From 000a31ec18b54aa7f8a4fa48172df48a64e278c6 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Fri, 17 Nov 2023 21:12:28 -0800 Subject: [PATCH 04/51] build/pkgs/sagemath_doc_html/spkg-install: Respect SAGE_WHEELS --- build/pkgs/sagemath_doc_html/spkg-install | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/build/pkgs/sagemath_doc_html/spkg-install b/build/pkgs/sagemath_doc_html/spkg-install index dfa3b02d2d9..fbfa676e12b 100755 --- a/build/pkgs/sagemath_doc_html/spkg-install +++ b/build/pkgs/sagemath_doc_html/spkg-install @@ -10,6 +10,17 @@ if [ $? -ne 0 ]; then exit 1 fi cd src -# Needed because we have trees.txt, which directs us to $SAGE_LOCAL/... -export PIP_FIND_LINKS=$SAGE_VENV/var/lib/sage/wheels -sdh_pip_install --no-build-isolation . + +if [ "$SAGE_WHEELS" = yes ]; then + # Needed because we have trees.txt, which directs us to $SAGE_LOCAL/... + export PIP_FIND_LINKS=$SAGE_VENV/var/lib/sage/wheels + # First build the sdist, then build the wheel from the sdist. + # https://pypa-build.readthedocs.io/en/latest/#python--m-build + # Do not install the wheel. + DIST_DIR="$(mktemp -d)" + python3 -m build --no-isolation --outdir "$DIST_DIR"/dist . || sdh_die "Failure building sdist and wheel" + wheel=$(cd "$DIST_DIR" && sdh_store_and_pip_install_wheel --prefix "$SAGE_LOCAL" . >&2 && echo $wheel) + ls -l "$wheel" +else + (cd doc && $MAKE doc-html) || sdh_die "Failure building HTML documentation" +fi From 762e0edeb2fc4714ffb21110fa83d6be76b9a5b2 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 18 Nov 2023 08:36:31 -0800 Subject: [PATCH 05/51] build/make/Makefile.in (WHEEL_PACKAGES): Add sagemath_doc_{html,pdf} --- build/make/Makefile.in | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/build/make/Makefile.in b/build/make/Makefile.in index 420dadb9364..1fca8f7c921 100644 --- a/build/make/Makefile.in +++ b/build/make/Makefile.in @@ -148,11 +148,14 @@ PYPI_WHEEL_PACKAGES = $(PYPI_NOARCH_WHEEL_PACKAGES) \ sagemath_sirocco \ sagemath_meataxe -# sage_docbuild is here, not in PYPI_WHEEL_PACKAGES, because it depends on sagelib +# sage_docbuild is here, not in PYPI_WHEEL_PACKAGES, because it depends on sagelib. +# This can be changed when we have separate 'dependencies_build' files. WHEEL_PACKAGES = $(PYPI_WHEEL_PACKAGES) \ sage_conf \ sagelib \ - sage_docbuild + sage_docbuild \ + sagemath_doc_html \ + sagemath_doc_pdf # Packages for which build sdists for PyPI PYPI_SDIST_PACKAGES = $(WHEEL_PACKAGES) From 434498bf7527b113f0f209d0c012f7b5da64472f Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 18 Nov 2023 10:25:32 -0800 Subject: [PATCH 06/51] pkgs/sagemath-doc-html: Add meson_dist_script.sh --- pkgs/sagemath-doc-html/meson.build | 2 ++ pkgs/sagemath-doc-html/meson_dist_script.sh | 15 +++++++++++++++ 2 files changed, 17 insertions(+) create mode 100755 pkgs/sagemath-doc-html/meson_dist_script.sh diff --git a/pkgs/sagemath-doc-html/meson.build b/pkgs/sagemath-doc-html/meson.build index 13b7a8f1831..d6c525fd5f9 100644 --- a/pkgs/sagemath-doc-html/meson.build +++ b/pkgs/sagemath-doc-html/meson.build @@ -14,3 +14,5 @@ html = custom_target('HTML documentation', install_subdir(meson.current_build_dir() / 'html', install_dir: docdir) + +meson.add_dist_script('meson_dist_script.sh') diff --git a/pkgs/sagemath-doc-html/meson_dist_script.sh b/pkgs/sagemath-doc-html/meson_dist_script.sh new file mode 100755 index 00000000000..5672966b5f4 --- /dev/null +++ b/pkgs/sagemath-doc-html/meson_dist_script.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash +if [ -z "$MESON_SOURCE_ROOT" -o -z "$MESON_DIST_ROOT" ]; then + echo >&2 "$0: Should only be run by meson" + exit 1 +fi +set -ex +if [ -L "$MESON_DIST_ROOT"/doc -o ! -d "$MESON_DIST_ROOT"/doc ]; then + # Remove symlink copied in by meson + rm -f "$MESON_DIST_ROOT"/doc + mkdir -p "$MESON_DIST_ROOT"/doc + # Follow symlink + (cd "$MESON_SOURCE_ROOT"/doc && tar -c -f - .) | (cd "$MESON_DIST_ROOT"/doc && tar -x -f - --no-same-permissions --no-acls --no-same-owner --no-xattrs) +fi +# Copy file generated by bootstrap (not in git) +cp "$MESON_SOURCE_ROOT"/pyproject.toml "$MESON_DIST_ROOT"/ From 8338c9a219b068186980757d6d02b3c8b788425b Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Mon, 21 Oct 2024 18:49:36 -0700 Subject: [PATCH 07/51] build/pkgs/sagemath_doc_html: Update dependencies, build wheel directly --- build/pkgs/sagemath_doc_html/dependencies | 2 +- build/pkgs/sagemath_doc_html/spkg-install | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/build/pkgs/sagemath_doc_html/dependencies b/build/pkgs/sagemath_doc_html/dependencies index 9b152880d97..5ecce434c2d 100644 --- a/build/pkgs/sagemath_doc_html/dependencies +++ b/build/pkgs/sagemath_doc_html/dependencies @@ -1,4 +1,4 @@ -sagelib sphinx sphinx_copybutton sphinx_inline_tabs pplpy_doc | $(SAGERUNTIME) maxima networkx scipy sympy matplotlib pillow mathjax mpmath ipykernel jupyter_client conway_polynomials tachyon ipywidgets sage_docbuild elliptic_curves furo fpylll graphs meson_python +sagelib sphinx sphinx_copybutton sphinx_inline_tabs pplpy_doc | $(SAGERUNTIME) maxima networkx scipy sympy matplotlib pillow mathjax mpmath ipykernel jupyter_client conway_polynomials tachyon ipywidgets sage_docbuild elliptic_curves furo fpylll graphs $(if $(findstring yes,$(SAGE_WHEELS)),python_build meson_python) # Building the documentation has many dependencies, because all # documented modules are imported and because we use matplotlib to diff --git a/build/pkgs/sagemath_doc_html/spkg-install b/build/pkgs/sagemath_doc_html/spkg-install index fbfa676e12b..44ae86ac70e 100755 --- a/build/pkgs/sagemath_doc_html/spkg-install +++ b/build/pkgs/sagemath_doc_html/spkg-install @@ -14,12 +14,16 @@ cd src if [ "$SAGE_WHEELS" = yes ]; then # Needed because we have trees.txt, which directs us to $SAGE_LOCAL/... export PIP_FIND_LINKS=$SAGE_VENV/var/lib/sage/wheels - # First build the sdist, then build the wheel from the sdist. - # https://pypa-build.readthedocs.io/en/latest/#python--m-build - # Do not install the wheel. + # Build a wheel using pypa/build. + # --wheel: Build the wheel directly. We do not go through the sdist + # because meson insists on packaging the latest commit, not + # the contents of the working copy. + # --skip-dependency-check: meson_python declares the Python package 'meson' as + # a dependency, but we have installed meson as a non-Python + # package. DIST_DIR="$(mktemp -d)" - python3 -m build --no-isolation --outdir "$DIST_DIR"/dist . || sdh_die "Failure building sdist and wheel" - wheel=$(cd "$DIST_DIR" && sdh_store_and_pip_install_wheel --prefix "$SAGE_LOCAL" . >&2 && echo $wheel) + python3 -m build --wheel --no-isolation --skip-dependency-check --outdir "$DIST_DIR"/dist . || sdh_die "Failure building wheel" + wheel=$(cd "$DIST_DIR" && sdh_store_and_pip_install_wheel --prefix="$SAGE_LOCAL" . >&2 && echo $wheel) ls -l "$wheel" else (cd doc && $MAKE doc-html) || sdh_die "Failure building HTML documentation" From da119c778d60a4e49f5f951881290c8a9402ad01 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Fri, 22 Mar 2024 22:12:26 -0700 Subject: [PATCH 08/51] pkgs/sagemath-doc-pdf: New --- build/pkgs/sagemath_doc_pdf/dependencies | 10 +++++- .../sagemath_doc_pdf/install-requires.txt | 1 + build/pkgs/sagemath_doc_pdf/spkg-install | 33 +++++++++++++++++-- build/pkgs/sagemath_doc_pdf/spkg-src | 24 ++++++++++++++ build/pkgs/sagemath_doc_pdf/src | 1 + pkgs/sagemath-doc-pdf/README.rst | 29 ++++++++++++++++ pkgs/sagemath-doc-pdf/VERSION.txt | 1 + pkgs/sagemath-doc-pdf/doc | 1 + pkgs/sagemath-doc-pdf/meson.build | 17 ++++++++++ pkgs/sagemath-doc-pdf/meson_dist_script.sh | 1 + pkgs/sagemath-doc-pdf/pyproject.toml.m4 | 25 ++++++++++++++ 11 files changed, 139 insertions(+), 4 deletions(-) create mode 100644 build/pkgs/sagemath_doc_pdf/install-requires.txt create mode 100755 build/pkgs/sagemath_doc_pdf/spkg-src create mode 120000 build/pkgs/sagemath_doc_pdf/src create mode 100644 pkgs/sagemath-doc-pdf/README.rst create mode 100644 pkgs/sagemath-doc-pdf/VERSION.txt create mode 120000 pkgs/sagemath-doc-pdf/doc create mode 100644 pkgs/sagemath-doc-pdf/meson.build create mode 120000 pkgs/sagemath-doc-pdf/meson_dist_script.sh create mode 100644 pkgs/sagemath-doc-pdf/pyproject.toml.m4 diff --git a/build/pkgs/sagemath_doc_pdf/dependencies b/build/pkgs/sagemath_doc_pdf/dependencies index 7e3e7f136d2..57209a45709 100644 --- a/build/pkgs/sagemath_doc_pdf/dependencies +++ b/build/pkgs/sagemath_doc_pdf/dependencies @@ -1 +1,9 @@ -sagemath_doc_html texlive texlive_luatex free_fonts xindy +sagelib sphinx sphinx_copybutton sphinx_inline_tabs pplpy_doc | $(SAGERUNTIME) maxima networkx scipy sympy matplotlib pillow mathjax mpmath ipykernel jupyter_client conway_polynomials tachyon jmol ipywidgets jupyter_sphinx sage_docbuild elliptic_curves furo fpylll graphs texlive texlive_luatex free_fonts xindy $(if $(findstring yes,$(SAGE_WHEELS)),python_build meson_python,sagemath_doc_html) + +# Building the documentation has many dependencies, because all +# documented modules are imported and because we use matplotlib to +# produce plots. +# +# If not going through wheels, sagemath_doc_html has to be an order-only +# dependency to avoid concurrency bugs because both sagemath_doc_html +# and sagemath_doc_pdf may modify the doctrees and inventories. diff --git a/build/pkgs/sagemath_doc_pdf/install-requires.txt b/build/pkgs/sagemath_doc_pdf/install-requires.txt new file mode 100644 index 00000000000..2bfeaf99083 --- /dev/null +++ b/build/pkgs/sagemath_doc_pdf/install-requires.txt @@ -0,0 +1 @@ +sagemath-doc-pdf diff --git a/build/pkgs/sagemath_doc_pdf/spkg-install b/build/pkgs/sagemath_doc_pdf/spkg-install index f04f4b75d9a..e68c7f573b0 100755 --- a/build/pkgs/sagemath_doc_pdf/spkg-install +++ b/build/pkgs/sagemath_doc_pdf/spkg-install @@ -1,3 +1,30 @@ -#! /usr/bin/env bash -cd $SAGE_ROOT/src/doc -$MAKE doc-pdf +#!/usr/bin/env bash +# From sage-spkg. +# For type=script packages, the build rule in build/make/Makefile sources +# sage-env but not sage-dist-helpers. +lib="$SAGE_ROOT/build/bin/sage-dist-helpers" +source "$lib" +if [ $? -ne 0 ]; then + echo >&2 "Error: failed to source $lib" + echo >&2 "Is $SAGE_ROOT the correct SAGE_ROOT?" + exit 1 +fi +cd src + +if [ "$SAGE_WHEELS" = yes ]; then + # Needed because we have trees.txt, which directs us to $SAGE_LOCAL/... + export PIP_FIND_LINKS=$SAGE_VENV/var/lib/sage/wheels + # Build a wheel using pypa/build. + # --wheel: Build the wheel directly. We do not go through the sdist + # because meson insists on packaging the latest commit, not + # the contents of the working copy. + # --skip-dependency-check: meson_python declares the Python package 'meson' as + # a dependency, but we have installed meson as a non-Python + # package. + DIST_DIR="$(mktemp -d)" + python3 -m build --wheel --no-isolation --skip-dependency-check --outdir "$DIST_DIR"/dist . || sdh_die "Failure building wheel" + wheel=$(cd "$DIST_DIR" && sdh_store_and_pip_install_wheel --prefix="$SAGE_LOCAL" . >&2 && echo $wheel) + ls -l "$wheel" +else + (cd doc && $MAKE doc-pdf) || sdh_die "Failure building PDF documentation" +fi diff --git a/build/pkgs/sagemath_doc_pdf/spkg-src b/build/pkgs/sagemath_doc_pdf/spkg-src new file mode 100755 index 00000000000..ab20cedb841 --- /dev/null +++ b/build/pkgs/sagemath_doc_pdf/spkg-src @@ -0,0 +1,24 @@ +#!/usr/bin/env bash +# +# Script to prepare an sdist tarball for sagemath_doc_pdf +# This script is not used during build. +# +# HOW TO MAKE THE TARBALL: +# ./sage --sh build/pkgs/sagemath_doc_pdf/spkg-src + +if [ -z "$SAGE_ROOT" ] ; then + echo >&2 "Error - SAGE_ROOT undefined ... exiting" + echo >&2 "Maybe run 'sage -sh'?" + exit 1 +fi + +# Exit on failure +set -e + +cd build/pkgs/sagemath_doc_pdf + +cd src +# Get rid of old *.egg-info/SOURCES.txt +rm -Rf *.egg-info + +python3 -m build --sdist --no-isolation --skip-dependency-check --outdir "$SAGE_DISTFILES" diff --git a/build/pkgs/sagemath_doc_pdf/src b/build/pkgs/sagemath_doc_pdf/src new file mode 120000 index 00000000000..eaeb964eaf1 --- /dev/null +++ b/build/pkgs/sagemath_doc_pdf/src @@ -0,0 +1 @@ +../../../pkgs/sagemath-doc-pdf \ No newline at end of file diff --git a/pkgs/sagemath-doc-pdf/README.rst b/pkgs/sagemath-doc-pdf/README.rst new file mode 100644 index 00000000000..1117fc4a5a8 --- /dev/null +++ b/pkgs/sagemath-doc-pdf/README.rst @@ -0,0 +1,29 @@ +====================================================================== + Sage: Open Source Mathematics Software: Documentation in HTML format +====================================================================== + +About SageMath +-------------- + + "Creating a Viable Open Source Alternative to + Magma, Maple, Mathematica, and MATLAB" + + Copyright (C) 2005-2023 The Sage Development Team + + https://www.sagemath.org + +SageMath fully supports all major Linux distributions, recent versions of +macOS, and Windows (using Cygwin or Windows Subsystem for Linux). + +The traditional and recommended way to install SageMath is from source via +Sage-the-distribution (https://www.sagemath.org/download-source.html). +Sage-the-distribution first builds a large number of open source packages from +source (unless it finds suitable versions installed in the system) and then +installs the Sage Library (sagelib, implemented in Python and Cython). + + +About this pip-installable source distribution +---------------------------------------------- + +When installed from source, the distribution `sagemath-doc-html` uses Sphinx +to build the SageMath documentation in HTML format. diff --git a/pkgs/sagemath-doc-pdf/VERSION.txt b/pkgs/sagemath-doc-pdf/VERSION.txt new file mode 100644 index 00000000000..47b62e8563a --- /dev/null +++ b/pkgs/sagemath-doc-pdf/VERSION.txt @@ -0,0 +1 @@ +10.2.rc3 diff --git a/pkgs/sagemath-doc-pdf/doc b/pkgs/sagemath-doc-pdf/doc new file mode 120000 index 00000000000..b14ab9a4284 --- /dev/null +++ b/pkgs/sagemath-doc-pdf/doc @@ -0,0 +1 @@ +../../src/doc \ No newline at end of file diff --git a/pkgs/sagemath-doc-pdf/meson.build b/pkgs/sagemath-doc-pdf/meson.build new file mode 100644 index 00000000000..2c953d50e37 --- /dev/null +++ b/pkgs/sagemath-doc-pdf/meson.build @@ -0,0 +1,17 @@ +project('sagemath-doc-pdf', + version: '10.2' +) + +docdir = get_option('datadir') / 'share' / 'doc' / 'sage' + +pdf = custom_target('PDF documentation', + build_by_default: true, + output: 'doc-pdf', # phony + command: ['env', 'SAGE_DOC=' + meson.current_build_dir(), + 'make', '-j20', '-C', join_paths(meson.current_source_dir(), 'doc'), '@OUTPUT@'], +) + +install_subdir(meson.current_build_dir() / 'pdf', + install_dir: docdir) + +meson.add_dist_script('meson_dist_script.sh') diff --git a/pkgs/sagemath-doc-pdf/meson_dist_script.sh b/pkgs/sagemath-doc-pdf/meson_dist_script.sh new file mode 120000 index 00000000000..ffb5978895e --- /dev/null +++ b/pkgs/sagemath-doc-pdf/meson_dist_script.sh @@ -0,0 +1 @@ +../sagemath-doc-html/meson_dist_script.sh \ No newline at end of file diff --git a/pkgs/sagemath-doc-pdf/pyproject.toml.m4 b/pkgs/sagemath-doc-pdf/pyproject.toml.m4 new file mode 100644 index 00000000000..ade978cc030 --- /dev/null +++ b/pkgs/sagemath-doc-pdf/pyproject.toml.m4 @@ -0,0 +1,25 @@ +include(`sage_spkg_versions_toml.m4')dnl' -*- conf-toml -*- +[build-system] +# Minimum requirements for the build system to execute. +requires = [ + SPKG_INSTALL_REQUIRES_meson_python + SPKG_INSTALL_REQUIRES_sage_docbuild + SPKG_INSTALL_REQUIRES_sphinx + SPKG_INSTALL_REQUIRES_sphinx_copybutton + SPKG_INSTALL_REQUIRES_furo + SPKG_INSTALL_REQUIRES_jupyter_sphinx + SPKG_INSTALL_REQUIRES_sagelib +] +build-backend = 'mesonpy' + +[project] +name = "sagemath-doc-pdf" +version = "10.2" +description = "Sage: Open Source Mathematics Software: Documentation in PDF format" +dependencies = [] + +include(`pyproject_toml_metadata.m4')dnl' + +[project.readme] +file = "README.rst" +content-type = "text/x-rst" From 93ef0d00796aff8c37f378019e4a1e6df09c96bd Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 18 Nov 2023 14:15:07 -0800 Subject: [PATCH 09/51] pkgs/sagemath-doc-*/pyproject.toml.m4: Fix license, other metadata --- pkgs/sagemath-doc-html/pyproject.toml.m4 | 13 +++++++++++-- pkgs/sagemath-doc-pdf/pyproject.toml.m4 | 13 +++++++++++-- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/pkgs/sagemath-doc-html/pyproject.toml.m4 b/pkgs/sagemath-doc-html/pyproject.toml.m4 index d0bc6870a3a..c8590a6be38 100644 --- a/pkgs/sagemath-doc-html/pyproject.toml.m4 +++ b/pkgs/sagemath-doc-html/pyproject.toml.m4 @@ -17,8 +17,17 @@ name = "sagemath-doc-html" version = "10.2" description = "Sage: Open Source Mathematics Software: Documentation in HTML format" dependencies = [] - -include(`pyproject_toml_metadata.m4')dnl' +license = {text = "GNU General Public License (GPL) v2 or later; Creative Commons Attribution-ShareAlike 3.0 Unported"} +authors = [{name = "The Sage Developers", email = "sage-support@googlegroups.com"}] +classifiers = [ + "Development Status :: 6 - Mature", + "Intended Audience :: Education", + "Intended Audience :: Science/Research", + "License :: OSI Approved", + "Programming Language :: Python :: 3 :: Only", + "Topic :: Scientific/Engineering :: Mathematics", +] +urls = {Homepage = "https://www.sagemath.org"} [project.readme] file = "README.rst" diff --git a/pkgs/sagemath-doc-pdf/pyproject.toml.m4 b/pkgs/sagemath-doc-pdf/pyproject.toml.m4 index ade978cc030..63442a94cee 100644 --- a/pkgs/sagemath-doc-pdf/pyproject.toml.m4 +++ b/pkgs/sagemath-doc-pdf/pyproject.toml.m4 @@ -17,8 +17,17 @@ name = "sagemath-doc-pdf" version = "10.2" description = "Sage: Open Source Mathematics Software: Documentation in PDF format" dependencies = [] - -include(`pyproject_toml_metadata.m4')dnl' +license = {text = "GNU General Public License (GPL) v2 or later; Creative Commons Attribution-ShareAlike 3.0 Unported"} +authors = [{name = "The Sage Developers", email = "sage-support@googlegroups.com"}] +classifiers = [ + "Development Status :: 6 - Mature", + "Intended Audience :: Education", + "Intended Audience :: Science/Research", + "License :: OSI Approved", + "Programming Language :: Python :: 3 :: Only", + "Topic :: Scientific/Engineering :: Mathematics", +] +urls = {Homepage = "https://www.sagemath.org"} [project.readme] file = "README.rst" From 84a46836313c2d7d7119492c8e8a183842a0ad38 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 18 Nov 2023 15:31:34 -0800 Subject: [PATCH 10/51] build/pkgs/sagemath_doc_pdf/bootstrap: Add missing file --- build/pkgs/sagemath_doc_pdf/bootstrap | 1 + 1 file changed, 1 insertion(+) create mode 120000 build/pkgs/sagemath_doc_pdf/bootstrap diff --git a/build/pkgs/sagemath_doc_pdf/bootstrap b/build/pkgs/sagemath_doc_pdf/bootstrap new file mode 120000 index 00000000000..40542346a4e --- /dev/null +++ b/build/pkgs/sagemath_doc_pdf/bootstrap @@ -0,0 +1 @@ +../sagelib/bootstrap \ No newline at end of file From 51a64d5e45ffeb920af4aad119afde9750d86df0 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 18 Nov 2023 15:33:46 -0800 Subject: [PATCH 11/51] build/pkgs/sagemath_doc_*: Parallelize make when parallelized --- pkgs/sagemath-doc-html/meson.build | 5 +++-- pkgs/sagemath-doc-pdf/meson.build | 5 +++-- src/doc/make.sh | 12 ++++++++++++ 3 files changed, 18 insertions(+), 4 deletions(-) create mode 100755 src/doc/make.sh diff --git a/pkgs/sagemath-doc-html/meson.build b/pkgs/sagemath-doc-html/meson.build index d6c525fd5f9..c6904dcac15 100644 --- a/pkgs/sagemath-doc-html/meson.build +++ b/pkgs/sagemath-doc-html/meson.build @@ -6,8 +6,9 @@ docdir = get_option('datadir') / 'share' / 'doc' / 'sage' html = custom_target('HTML documentation', output: 'index.html', - command: ['env', 'SAGE_DOC=' + meson.current_build_dir(), - 'make', '-j20', '-C', join_paths(meson.current_source_dir(), 'doc'), 'doc-html'], + command: [join_paths(meson.current_source_dir(), 'doc', 'make.sh'), + '-C', join_paths(meson.current_source_dir(), 'doc'), 'doc-html'], + env: {'SAGE_DOC': meson.current_build_dir()}, install: true, install_dir: docdir ) diff --git a/pkgs/sagemath-doc-pdf/meson.build b/pkgs/sagemath-doc-pdf/meson.build index 2c953d50e37..a17bd578968 100644 --- a/pkgs/sagemath-doc-pdf/meson.build +++ b/pkgs/sagemath-doc-pdf/meson.build @@ -7,8 +7,9 @@ docdir = get_option('datadir') / 'share' / 'doc' / 'sage' pdf = custom_target('PDF documentation', build_by_default: true, output: 'doc-pdf', # phony - command: ['env', 'SAGE_DOC=' + meson.current_build_dir(), - 'make', '-j20', '-C', join_paths(meson.current_source_dir(), 'doc'), '@OUTPUT@'], + command: [join_paths(meson.current_source_dir(), 'doc', 'make.sh'), + '-C', join_paths(meson.current_source_dir(), 'doc'), '@OUTPUT@'], + env: {'SAGE_DOC': meson.current_build_dir()} ) install_subdir(meson.current_build_dir() / 'pdf', diff --git a/src/doc/make.sh b/src/doc/make.sh new file mode 100755 index 00000000000..1f83f6b1858 --- /dev/null +++ b/src/doc/make.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash +# Invoke make with -j N when called from a make running a jobserver. +OPTIONS= +case "$MAKEFLAGS" in + *jobserver*) + if [ -n "$SAGE_NUM_THREADS_PARALLEL" ]; then + # Maximum number of job slots requested from the token server. + OPTIONS="-j$SAGE_NUM_THREADS_PARALLEL" + fi + ;; +esac +exec $MAKE $OPTIONS "$@" From 4d9425039e45d44772e18314339b3143f241d7a7 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 18 Nov 2023 15:45:50 -0800 Subject: [PATCH 12/51] pkgs/sagemath-doc-pdf/README.rst: Update --- pkgs/sagemath-doc-pdf/README.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/sagemath-doc-pdf/README.rst b/pkgs/sagemath-doc-pdf/README.rst index 1117fc4a5a8..a8f395354d8 100644 --- a/pkgs/sagemath-doc-pdf/README.rst +++ b/pkgs/sagemath-doc-pdf/README.rst @@ -1,5 +1,5 @@ ====================================================================== - Sage: Open Source Mathematics Software: Documentation in HTML format + Sage: Open Source Mathematics Software: Documentation in PDF format ====================================================================== About SageMath @@ -25,5 +25,5 @@ installs the Sage Library (sagelib, implemented in Python and Cython). About this pip-installable source distribution ---------------------------------------------- -When installed from source, the distribution `sagemath-doc-html` uses Sphinx -to build the SageMath documentation in HTML format. +When installed from source, the distribution `sagemath-doc-pdf` uses Sphinx +and PDFLaTeX to build the SageMath documentation in PDF format. From 72c46c08aa0f5ff36ee27c561bb31f3b8b8121e1 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 18 Nov 2023 15:49:03 -0800 Subject: [PATCH 13/51] .gitignore: Update --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 2d1978da1b3..3a3c814fe44 100644 --- a/.gitignore +++ b/.gitignore @@ -200,6 +200,7 @@ build/pkgs/wheel/version_requirements.txt # Generated files in the top-level source trees /pkgs/*/build +/pkgs/*/.mesonpy-* /pkgs/*/dist /pkgs/*/MANIFEST /pkgs/*/*.egg-info From 60eada8aa1f949750f314b46e859cc5cadf0666c Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 18 Nov 2023 16:54:01 -0800 Subject: [PATCH 14/51] build/pkgs/sagemath_doc_*: Add package-version.txt (as symlink) --- build/pkgs/sagemath_doc_html/package-version.txt | 1 + build/pkgs/sagemath_doc_pdf/package-version.txt | 1 + 2 files changed, 2 insertions(+) create mode 120000 build/pkgs/sagemath_doc_html/package-version.txt create mode 120000 build/pkgs/sagemath_doc_pdf/package-version.txt diff --git a/build/pkgs/sagemath_doc_html/package-version.txt b/build/pkgs/sagemath_doc_html/package-version.txt new file mode 120000 index 00000000000..c4540217bba --- /dev/null +++ b/build/pkgs/sagemath_doc_html/package-version.txt @@ -0,0 +1 @@ +src/VERSION.txt \ No newline at end of file diff --git a/build/pkgs/sagemath_doc_pdf/package-version.txt b/build/pkgs/sagemath_doc_pdf/package-version.txt new file mode 120000 index 00000000000..c4540217bba --- /dev/null +++ b/build/pkgs/sagemath_doc_pdf/package-version.txt @@ -0,0 +1 @@ +src/VERSION.txt \ No newline at end of file From 1a2ef505c5bef1de80e70a6d17110b57d2c66cd5 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 18 Nov 2023 17:01:34 -0800 Subject: [PATCH 15/51] pkgs/sagemath-doc-*/meson.build: Read version from VERSION.txt --- pkgs/sagemath-doc-html/meson.build | 4 +++- pkgs/sagemath-doc-pdf/meson.build | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/pkgs/sagemath-doc-html/meson.build b/pkgs/sagemath-doc-html/meson.build index c6904dcac15..3d7763d27f4 100644 --- a/pkgs/sagemath-doc-html/meson.build +++ b/pkgs/sagemath-doc-html/meson.build @@ -1,5 +1,7 @@ project('sagemath-doc-html', - version: '10.2' + version: run_command('cat', + join_paths(meson.current_source_dir(), 'VERSION.txt'), + check: true).stdout().strip() ) docdir = get_option('datadir') / 'share' / 'doc' / 'sage' diff --git a/pkgs/sagemath-doc-pdf/meson.build b/pkgs/sagemath-doc-pdf/meson.build index a17bd578968..1866c7d513c 100644 --- a/pkgs/sagemath-doc-pdf/meson.build +++ b/pkgs/sagemath-doc-pdf/meson.build @@ -1,5 +1,7 @@ project('sagemath-doc-pdf', - version: '10.2' + version: run_command('cat', + join_paths(meson.current_source_dir(), 'VERSION.txt'), + check: true).stdout().strip() ) docdir = get_option('datadir') / 'share' / 'doc' / 'sage' From a8ffdbc36b5a12b4e7e32ed67a089c4a19cd24f3 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 18 Nov 2023 17:04:25 -0800 Subject: [PATCH 16/51] pkgs/sagemath-doc-*/pyproject.toml.m4: Get version from meson-python --- pkgs/sagemath-doc-html/pyproject.toml.m4 | 2 +- pkgs/sagemath-doc-pdf/pyproject.toml.m4 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/sagemath-doc-html/pyproject.toml.m4 b/pkgs/sagemath-doc-html/pyproject.toml.m4 index c8590a6be38..ee279db41e8 100644 --- a/pkgs/sagemath-doc-html/pyproject.toml.m4 +++ b/pkgs/sagemath-doc-html/pyproject.toml.m4 @@ -14,7 +14,6 @@ build-backend = 'mesonpy' [project] name = "sagemath-doc-html" -version = "10.2" description = "Sage: Open Source Mathematics Software: Documentation in HTML format" dependencies = [] license = {text = "GNU General Public License (GPL) v2 or later; Creative Commons Attribution-ShareAlike 3.0 Unported"} @@ -28,6 +27,7 @@ classifiers = [ "Topic :: Scientific/Engineering :: Mathematics", ] urls = {Homepage = "https://www.sagemath.org"} +dynamic = ["version"] [project.readme] file = "README.rst" diff --git a/pkgs/sagemath-doc-pdf/pyproject.toml.m4 b/pkgs/sagemath-doc-pdf/pyproject.toml.m4 index 63442a94cee..36ba1162976 100644 --- a/pkgs/sagemath-doc-pdf/pyproject.toml.m4 +++ b/pkgs/sagemath-doc-pdf/pyproject.toml.m4 @@ -14,7 +14,6 @@ build-backend = 'mesonpy' [project] name = "sagemath-doc-pdf" -version = "10.2" description = "Sage: Open Source Mathematics Software: Documentation in PDF format" dependencies = [] license = {text = "GNU General Public License (GPL) v2 or later; Creative Commons Attribution-ShareAlike 3.0 Unported"} @@ -28,6 +27,7 @@ classifiers = [ "Topic :: Scientific/Engineering :: Mathematics", ] urls = {Homepage = "https://www.sagemath.org"} +dynamic = ["version"] [project.readme] file = "README.rst" From 41524eef7ed4472b0a6fe184612111caefdf35ed Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sun, 19 Nov 2023 20:02:36 -0800 Subject: [PATCH 17/51] pkgs/sagemath-doc-*/meson.build: Suggested simplications and comments --- pkgs/sagemath-doc-html/meson.build | 10 +++++----- pkgs/sagemath-doc-pdf/meson.build | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/pkgs/sagemath-doc-html/meson.build b/pkgs/sagemath-doc-html/meson.build index 3d7763d27f4..20260aeb472 100644 --- a/pkgs/sagemath-doc-html/meson.build +++ b/pkgs/sagemath-doc-html/meson.build @@ -1,15 +1,15 @@ project('sagemath-doc-html', - version: run_command('cat', - join_paths(meson.current_source_dir(), 'VERSION.txt'), - check: true).stdout().strip() + version: files('VERSION.txt') ) +# This is a meson-python project, so this is subject to the wheel mappings +# defined in https://github.com/mesonbuild/meson-python/blob/main/mesonpy/__init__.py docdir = get_option('datadir') / 'share' / 'doc' / 'sage' html = custom_target('HTML documentation', output: 'index.html', - command: [join_paths(meson.current_source_dir(), 'doc', 'make.sh'), - '-C', join_paths(meson.current_source_dir(), 'doc'), 'doc-html'], + command: [meson.current_source_dir() / 'doc' / 'make.sh', + '-C', meson.current_source_dir() / 'doc', 'doc-html'], env: {'SAGE_DOC': meson.current_build_dir()}, install: true, install_dir: docdir diff --git a/pkgs/sagemath-doc-pdf/meson.build b/pkgs/sagemath-doc-pdf/meson.build index 1866c7d513c..05af024cf7d 100644 --- a/pkgs/sagemath-doc-pdf/meson.build +++ b/pkgs/sagemath-doc-pdf/meson.build @@ -1,16 +1,16 @@ project('sagemath-doc-pdf', - version: run_command('cat', - join_paths(meson.current_source_dir(), 'VERSION.txt'), - check: true).stdout().strip() + version: files('VERSION.txt') ) +# This is a meson-python project, so this is subject to the wheel mappings +# defined in https://github.com/mesonbuild/meson-python/blob/main/mesonpy/__init__.py docdir = get_option('datadir') / 'share' / 'doc' / 'sage' pdf = custom_target('PDF documentation', build_by_default: true, output: 'doc-pdf', # phony - command: [join_paths(meson.current_source_dir(), 'doc', 'make.sh'), - '-C', join_paths(meson.current_source_dir(), 'doc'), '@OUTPUT@'], + command: [meson.current_source_dir() / 'doc' / 'make.sh'), + '-C', meson.current_source_dir() / 'doc', '@OUTPUT@'], env: {'SAGE_DOC': meson.current_build_dir()} ) From 9320fc8b8a0a578d65cadb5dc7a300a5fcf3b0f6 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Wed, 22 Nov 2023 15:48:41 -0800 Subject: [PATCH 18/51] pkgs/sagemath-doc-pdf/meson.build: Fix syntax --- pkgs/sagemath-doc-pdf/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/sagemath-doc-pdf/meson.build b/pkgs/sagemath-doc-pdf/meson.build index 05af024cf7d..b65691caeb5 100644 --- a/pkgs/sagemath-doc-pdf/meson.build +++ b/pkgs/sagemath-doc-pdf/meson.build @@ -9,7 +9,7 @@ docdir = get_option('datadir') / 'share' / 'doc' / 'sage' pdf = custom_target('PDF documentation', build_by_default: true, output: 'doc-pdf', # phony - command: [meson.current_source_dir() / 'doc' / 'make.sh'), + command: [meson.current_source_dir() / 'doc' / 'make.sh', '-C', meson.current_source_dir() / 'doc', '@OUTPUT@'], env: {'SAGE_DOC': meson.current_build_dir()} ) From efd445c93c714d22c9abb063f38c825eeb1a5287 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Wed, 22 Nov 2023 18:47:21 -0800 Subject: [PATCH 19/51] src/doc/make.sh: Do not assume $MAKE is set --- src/doc/make.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/doc/make.sh b/src/doc/make.sh index 1f83f6b1858..1d67060e379 100755 --- a/src/doc/make.sh +++ b/src/doc/make.sh @@ -9,4 +9,4 @@ case "$MAKEFLAGS" in fi ;; esac -exec $MAKE $OPTIONS "$@" +exec ${MAKE:-make} $OPTIONS "$@" From 2fce1817f664434537d7c30d6e97ca46cb11d144 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Wed, 22 Nov 2023 19:21:23 -0800 Subject: [PATCH 20/51] pkgs/sagemath-doc-html/meson_dist_script.sh: Do not ship the m4 file --- pkgs/sagemath-doc-html/meson_dist_script.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/sagemath-doc-html/meson_dist_script.sh b/pkgs/sagemath-doc-html/meson_dist_script.sh index 5672966b5f4..7c7f2c96487 100755 --- a/pkgs/sagemath-doc-html/meson_dist_script.sh +++ b/pkgs/sagemath-doc-html/meson_dist_script.sh @@ -13,3 +13,5 @@ if [ -L "$MESON_DIST_ROOT"/doc -o ! -d "$MESON_DIST_ROOT"/doc ]; then fi # Copy file generated by bootstrap (not in git) cp "$MESON_SOURCE_ROOT"/pyproject.toml "$MESON_DIST_ROOT"/ +# Remove m4 source +rm -f "$MESON_DIST_ROOT"/pyproject.toml.m4 From ac57bf8d01b6704f45258d38d1a4aa57ba547283 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Mon, 27 Nov 2023 20:44:23 -0800 Subject: [PATCH 21/51] pkgs/sagemath-doc-*/meson.build: Set SAGE_DOC_SRC --- pkgs/sagemath-doc-html/meson.build | 3 ++- pkgs/sagemath-doc-pdf/meson.build | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pkgs/sagemath-doc-html/meson.build b/pkgs/sagemath-doc-html/meson.build index 20260aeb472..f75e32c981a 100644 --- a/pkgs/sagemath-doc-html/meson.build +++ b/pkgs/sagemath-doc-html/meson.build @@ -10,7 +10,8 @@ html = custom_target('HTML documentation', output: 'index.html', command: [meson.current_source_dir() / 'doc' / 'make.sh', '-C', meson.current_source_dir() / 'doc', 'doc-html'], - env: {'SAGE_DOC': meson.current_build_dir()}, + env: {'SAGE_DOC': meson.current_build_dir(), + 'SAGE_DOC_SRC': meson.current_source_dir() / 'doc'}, install: true, install_dir: docdir ) diff --git a/pkgs/sagemath-doc-pdf/meson.build b/pkgs/sagemath-doc-pdf/meson.build index b65691caeb5..d540eb9251f 100644 --- a/pkgs/sagemath-doc-pdf/meson.build +++ b/pkgs/sagemath-doc-pdf/meson.build @@ -11,7 +11,8 @@ pdf = custom_target('PDF documentation', output: 'doc-pdf', # phony command: [meson.current_source_dir() / 'doc' / 'make.sh', '-C', meson.current_source_dir() / 'doc', '@OUTPUT@'], - env: {'SAGE_DOC': meson.current_build_dir()} + env: {'SAGE_DOC': meson.current_build_dir(), + 'SAGE_DOC_SRC': meson.current_source_dir() / 'doc'} ) install_subdir(meson.current_build_dir() / 'pdf', From 031c556d9f24982a3347ae3ab86c2e54d95ef240 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Tue, 28 Nov 2023 12:32:47 -0800 Subject: [PATCH 22/51] pkgs/sagemath-doc-html/meson_dist_script.sh: Fix the sdist --- pkgs/sagemath-doc-html/meson_dist_script.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/pkgs/sagemath-doc-html/meson_dist_script.sh b/pkgs/sagemath-doc-html/meson_dist_script.sh index 7c7f2c96487..e8e7ed76dca 100755 --- a/pkgs/sagemath-doc-html/meson_dist_script.sh +++ b/pkgs/sagemath-doc-html/meson_dist_script.sh @@ -7,9 +7,15 @@ set -ex if [ -L "$MESON_DIST_ROOT"/doc -o ! -d "$MESON_DIST_ROOT"/doc ]; then # Remove symlink copied in by meson rm -f "$MESON_DIST_ROOT"/doc - mkdir -p "$MESON_DIST_ROOT"/doc - # Follow symlink - (cd "$MESON_SOURCE_ROOT"/doc && tar -c -f - .) | (cd "$MESON_DIST_ROOT"/doc && tar -x -f - --no-same-permissions --no-acls --no-same-owner --no-xattrs) + # Follow symlink, copy source files. + # - We use git here so that the exclusions in SAGE_ROOT/.gitignore apply; + # in particular, editor backup files and the files such as + # src/doc/en/reference/*/sage (which are generated based on sagelib). + # - We can use git here because meson/mesonpy already refuses to make an sdist + # from something that is not a git working copy. + (cd "$MESON_SOURCE_ROOT/doc" && git archive HEAD --prefix=doc/ .) | (cd "$MESON_DIST_ROOT" && tar -x -f - --no-same-permissions --no-acls --no-same-owner --no-xattrs) + # Copy files that are not in the repository but generated by bootstrap. + (cd "$MESON_SOURCE_ROOT" && tar -c -f - doc/en/reference/spkg/*.rst doc/en/installation/*.txt doc/en/reference/repl/*.txt) | (cd "$MESON_DIST_ROOT" && tar -x -f - --no-same-permissions --no-acls --no-same-owner --no-xattrs) fi # Copy file generated by bootstrap (not in git) cp "$MESON_SOURCE_ROOT"/pyproject.toml "$MESON_DIST_ROOT"/ From c63d630131844aa0794ac9057a3b4a2bc53be425 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Tue, 28 Nov 2023 16:49:56 -0800 Subject: [PATCH 23/51] pkgs/sagemath-doc-*: Make a writable copy of the source --- pkgs/sagemath-doc-html/meson.build | 12 ++++++++++-- pkgs/sagemath-doc-pdf/meson.build | 10 +++++++++- src/doc/copy_doc_src.py | 12 ++++++++++++ 3 files changed, 31 insertions(+), 3 deletions(-) create mode 100755 src/doc/copy_doc_src.py diff --git a/pkgs/sagemath-doc-html/meson.build b/pkgs/sagemath-doc-html/meson.build index f75e32c981a..912cd334bce 100644 --- a/pkgs/sagemath-doc-html/meson.build +++ b/pkgs/sagemath-doc-html/meson.build @@ -6,12 +6,20 @@ project('sagemath-doc-html', # defined in https://github.com/mesonbuild/meson-python/blob/main/mesonpy/__init__.py docdir = get_option('datadir') / 'share' / 'doc' / 'sage' +doc_src = custom_target('Writable documentation source tree', + output: 'doc-src', # phony + command: [meson.current_source_dir() / 'doc' / 'copy_doc_src.py'], + env: {'SAGE_DOC': meson.current_build_dir(), + 'SAGE_DOC_SRC': meson.current_source_dir() / 'doc'} +) + html = custom_target('HTML documentation', output: 'index.html', + depends: [doc_src], command: [meson.current_source_dir() / 'doc' / 'make.sh', - '-C', meson.current_source_dir() / 'doc', 'doc-html'], + '-C', meson.current_build_dir() / 'src', 'doc-html'], env: {'SAGE_DOC': meson.current_build_dir(), - 'SAGE_DOC_SRC': meson.current_source_dir() / 'doc'}, + 'SAGE_DOC_SRC': meson.current_build_dir() / 'src'}, install: true, install_dir: docdir ) diff --git a/pkgs/sagemath-doc-pdf/meson.build b/pkgs/sagemath-doc-pdf/meson.build index d540eb9251f..82c123547b2 100644 --- a/pkgs/sagemath-doc-pdf/meson.build +++ b/pkgs/sagemath-doc-pdf/meson.build @@ -6,13 +6,21 @@ project('sagemath-doc-pdf', # defined in https://github.com/mesonbuild/meson-python/blob/main/mesonpy/__init__.py docdir = get_option('datadir') / 'share' / 'doc' / 'sage' +doc_src = custom_target('Writable documentation source tree', + output: 'doc-src', # phony + command: [meson.current_source_dir() / 'doc' / 'copy_doc_src.py'], + env: {'SAGE_DOC': meson.current_build_dir(), + 'SAGE_DOC_SRC': meson.current_source_dir() / 'doc'} +) + pdf = custom_target('PDF documentation', build_by_default: true, output: 'doc-pdf', # phony + depends: [doc_src], command: [meson.current_source_dir() / 'doc' / 'make.sh', '-C', meson.current_source_dir() / 'doc', '@OUTPUT@'], env: {'SAGE_DOC': meson.current_build_dir(), - 'SAGE_DOC_SRC': meson.current_source_dir() / 'doc'} + 'SAGE_DOC_SRC': meson.current_build_dir() / 'src'} ) install_subdir(meson.current_build_dir() / 'pdf', diff --git a/src/doc/copy_doc_src.py b/src/doc/copy_doc_src.py new file mode 100755 index 00000000000..e646e68fc60 --- /dev/null +++ b/src/doc/copy_doc_src.py @@ -0,0 +1,12 @@ +#!/usr/bin/env python3 +# Copy from $SAGE_DOC_SRC to $SAGE_DOC/src + +from os import environ +from pathlib import Path +from shutil import copytree + +from_path = environ['SAGE_DOC_SRC'] +to_path = Path(environ['SAGE_DOC']) / "src" + +print(f"Copying {from_path} to {to_path}") +copytree(from_path, to_path) From 66516eee39a62a6124a4469adf2f8f9c5fab225c Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Tue, 28 Nov 2023 18:13:52 -0800 Subject: [PATCH 24/51] pkgs/sagemath-doc-pdf/meson.build: Copy fix from -html --- pkgs/sagemath-doc-pdf/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/sagemath-doc-pdf/meson.build b/pkgs/sagemath-doc-pdf/meson.build index 82c123547b2..6da96339147 100644 --- a/pkgs/sagemath-doc-pdf/meson.build +++ b/pkgs/sagemath-doc-pdf/meson.build @@ -18,7 +18,7 @@ pdf = custom_target('PDF documentation', output: 'doc-pdf', # phony depends: [doc_src], command: [meson.current_source_dir() / 'doc' / 'make.sh', - '-C', meson.current_source_dir() / 'doc', '@OUTPUT@'], + '-C', meson.current_build_dir() / 'src', '@OUTPUT@'], env: {'SAGE_DOC': meson.current_build_dir(), 'SAGE_DOC_SRC': meson.current_build_dir() / 'src'} ) From bb745d9f12fbc94e495e2bbfcf5c376b6931ea4b Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Tue, 28 Nov 2023 18:42:58 -0800 Subject: [PATCH 25/51] src/doc/Makefile: Remove test for SAGE_ROOT as suggested --- src/doc/Makefile | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/doc/Makefile b/src/doc/Makefile index 98a3d138baf..da99ba773a7 100644 --- a/src/doc/Makefile +++ b/src/doc/Makefile @@ -32,10 +32,6 @@ doc-html--%: sage --docbuild --no-pdf-links $(subst -,/,$(subst doc-html--,,$@)) html $(SAGE_DOCBUILD_OPTS) # reference manual, inventory -ifndef SAGE_ROOT -doc-inventory-reference: - $(error SAGE_ROOT undefined. This Makefile needs to be invoked by build/make/install) -else doc-inventory-reference: doc-src $(eval DOCS = $(shell sage --docbuild --all-documents reference)) @if [ -z "$(DOCS)" ]; then echo "Error: 'sage --docbuild --all-documents' failed"; exit 1; fi @@ -44,7 +40,6 @@ doc-inventory-reference: doc-src $(MAKE) doc-inventory--$(subst /,-,$(BIBLIO)) $(MAKE) $(foreach doc, $(OTHER_DOCS), doc-inventory--$(subst /,-,$(doc))) $(MAKE) SAGE_DOCBUILD_OPTS="$(SAGE_DOCBUILD_OPTS) --no-prune-empty-dirs" doc-inventory--reference_top -endif # sub docs of reference manual, html doc-html-reference-sub: doc-inventory-reference From 2ef7dbca2e2daa7354cb1e7984b4ba79059c27d1 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Tue, 28 Nov 2023 18:48:00 -0800 Subject: [PATCH 26/51] src/sage_docbuild/builders.py: Do not depend on MAKE environment variable being set --- src/sage_docbuild/builders.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sage_docbuild/builders.py b/src/sage_docbuild/builders.py index ab39d93c280..a6292bc3782 100644 --- a/src/sage_docbuild/builders.py +++ b/src/sage_docbuild/builders.py @@ -290,7 +290,7 @@ def pdf(self): with open(tex_file, 'w') as f: f.write(ref) - make_target = "cd '%s' && $MAKE %s && mv -f *.pdf '%s'" + make_target = "cd '%s' && ${MAKE:-make} %s && mv -f *.pdf '%s'" error_message = "failed to run $MAKE %s in %s" command = 'all-pdf' From 04237c126c7035c293ec0dfa25682641c365a10a Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Fri, 1 Dec 2023 10:08:39 -0800 Subject: [PATCH 27/51] pkgs/sagemath-doc-html: Move helper scripts here from src/doc --- {src/doc => pkgs/sagemath-doc-html}/copy_doc_src.py | 0 {src/doc => pkgs/sagemath-doc-html}/make.sh | 0 pkgs/sagemath-doc-html/meson.build | 4 ++-- pkgs/sagemath-doc-pdf/copy_doc_src.py | 1 + pkgs/sagemath-doc-pdf/make.sh | 1 + pkgs/sagemath-doc-pdf/meson.build | 4 ++-- 6 files changed, 6 insertions(+), 4 deletions(-) rename {src/doc => pkgs/sagemath-doc-html}/copy_doc_src.py (100%) rename {src/doc => pkgs/sagemath-doc-html}/make.sh (100%) create mode 120000 pkgs/sagemath-doc-pdf/copy_doc_src.py create mode 120000 pkgs/sagemath-doc-pdf/make.sh diff --git a/src/doc/copy_doc_src.py b/pkgs/sagemath-doc-html/copy_doc_src.py similarity index 100% rename from src/doc/copy_doc_src.py rename to pkgs/sagemath-doc-html/copy_doc_src.py diff --git a/src/doc/make.sh b/pkgs/sagemath-doc-html/make.sh similarity index 100% rename from src/doc/make.sh rename to pkgs/sagemath-doc-html/make.sh diff --git a/pkgs/sagemath-doc-html/meson.build b/pkgs/sagemath-doc-html/meson.build index 912cd334bce..6ac87aaaa57 100644 --- a/pkgs/sagemath-doc-html/meson.build +++ b/pkgs/sagemath-doc-html/meson.build @@ -8,7 +8,7 @@ docdir = get_option('datadir') / 'share' / 'doc' / 'sage' doc_src = custom_target('Writable documentation source tree', output: 'doc-src', # phony - command: [meson.current_source_dir() / 'doc' / 'copy_doc_src.py'], + command: [meson.current_source_dir() / 'copy_doc_src.py'], env: {'SAGE_DOC': meson.current_build_dir(), 'SAGE_DOC_SRC': meson.current_source_dir() / 'doc'} ) @@ -16,7 +16,7 @@ doc_src = custom_target('Writable documentation source tree', html = custom_target('HTML documentation', output: 'index.html', depends: [doc_src], - command: [meson.current_source_dir() / 'doc' / 'make.sh', + command: [meson.current_source_dir() / 'make.sh', '-C', meson.current_build_dir() / 'src', 'doc-html'], env: {'SAGE_DOC': meson.current_build_dir(), 'SAGE_DOC_SRC': meson.current_build_dir() / 'src'}, diff --git a/pkgs/sagemath-doc-pdf/copy_doc_src.py b/pkgs/sagemath-doc-pdf/copy_doc_src.py new file mode 120000 index 00000000000..5f920c231c7 --- /dev/null +++ b/pkgs/sagemath-doc-pdf/copy_doc_src.py @@ -0,0 +1 @@ +../sagemath-doc-html/copy_doc_src.py \ No newline at end of file diff --git a/pkgs/sagemath-doc-pdf/make.sh b/pkgs/sagemath-doc-pdf/make.sh new file mode 120000 index 00000000000..6db1db71d6a --- /dev/null +++ b/pkgs/sagemath-doc-pdf/make.sh @@ -0,0 +1 @@ +../sagemath-doc-html/make.sh \ No newline at end of file diff --git a/pkgs/sagemath-doc-pdf/meson.build b/pkgs/sagemath-doc-pdf/meson.build index 6da96339147..c2a88e7803f 100644 --- a/pkgs/sagemath-doc-pdf/meson.build +++ b/pkgs/sagemath-doc-pdf/meson.build @@ -8,7 +8,7 @@ docdir = get_option('datadir') / 'share' / 'doc' / 'sage' doc_src = custom_target('Writable documentation source tree', output: 'doc-src', # phony - command: [meson.current_source_dir() / 'doc' / 'copy_doc_src.py'], + command: [meson.current_source_dir() / 'copy_doc_src.py'], env: {'SAGE_DOC': meson.current_build_dir(), 'SAGE_DOC_SRC': meson.current_source_dir() / 'doc'} ) @@ -17,7 +17,7 @@ pdf = custom_target('PDF documentation', build_by_default: true, output: 'doc-pdf', # phony depends: [doc_src], - command: [meson.current_source_dir() / 'doc' / 'make.sh', + command: [meson.current_source_dir() / 'make.sh', '-C', meson.current_build_dir() / 'src', '@OUTPUT@'], env: {'SAGE_DOC': meson.current_build_dir(), 'SAGE_DOC_SRC': meson.current_build_dir() / 'src'} From 2919c7b5b386a7707cb6f04633598f6e5352b7a9 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 2 Dec 2023 17:32:00 -0800 Subject: [PATCH 28/51] pkgs/sagemath-doc-*/meson.build: Use console: true --- pkgs/sagemath-doc-html/meson.build | 1 + pkgs/sagemath-doc-pdf/meson.build | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/sagemath-doc-html/meson.build b/pkgs/sagemath-doc-html/meson.build index 6ac87aaaa57..4162a1fd704 100644 --- a/pkgs/sagemath-doc-html/meson.build +++ b/pkgs/sagemath-doc-html/meson.build @@ -20,6 +20,7 @@ html = custom_target('HTML documentation', '-C', meson.current_build_dir() / 'src', 'doc-html'], env: {'SAGE_DOC': meson.current_build_dir(), 'SAGE_DOC_SRC': meson.current_build_dir() / 'src'}, + console: true, install: true, install_dir: docdir ) diff --git a/pkgs/sagemath-doc-pdf/meson.build b/pkgs/sagemath-doc-pdf/meson.build index c2a88e7803f..eeffa9d3c30 100644 --- a/pkgs/sagemath-doc-pdf/meson.build +++ b/pkgs/sagemath-doc-pdf/meson.build @@ -20,7 +20,8 @@ pdf = custom_target('PDF documentation', command: [meson.current_source_dir() / 'make.sh', '-C', meson.current_build_dir() / 'src', '@OUTPUT@'], env: {'SAGE_DOC': meson.current_build_dir(), - 'SAGE_DOC_SRC': meson.current_build_dir() / 'src'} + 'SAGE_DOC_SRC': meson.current_build_dir() / 'src'}, + console: true, ) install_subdir(meson.current_build_dir() / 'pdf', From 5feb7dec5849f177d83d41ca689892f8bbaad1d0 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 2 Dec 2023 17:36:07 -0800 Subject: [PATCH 29/51] pkgs/sagemath-doc-html/copy_doc_src.py: Do not fail if destination exists --- pkgs/sagemath-doc-html/copy_doc_src.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/sagemath-doc-html/copy_doc_src.py b/pkgs/sagemath-doc-html/copy_doc_src.py index e646e68fc60..fbadf38b835 100755 --- a/pkgs/sagemath-doc-html/copy_doc_src.py +++ b/pkgs/sagemath-doc-html/copy_doc_src.py @@ -9,4 +9,4 @@ to_path = Path(environ['SAGE_DOC']) / "src" print(f"Copying {from_path} to {to_path}") -copytree(from_path, to_path) +copytree(from_path, to_path, dirs_exist_ok=True) From 0daa6892ff5bab58ab5a6587985b942e7150257a Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 23 Mar 2024 13:54:54 -0700 Subject: [PATCH 30/51] build/pkgs/sagemath_doc_{html,pdf}/spkg-install.in: Rename from spkg-install --- .../{spkg-install => spkg-install.in} | 11 ----------- .../{spkg-install => spkg-install.in} | 11 ----------- 2 files changed, 22 deletions(-) rename build/pkgs/sagemath_doc_html/{spkg-install => spkg-install.in} (75%) mode change 100755 => 100644 rename build/pkgs/sagemath_doc_pdf/{spkg-install => spkg-install.in} (75%) mode change 100755 => 100644 diff --git a/build/pkgs/sagemath_doc_html/spkg-install b/build/pkgs/sagemath_doc_html/spkg-install.in old mode 100755 new mode 100644 similarity index 75% rename from build/pkgs/sagemath_doc_html/spkg-install rename to build/pkgs/sagemath_doc_html/spkg-install.in index 44ae86ac70e..0cc32a305a6 --- a/build/pkgs/sagemath_doc_html/spkg-install +++ b/build/pkgs/sagemath_doc_html/spkg-install.in @@ -1,14 +1,3 @@ -#!/usr/bin/env bash -# From sage-spkg. -# For type=script packages, the build rule in build/make/Makefile sources -# sage-env but not sage-dist-helpers. -lib="$SAGE_ROOT/build/bin/sage-dist-helpers" -source "$lib" -if [ $? -ne 0 ]; then - echo >&2 "Error: failed to source $lib" - echo >&2 "Is $SAGE_ROOT the correct SAGE_ROOT?" - exit 1 -fi cd src if [ "$SAGE_WHEELS" = yes ]; then diff --git a/build/pkgs/sagemath_doc_pdf/spkg-install b/build/pkgs/sagemath_doc_pdf/spkg-install.in old mode 100755 new mode 100644 similarity index 75% rename from build/pkgs/sagemath_doc_pdf/spkg-install rename to build/pkgs/sagemath_doc_pdf/spkg-install.in index e68c7f573b0..e9e24953cd9 --- a/build/pkgs/sagemath_doc_pdf/spkg-install +++ b/build/pkgs/sagemath_doc_pdf/spkg-install.in @@ -1,14 +1,3 @@ -#!/usr/bin/env bash -# From sage-spkg. -# For type=script packages, the build rule in build/make/Makefile sources -# sage-env but not sage-dist-helpers. -lib="$SAGE_ROOT/build/bin/sage-dist-helpers" -source "$lib" -if [ $? -ne 0 ]; then - echo >&2 "Error: failed to source $lib" - echo >&2 "Is $SAGE_ROOT the correct SAGE_ROOT?" - exit 1 -fi cd src if [ "$SAGE_WHEELS" = yes ]; then From f49053f410deb80f1af7f1e017dd2ef41941be10 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Mon, 21 Oct 2024 18:49:55 -0700 Subject: [PATCH 31/51] build/pkgs/sagemath_doc_{html,pdf}: Use sdh_build_wheel instead of using pypa/build for now --- build/pkgs/sagemath_doc_html/dependencies | 2 +- build/pkgs/sagemath_doc_html/spkg-install.in | 24 ++++++++------------ build/pkgs/sagemath_doc_pdf/dependencies | 2 +- build/pkgs/sagemath_doc_pdf/spkg-install.in | 20 +--------------- 4 files changed, 12 insertions(+), 36 deletions(-) mode change 100644 => 120000 build/pkgs/sagemath_doc_pdf/spkg-install.in diff --git a/build/pkgs/sagemath_doc_html/dependencies b/build/pkgs/sagemath_doc_html/dependencies index 5ecce434c2d..9b152880d97 100644 --- a/build/pkgs/sagemath_doc_html/dependencies +++ b/build/pkgs/sagemath_doc_html/dependencies @@ -1,4 +1,4 @@ -sagelib sphinx sphinx_copybutton sphinx_inline_tabs pplpy_doc | $(SAGERUNTIME) maxima networkx scipy sympy matplotlib pillow mathjax mpmath ipykernel jupyter_client conway_polynomials tachyon ipywidgets sage_docbuild elliptic_curves furo fpylll graphs $(if $(findstring yes,$(SAGE_WHEELS)),python_build meson_python) +sagelib sphinx sphinx_copybutton sphinx_inline_tabs pplpy_doc | $(SAGERUNTIME) maxima networkx scipy sympy matplotlib pillow mathjax mpmath ipykernel jupyter_client conway_polynomials tachyon ipywidgets sage_docbuild elliptic_curves furo fpylll graphs meson_python # Building the documentation has many dependencies, because all # documented modules are imported and because we use matplotlib to diff --git a/build/pkgs/sagemath_doc_html/spkg-install.in b/build/pkgs/sagemath_doc_html/spkg-install.in index 0cc32a305a6..1610ca50624 100644 --- a/build/pkgs/sagemath_doc_html/spkg-install.in +++ b/build/pkgs/sagemath_doc_html/spkg-install.in @@ -1,19 +1,13 @@ cd src -if [ "$SAGE_WHEELS" = yes ]; then - # Needed because we have trees.txt, which directs us to $SAGE_LOCAL/... - export PIP_FIND_LINKS=$SAGE_VENV/var/lib/sage/wheels - # Build a wheel using pypa/build. - # --wheel: Build the wheel directly. We do not go through the sdist - # because meson insists on packaging the latest commit, not - # the contents of the working copy. - # --skip-dependency-check: meson_python declares the Python package 'meson' as - # a dependency, but we have installed meson as a non-Python - # package. - DIST_DIR="$(mktemp -d)" - python3 -m build --wheel --no-isolation --skip-dependency-check --outdir "$DIST_DIR"/dist . || sdh_die "Failure building wheel" - wheel=$(cd "$DIST_DIR" && sdh_store_and_pip_install_wheel --prefix="$SAGE_LOCAL" . >&2 && echo $wheel) - ls -l "$wheel" +# Needed because we have trees.txt, which directs us to $SAGE_LOCAL/... +export PIP_FIND_LINKS=$SAGE_VENV/var/lib/sage/wheels + +if [ "$SAGE_EDITABLE" = yes ]; then + sdh_pip_editable_install . + if [ "$SAGE_WHEELS" = yes ]; then + sdh_build_and_store_wheel . + fi else - (cd doc && $MAKE doc-html) || sdh_die "Failure building HTML documentation" + sdh_pip_install . fi diff --git a/build/pkgs/sagemath_doc_pdf/dependencies b/build/pkgs/sagemath_doc_pdf/dependencies index 57209a45709..9c2058871e8 100644 --- a/build/pkgs/sagemath_doc_pdf/dependencies +++ b/build/pkgs/sagemath_doc_pdf/dependencies @@ -1,4 +1,4 @@ -sagelib sphinx sphinx_copybutton sphinx_inline_tabs pplpy_doc | $(SAGERUNTIME) maxima networkx scipy sympy matplotlib pillow mathjax mpmath ipykernel jupyter_client conway_polynomials tachyon jmol ipywidgets jupyter_sphinx sage_docbuild elliptic_curves furo fpylll graphs texlive texlive_luatex free_fonts xindy $(if $(findstring yes,$(SAGE_WHEELS)),python_build meson_python,sagemath_doc_html) +sagelib sphinx sphinx_copybutton sphinx_inline_tabs pplpy_doc | $(SAGERUNTIME) maxima networkx scipy sympy matplotlib pillow mathjax mpmath ipykernel jupyter_client conway_polynomials tachyon jmol ipywidgets jupyter_sphinx sage_docbuild elliptic_curves furo fpylll graphs texlive texlive_luatex free_fonts xindy meson_python # Building the documentation has many dependencies, because all # documented modules are imported and because we use matplotlib to diff --git a/build/pkgs/sagemath_doc_pdf/spkg-install.in b/build/pkgs/sagemath_doc_pdf/spkg-install.in deleted file mode 100644 index e9e24953cd9..00000000000 --- a/build/pkgs/sagemath_doc_pdf/spkg-install.in +++ /dev/null @@ -1,19 +0,0 @@ -cd src - -if [ "$SAGE_WHEELS" = yes ]; then - # Needed because we have trees.txt, which directs us to $SAGE_LOCAL/... - export PIP_FIND_LINKS=$SAGE_VENV/var/lib/sage/wheels - # Build a wheel using pypa/build. - # --wheel: Build the wheel directly. We do not go through the sdist - # because meson insists on packaging the latest commit, not - # the contents of the working copy. - # --skip-dependency-check: meson_python declares the Python package 'meson' as - # a dependency, but we have installed meson as a non-Python - # package. - DIST_DIR="$(mktemp -d)" - python3 -m build --wheel --no-isolation --skip-dependency-check --outdir "$DIST_DIR"/dist . || sdh_die "Failure building wheel" - wheel=$(cd "$DIST_DIR" && sdh_store_and_pip_install_wheel --prefix="$SAGE_LOCAL" . >&2 && echo $wheel) - ls -l "$wheel" -else - (cd doc && $MAKE doc-pdf) || sdh_die "Failure building PDF documentation" -fi diff --git a/build/pkgs/sagemath_doc_pdf/spkg-install.in b/build/pkgs/sagemath_doc_pdf/spkg-install.in new file mode 120000 index 00000000000..b3f7f760648 --- /dev/null +++ b/build/pkgs/sagemath_doc_pdf/spkg-install.in @@ -0,0 +1 @@ +../sagemath_doc_html/spkg-install.in \ No newline at end of file From 74e6727692306c36dc108d5fe5041d9abcda5fcf Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 23 Mar 2024 16:42:45 -0700 Subject: [PATCH 32/51] build/pkgs/sagemath_doc_{html,pdf}/spkg-legacy-uninstall: New --- build/pkgs/sagemath_doc_html/spkg-legacy-uninstall | 4 ++++ build/pkgs/sagemath_doc_pdf/spkg-legacy-uninstall | 4 ++++ 2 files changed, 8 insertions(+) create mode 100755 build/pkgs/sagemath_doc_html/spkg-legacy-uninstall create mode 100755 build/pkgs/sagemath_doc_pdf/spkg-legacy-uninstall diff --git a/build/pkgs/sagemath_doc_html/spkg-legacy-uninstall b/build/pkgs/sagemath_doc_html/spkg-legacy-uninstall new file mode 100755 index 00000000000..01d65f8603f --- /dev/null +++ b/build/pkgs/sagemath_doc_html/spkg-legacy-uninstall @@ -0,0 +1,4 @@ +#! /usr/bin/env bash +if [ -d "$SAGE_DOC" ]; then + rm -rf "$SAGE_DOC"/doctrees "$SAGE_DOC"/inventory "$SAGE_DOC"/html "$SAGE_DOC"/*.html +fi diff --git a/build/pkgs/sagemath_doc_pdf/spkg-legacy-uninstall b/build/pkgs/sagemath_doc_pdf/spkg-legacy-uninstall new file mode 100755 index 00000000000..74275ead407 --- /dev/null +++ b/build/pkgs/sagemath_doc_pdf/spkg-legacy-uninstall @@ -0,0 +1,4 @@ +#! /usr/bin/env bash +if [ -d "$SAGE_DOC" ]; then + rm -rf "$SAGE_DOC"/doctrees "$SAGE_DOC"/inventory "$SAGE_DOC"/pdf +fi From de4c691216ab15db9ff6e8bccc4ee9fcae11d0c6 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Tue, 11 Jun 2024 15:33:44 -0700 Subject: [PATCH 33/51] build/pkgs/sagemath_doc_{html,pdf}/spkg-install.in: In editable mode, create symlinks into build dir --- .github/workflows/doc-build.yml | 31 ++++++++++++++++++-- build/pkgs/sagemath_doc_html/spkg-install.in | 7 +++++ build/pkgs/sagemath_doc_pdf/spkg-install.in | 21 ++++++++++++- 3 files changed, 55 insertions(+), 4 deletions(-) mode change 120000 => 100644 build/pkgs/sagemath_doc_pdf/spkg-install.in diff --git a/.github/workflows/doc-build.yml b/.github/workflows/doc-build.yml index 9deab60f8be..5d5bdbb2e4d 100644 --- a/.github/workflows/doc-build.yml +++ b/.github/workflows/doc-build.yml @@ -243,9 +243,8 @@ jobs: export SAGE_USE_CDNS=yes export SAGE_LIVE_DOC=yes export SAGE_JUPYTER_SERVER=binder:sagemath/sage-binder-env/dev - make doc-clean doc-uninstall - ./config.status && make sagemath_doc_html-no-deps sagemath_doc_pdf-no-deps - shell: sh .ci/docker-exec-script.sh BUILD /sage {0} + ./config.status && make SAGE_WHEELS=yes SAGE_EDITABLE=no sagemath_doc_html-no-deps sagemath_doc_pdf-no-deps + shell: sh .ci/docker-exec-script.sh BUILD ./worktree-image {0} - name: Copy live doc id: copylivedoc @@ -265,3 +264,29 @@ jobs: name: livedoc path: livedoc.zip + - name: Upload sagemath-doc wheels + uses: actions/upload-artifact@v3 + with: + name: wheels + path: ./wheelhouse/*.whl + + upload_wheels: + needs: build-docs + runs-on: ubuntu-latest + env: + CAN_DEPLOY: ${{ secrets.SAGEMATH_PYPI_API_TOKEN != '' }} + steps: + + - uses: actions/download-artifact@v3 + with: + name: wheels + path: wheelhouse + + - uses: pypa/gh-action-pypi-publish@release/v1 + with: + user: __token__ + password: ${{ secrets.SAGEMATH_PYPI_API_TOKEN }} + packages-dir: wheelhouse/ + skip-existing: true + verbose: true + if: env.CAN_DEPLOY == 'true' diff --git a/build/pkgs/sagemath_doc_html/spkg-install.in b/build/pkgs/sagemath_doc_html/spkg-install.in index 1610ca50624..eb7f28ccb26 100644 --- a/build/pkgs/sagemath_doc_html/spkg-install.in +++ b/build/pkgs/sagemath_doc_html/spkg-install.in @@ -4,7 +4,14 @@ cd src export PIP_FIND_LINKS=$SAGE_VENV/var/lib/sage/wheels if [ "$SAGE_EDITABLE" = yes ]; then + # Editables 0.5 does not map non-package data files + # https://editables.readthedocs.io/en/latest/use-cases.html#mapping-non-python-directories-or-files + mkdir -p ${SAGE_DESTDIR}${SAGE_INST_LOCAL}/share/doc/sage sdh_pip_editable_install . + # We expect a subdirectory like build/cp312. + # Use 'find -newer' to use the one just created/modified by the editable build. + find $(pwd -P)/build -depth 1 -newer ${SAGE_DESTDIR}${SAGE_INST_LOCAL} -exec \ + ln -svf {}/html {}/index.html ${SAGE_DESTDIR}${SAGE_INST_LOCAL}/share/doc/sage/ \; if [ "$SAGE_WHEELS" = yes ]; then sdh_build_and_store_wheel . fi diff --git a/build/pkgs/sagemath_doc_pdf/spkg-install.in b/build/pkgs/sagemath_doc_pdf/spkg-install.in deleted file mode 120000 index b3f7f760648..00000000000 --- a/build/pkgs/sagemath_doc_pdf/spkg-install.in +++ /dev/null @@ -1 +0,0 @@ -../sagemath_doc_html/spkg-install.in \ No newline at end of file diff --git a/build/pkgs/sagemath_doc_pdf/spkg-install.in b/build/pkgs/sagemath_doc_pdf/spkg-install.in new file mode 100644 index 00000000000..80b83ee530c --- /dev/null +++ b/build/pkgs/sagemath_doc_pdf/spkg-install.in @@ -0,0 +1,20 @@ +cd src + +# Needed because we have trees.txt, which directs us to $SAGE_LOCAL/... +export PIP_FIND_LINKS=$SAGE_VENV/var/lib/sage/wheels + +if [ "$SAGE_EDITABLE" = yes ]; then + # Editables 0.5 does not map non-package data files + # https://editables.readthedocs.io/en/latest/use-cases.html#mapping-non-python-directories-or-files + mkdir -p ${SAGE_DESTDIR}${SAGE_INST_LOCAL}/share/doc/sage + sdh_pip_editable_install . + # We expect a subdirectory like build/cp312. + # Use 'find -newer' to use the one just created/modified by the editable build. + find $(pwd -P)/build -depth 1 -newer ${SAGE_DESTDIR}${SAGE_INST_LOCAL} -exec \ + ln -svf {}/pdf ${SAGE_DESTDIR}${SAGE_INST_LOCAL}/share/doc/sage/ \; + if [ "$SAGE_WHEELS" = yes ]; then + sdh_build_and_store_wheel . + fi +else + sdh_pip_install . +fi From 69de3f304beb115ba122d4317d1378edae979bb0 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 23 Mar 2024 18:38:37 -0700 Subject: [PATCH 34/51] build/pkgs/sagemath_doc_pdf/dependencies: Remove outdated comments --- build/pkgs/sagemath_doc_pdf/dependencies | 4 ---- 1 file changed, 4 deletions(-) diff --git a/build/pkgs/sagemath_doc_pdf/dependencies b/build/pkgs/sagemath_doc_pdf/dependencies index 9c2058871e8..b96c8fdad03 100644 --- a/build/pkgs/sagemath_doc_pdf/dependencies +++ b/build/pkgs/sagemath_doc_pdf/dependencies @@ -3,7 +3,3 @@ sagelib sphinx sphinx_copybutton sphinx_inline_tabs pplpy_doc | $(SAGERUNTIME) m # Building the documentation has many dependencies, because all # documented modules are imported and because we use matplotlib to # produce plots. -# -# If not going through wheels, sagemath_doc_html has to be an order-only -# dependency to avoid concurrency bugs because both sagemath_doc_html -# and sagemath_doc_pdf may modify the doctrees and inventories. From ae5d9cae3d167e0439df35cf0c2d1f9c04bcb3f2 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 23 Mar 2024 18:42:10 -0700 Subject: [PATCH 35/51] pkgs/sagemath-doc-{html,pdf}/VERSION.txt: Update --- pkgs/sagemath-doc-html/VERSION.txt | 2 +- pkgs/sagemath-doc-pdf/VERSION.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/sagemath-doc-html/VERSION.txt b/pkgs/sagemath-doc-html/VERSION.txt index 47b62e8563a..1d2c036dee5 100644 --- a/pkgs/sagemath-doc-html/VERSION.txt +++ b/pkgs/sagemath-doc-html/VERSION.txt @@ -1 +1 @@ -10.2.rc3 +10.4.beta0 diff --git a/pkgs/sagemath-doc-pdf/VERSION.txt b/pkgs/sagemath-doc-pdf/VERSION.txt index 47b62e8563a..1d2c036dee5 100644 --- a/pkgs/sagemath-doc-pdf/VERSION.txt +++ b/pkgs/sagemath-doc-pdf/VERSION.txt @@ -1 +1 @@ -10.2.rc3 +10.4.beta0 From 183dfa572dab0df04d277922804b0d6ce8efcbf9 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 23 Mar 2024 18:43:41 -0700 Subject: [PATCH 36/51] pkgs/sagemath-doc-{html,pdf}/README.rst: Update copyright year --- pkgs/sagemath-doc-html/README.rst | 2 +- pkgs/sagemath-doc-pdf/README.rst | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pkgs/sagemath-doc-html/README.rst b/pkgs/sagemath-doc-html/README.rst index 1117fc4a5a8..7019c3f4210 100644 --- a/pkgs/sagemath-doc-html/README.rst +++ b/pkgs/sagemath-doc-html/README.rst @@ -8,7 +8,7 @@ About SageMath "Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, and MATLAB" - Copyright (C) 2005-2023 The Sage Development Team + Copyright (C) 2005-2024 The Sage Development Team https://www.sagemath.org diff --git a/pkgs/sagemath-doc-pdf/README.rst b/pkgs/sagemath-doc-pdf/README.rst index a8f395354d8..319af2e5b3f 100644 --- a/pkgs/sagemath-doc-pdf/README.rst +++ b/pkgs/sagemath-doc-pdf/README.rst @@ -1,6 +1,6 @@ -====================================================================== +===================================================================== Sage: Open Source Mathematics Software: Documentation in PDF format -====================================================================== +===================================================================== About SageMath -------------- @@ -8,7 +8,7 @@ About SageMath "Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, and MATLAB" - Copyright (C) 2005-2023 The Sage Development Team + Copyright (C) 2005-2024 The Sage Development Team https://www.sagemath.org @@ -26,4 +26,4 @@ About this pip-installable source distribution ---------------------------------------------- When installed from source, the distribution `sagemath-doc-pdf` uses Sphinx -and PDFLaTeX to build the SageMath documentation in PDF format. +and LuaLaTeX to build the SageMath documentation in PDF format. From b500385995a121f08903af2691600dc319c8f8a3 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 23 Mar 2024 21:07:45 -0700 Subject: [PATCH 37/51] build/pkgs/sagemath_doc_{html,pdf}/spkg-install.in: In editable mode, create symlinks into build dir (fixup) --- build/pkgs/sagemath_doc_html/spkg-install.in | 2 +- build/pkgs/sagemath_doc_pdf/spkg-install.in | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/pkgs/sagemath_doc_html/spkg-install.in b/build/pkgs/sagemath_doc_html/spkg-install.in index eb7f28ccb26..1a5842624cc 100644 --- a/build/pkgs/sagemath_doc_html/spkg-install.in +++ b/build/pkgs/sagemath_doc_html/spkg-install.in @@ -10,7 +10,7 @@ if [ "$SAGE_EDITABLE" = yes ]; then sdh_pip_editable_install . # We expect a subdirectory like build/cp312. # Use 'find -newer' to use the one just created/modified by the editable build. - find $(pwd -P)/build -depth 1 -newer ${SAGE_DESTDIR}${SAGE_INST_LOCAL} -exec \ + find $(pwd -P)/build -maxdepth 1 -newer ${SAGE_DESTDIR}${SAGE_INST_LOCAL} -exec \ ln -svf {}/html {}/index.html ${SAGE_DESTDIR}${SAGE_INST_LOCAL}/share/doc/sage/ \; if [ "$SAGE_WHEELS" = yes ]; then sdh_build_and_store_wheel . diff --git a/build/pkgs/sagemath_doc_pdf/spkg-install.in b/build/pkgs/sagemath_doc_pdf/spkg-install.in index 80b83ee530c..a3b790ac440 100644 --- a/build/pkgs/sagemath_doc_pdf/spkg-install.in +++ b/build/pkgs/sagemath_doc_pdf/spkg-install.in @@ -10,7 +10,7 @@ if [ "$SAGE_EDITABLE" = yes ]; then sdh_pip_editable_install . # We expect a subdirectory like build/cp312. # Use 'find -newer' to use the one just created/modified by the editable build. - find $(pwd -P)/build -depth 1 -newer ${SAGE_DESTDIR}${SAGE_INST_LOCAL} -exec \ + find $(pwd -P)/build -maxdepth 1 -newer ${SAGE_DESTDIR}${SAGE_INST_LOCAL} -exec \ ln -svf {}/pdf ${SAGE_DESTDIR}${SAGE_INST_LOCAL}/share/doc/sage/ \; if [ "$SAGE_WHEELS" = yes ]; then sdh_build_and_store_wheel . From 55b0c83bf39e0f8d3df35ecc4eabd44bcd7987f7 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 27 Jul 2024 15:54:07 -0700 Subject: [PATCH 38/51] doc-build.yml: Build live doc and wheels on release tags --- .github/workflows/doc-build.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/doc-build.yml b/.github/workflows/doc-build.yml index 5d5bdbb2e4d..d9640bdec89 100644 --- a/.github/workflows/doc-build.yml +++ b/.github/workflows/doc-build.yml @@ -164,6 +164,10 @@ jobs: git add -A && git commit --quiet -m 'old') fi + # + # On PRs and pushes to branches + # + - name: Build doc id: docbuild if: (success() || failure()) && steps.worktree.outcome == 'success' && !startsWith(github.ref, 'refs/tags/') @@ -180,7 +184,7 @@ jobs: - name: Copy doc id: copy - if: (success() || failure()) && steps.docbuild.outcome == 'success' + if: (success() || failure()) && steps.docbuild.outcome == 'success' && !startsWith(github.ref, 'refs/tags/') run: | set -ex # We copy everything to a local folder @@ -221,7 +225,7 @@ jobs: - name: Upload doc id: upload - if: (success() || failure()) && steps.copy.outcome == 'success' + if: (success() || failure()) && steps.copy.outcome == 'success' && !startsWith(github.ref, 'refs/tags/') uses: actions/upload-artifact@v4 with: name: doc @@ -265,13 +269,16 @@ jobs: path: livedoc.zip - name: Upload sagemath-doc wheels + id: uploaddocwheels + if: (success() || failure()) && steps.buildlivedoc.outcome == 'success' uses: actions/upload-artifact@v3 with: name: wheels - path: ./wheelhouse/*.whl + path: ./upstream/sagemath_doc*.whl upload_wheels: needs: build-docs + if: startsWith(github.ref, 'refs/tags/') runs-on: ubuntu-latest env: CAN_DEPLOY: ${{ secrets.SAGEMATH_PYPI_API_TOKEN != '' }} From 9b21f85b846921cb130f541489f4c14f703e6137 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 23 Mar 2024 22:11:49 -0700 Subject: [PATCH 39/51] .github/workflows/doc-build*.yml: Do not run on pushes to branches --- .github/workflows/doc-build-pdf.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/doc-build-pdf.yml b/.github/workflows/doc-build-pdf.yml index dce25a132c9..5813b3ac3b6 100644 --- a/.github/workflows/doc-build-pdf.yml +++ b/.github/workflows/doc-build-pdf.yml @@ -2,7 +2,7 @@ name: Build documentation (PDF) on: pull_request: - push: + merge_group: workflow_dispatch: # Allow to run manually inputs: From 695484077308e76f2fc97482ddcc8935c5767ea9 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 23 Mar 2024 23:52:29 -0700 Subject: [PATCH 40/51] build/pkgs/sagemath_doc_{html,pdf}/spkg-install.in: Use --no-build-isolation --- build/pkgs/sagemath_doc_html/spkg-install.in | 4 ++-- build/pkgs/sagemath_doc_pdf/spkg-install.in | 4 ++-- pkgs/sagemath-doc-html/pyproject.toml.m4 | 1 + pkgs/sagemath-doc-pdf/pyproject.toml.m4 | 1 + 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/build/pkgs/sagemath_doc_html/spkg-install.in b/build/pkgs/sagemath_doc_html/spkg-install.in index 1a5842624cc..a28dccfb1e0 100644 --- a/build/pkgs/sagemath_doc_html/spkg-install.in +++ b/build/pkgs/sagemath_doc_html/spkg-install.in @@ -13,8 +13,8 @@ if [ "$SAGE_EDITABLE" = yes ]; then find $(pwd -P)/build -maxdepth 1 -newer ${SAGE_DESTDIR}${SAGE_INST_LOCAL} -exec \ ln -svf {}/html {}/index.html ${SAGE_DESTDIR}${SAGE_INST_LOCAL}/share/doc/sage/ \; if [ "$SAGE_WHEELS" = yes ]; then - sdh_build_and_store_wheel . + sdh_build_and_store_wheel --no-build-isolation . fi else - sdh_pip_install . + sdh_pip_install --no-build-isolation . fi diff --git a/build/pkgs/sagemath_doc_pdf/spkg-install.in b/build/pkgs/sagemath_doc_pdf/spkg-install.in index a3b790ac440..4a38d0f07f9 100644 --- a/build/pkgs/sagemath_doc_pdf/spkg-install.in +++ b/build/pkgs/sagemath_doc_pdf/spkg-install.in @@ -13,8 +13,8 @@ if [ "$SAGE_EDITABLE" = yes ]; then find $(pwd -P)/build -maxdepth 1 -newer ${SAGE_DESTDIR}${SAGE_INST_LOCAL} -exec \ ln -svf {}/pdf ${SAGE_DESTDIR}${SAGE_INST_LOCAL}/share/doc/sage/ \; if [ "$SAGE_WHEELS" = yes ]; then - sdh_build_and_store_wheel . + sdh_build_and_store_wheel --no-build-isolation . fi else - sdh_pip_install . + sdh_pip_install --no-build-isolation . fi diff --git a/pkgs/sagemath-doc-html/pyproject.toml.m4 b/pkgs/sagemath-doc-html/pyproject.toml.m4 index ee279db41e8..863c3fceb14 100644 --- a/pkgs/sagemath-doc-html/pyproject.toml.m4 +++ b/pkgs/sagemath-doc-html/pyproject.toml.m4 @@ -6,6 +6,7 @@ requires = [ SPKG_INSTALL_REQUIRES_sage_docbuild SPKG_INSTALL_REQUIRES_sphinx SPKG_INSTALL_REQUIRES_sphinx_copybutton + SPKG_INSTALL_REQUIRES_sphinx_inline_tabs SPKG_INSTALL_REQUIRES_furo SPKG_INSTALL_REQUIRES_jupyter_sphinx SPKG_INSTALL_REQUIRES_sagelib diff --git a/pkgs/sagemath-doc-pdf/pyproject.toml.m4 b/pkgs/sagemath-doc-pdf/pyproject.toml.m4 index 36ba1162976..4f680532229 100644 --- a/pkgs/sagemath-doc-pdf/pyproject.toml.m4 +++ b/pkgs/sagemath-doc-pdf/pyproject.toml.m4 @@ -6,6 +6,7 @@ requires = [ SPKG_INSTALL_REQUIRES_sage_docbuild SPKG_INSTALL_REQUIRES_sphinx SPKG_INSTALL_REQUIRES_sphinx_copybutton + SPKG_INSTALL_REQUIRES_sphinx_inline_tabs SPKG_INSTALL_REQUIRES_furo SPKG_INSTALL_REQUIRES_jupyter_sphinx SPKG_INSTALL_REQUIRES_sagelib From 06096c4404d578a7e5362e5ac27470a819df6019 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sun, 24 Mar 2024 00:10:43 -0700 Subject: [PATCH 41/51] build/make/Makefile.in (script package -sdist): Add meson_python as dep --- build/make/Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/make/Makefile.in b/build/make/Makefile.in index 1fca8f7c921..33f53cac228 100644 --- a/build/make/Makefile.in +++ b/build/make/Makefile.in @@ -775,7 +775,7 @@ $(1)-uninstall: $(1)-$(4)-uninstall $(1)-clean: $(1)-uninstall -$(1)-sdist: FORCE python_build sage_setup cython +$(1)-sdist: FORCE python_build sage_setup cython meson_python $(AM_V_at) cd '$$(SAGE_ROOT)' && \ . '$$(SAGE_ROOT)/src/bin/sage-src-env-config' && \ . '$$(SAGE_ROOT)/src/bin/sage-env-config' && \ From e7a9bc7c0c2d00cd3c61997b9ca9707678e677b8 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sun, 24 Mar 2024 11:21:56 -0700 Subject: [PATCH 42/51] .github/workflows/doc-build.yml: Fix wheel location --- .github/workflows/doc-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/doc-build.yml b/.github/workflows/doc-build.yml index d9640bdec89..f85334799c5 100644 --- a/.github/workflows/doc-build.yml +++ b/.github/workflows/doc-build.yml @@ -274,7 +274,7 @@ jobs: uses: actions/upload-artifact@v3 with: name: wheels - path: ./upstream/sagemath_doc*.whl + path: ./venv/var/lib/sage/wheels/sagemath_doc*.whl upload_wheels: needs: build-docs From 53364953f42ce89c001e606c6b2176b92e5b8037 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Tue, 11 Jun 2024 15:35:34 -0700 Subject: [PATCH 43/51] .github/workflows/doc-build.yml: Simplify, upgrade actions --- .github/workflows/doc-build.yml | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/.github/workflows/doc-build.yml b/.github/workflows/doc-build.yml index f85334799c5..5b567fc1946 100644 --- a/.github/workflows/doc-build.yml +++ b/.github/workflows/doc-build.yml @@ -39,6 +39,8 @@ env: FROM_DOCKER_TARGET: "with-targets" FROM_DOCKER_TAG: ${{ github.event.inputs.docker_tag || 'dev'}} EXTRA_CONFIGURE_ARGS: --enable-fat-binary + # For deployment of the sagemath_doc_... wheels to PyPI + CAN_DEPLOY: ${{ secrets.SAGEMATH_PYPI_API_TOKEN != '' }} jobs: build-doc: @@ -271,29 +273,16 @@ jobs: - name: Upload sagemath-doc wheels id: uploaddocwheels if: (success() || failure()) && steps.buildlivedoc.outcome == 'success' - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: wheels path: ./venv/var/lib/sage/wheels/sagemath_doc*.whl - upload_wheels: - needs: build-docs - if: startsWith(github.ref, 'refs/tags/') - runs-on: ubuntu-latest - env: - CAN_DEPLOY: ${{ secrets.SAGEMATH_PYPI_API_TOKEN != '' }} - steps: - - - uses: actions/download-artifact@v3 - with: - name: wheels - path: wheelhouse - - uses: pypa/gh-action-pypi-publish@release/v1 + if: (success() || failure()) && steps.buildlivedoc.outcome == 'success' && env.CAN_DEPLOY == 'true' with: user: __token__ password: ${{ secrets.SAGEMATH_PYPI_API_TOKEN }} packages-dir: wheelhouse/ skip-existing: true verbose: true - if: env.CAN_DEPLOY == 'true' From 278eecf8f9199a5b34ae963ce45b7811cb9909ea Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Thu, 9 May 2024 22:06:34 -0700 Subject: [PATCH 44/51] build/pkgs/sagemath_doc_*: Rename install-requires.txt to version_requirements.txt --- .../{install-requires.txt => version_requirements.txt} | 0 .../{install-requires.txt => version_requirements.txt} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename build/pkgs/sagemath_doc_html/{install-requires.txt => version_requirements.txt} (100%) rename build/pkgs/sagemath_doc_pdf/{install-requires.txt => version_requirements.txt} (100%) diff --git a/build/pkgs/sagemath_doc_html/install-requires.txt b/build/pkgs/sagemath_doc_html/version_requirements.txt similarity index 100% rename from build/pkgs/sagemath_doc_html/install-requires.txt rename to build/pkgs/sagemath_doc_html/version_requirements.txt diff --git a/build/pkgs/sagemath_doc_pdf/install-requires.txt b/build/pkgs/sagemath_doc_pdf/version_requirements.txt similarity index 100% rename from build/pkgs/sagemath_doc_pdf/install-requires.txt rename to build/pkgs/sagemath_doc_pdf/version_requirements.txt From dafc6ddaabe2163fc1cca0b6b1fffdd2bbcd7714 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Fri, 10 May 2024 01:27:24 -0700 Subject: [PATCH 45/51] build/pkgs/sagemath_doc_html/spkg-install.in: Restrict find to 'cp*' --- build/pkgs/sagemath_doc_html/spkg-install.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/pkgs/sagemath_doc_html/spkg-install.in b/build/pkgs/sagemath_doc_html/spkg-install.in index a28dccfb1e0..f9feb572666 100644 --- a/build/pkgs/sagemath_doc_html/spkg-install.in +++ b/build/pkgs/sagemath_doc_html/spkg-install.in @@ -10,7 +10,7 @@ if [ "$SAGE_EDITABLE" = yes ]; then sdh_pip_editable_install . # We expect a subdirectory like build/cp312. # Use 'find -newer' to use the one just created/modified by the editable build. - find $(pwd -P)/build -maxdepth 1 -newer ${SAGE_DESTDIR}${SAGE_INST_LOCAL} -exec \ + find $(pwd -P)/build -maxdepth 1 -name "cp*" -newer ${SAGE_DESTDIR}${SAGE_INST_LOCAL} -exec \ ln -svf {}/html {}/index.html ${SAGE_DESTDIR}${SAGE_INST_LOCAL}/share/doc/sage/ \; if [ "$SAGE_WHEELS" = yes ]; then sdh_build_and_store_wheel --no-build-isolation . From d60e0d6e8380347ed74e8677fa2c2dc8954a4331 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Fri, 10 May 2024 01:29:32 -0700 Subject: [PATCH 46/51] .github/workflows/doc-build.yml: Fix workdir for livedoc build --- .github/workflows/doc-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/doc-build.yml b/.github/workflows/doc-build.yml index 5b567fc1946..428b85152eb 100644 --- a/.github/workflows/doc-build.yml +++ b/.github/workflows/doc-build.yml @@ -250,7 +250,7 @@ jobs: export SAGE_LIVE_DOC=yes export SAGE_JUPYTER_SERVER=binder:sagemath/sage-binder-env/dev ./config.status && make SAGE_WHEELS=yes SAGE_EDITABLE=no sagemath_doc_html-no-deps sagemath_doc_pdf-no-deps - shell: sh .ci/docker-exec-script.sh BUILD ./worktree-image {0} + shell: sh .ci/docker-exec-script.sh BUILD /sage {0} - name: Copy live doc id: copylivedoc From 7a2221d4a9f2d4ca776c2963e484525c6570d6b3 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 27 Jul 2024 15:55:47 -0700 Subject: [PATCH 47/51] .github/workflows/doc-build.yml: Fix 'copy docs', 'copy livedoc' --- .github/workflows/doc-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/doc-build.yml b/.github/workflows/doc-build.yml index 428b85152eb..bcb62e03742 100644 --- a/.github/workflows/doc-build.yml +++ b/.github/workflows/doc-build.yml @@ -186,7 +186,7 @@ jobs: - name: Copy doc id: copy - if: (success() || failure()) && steps.docbuild.outcome == 'success' && !startsWith(github.ref, 'refs/tags/') + if: (success() || failure()) && steps.docbuild.outcome == 'success' run: | set -ex # We copy everything to a local folder From 0678f63d8885f86ed6aae3c20a7797ad4d43c197 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 11 May 2024 11:05:08 -0700 Subject: [PATCH 48/51] build/pkgs/sagemath_doc_pdf/spkg-install.in: Restrict find to 'cp*' --- build/pkgs/sagemath_doc_pdf/spkg-install.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/pkgs/sagemath_doc_pdf/spkg-install.in b/build/pkgs/sagemath_doc_pdf/spkg-install.in index 4a38d0f07f9..c985d0a761a 100644 --- a/build/pkgs/sagemath_doc_pdf/spkg-install.in +++ b/build/pkgs/sagemath_doc_pdf/spkg-install.in @@ -10,7 +10,7 @@ if [ "$SAGE_EDITABLE" = yes ]; then sdh_pip_editable_install . # We expect a subdirectory like build/cp312. # Use 'find -newer' to use the one just created/modified by the editable build. - find $(pwd -P)/build -maxdepth 1 -newer ${SAGE_DESTDIR}${SAGE_INST_LOCAL} -exec \ + find $(pwd -P)/build -maxdepth 1 -name "cp*" -newer ${SAGE_DESTDIR}${SAGE_INST_LOCAL} -exec \ ln -svf {}/pdf ${SAGE_DESTDIR}${SAGE_INST_LOCAL}/share/doc/sage/ \; if [ "$SAGE_WHEELS" = yes ]; then sdh_build_and_store_wheel --no-build-isolation . From 7cb87d18fc258f52560ad3da945cd5f06c646087 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 27 Jul 2024 15:57:24 -0700 Subject: [PATCH 49/51] .github/workflows/doc-build.yml: Update livedoc to container build --- .github/workflows/doc-build.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/doc-build.yml b/.github/workflows/doc-build.yml index bcb62e03742..c7dbdff8e7b 100644 --- a/.github/workflows/doc-build.yml +++ b/.github/workflows/doc-build.yml @@ -250,6 +250,7 @@ jobs: export SAGE_LIVE_DOC=yes export SAGE_JUPYTER_SERVER=binder:sagemath/sage-binder-env/dev ./config.status && make SAGE_WHEELS=yes SAGE_EDITABLE=no sagemath_doc_html-no-deps sagemath_doc_pdf-no-deps + (cd local/var/lib/sage/ && zip /sage/sagemath_doc_wheels.zip wheels/sagemath_doc*.whl) shell: sh .ci/docker-exec-script.sh BUILD /sage {0} - name: Copy live doc @@ -262,6 +263,8 @@ jobs: docker cp --follow-link BUILD:/sage/local/share/doc/sage/pdf livedoc docker cp --follow-link BUILD:/sage/local/share/doc/sage/index.html livedoc zip -r livedoc.zip livedoc + docker cp BUILD:/sage/sagemath_doc_wheels.zip . + unzip sagemath_doc_wheels.zip - name: Upload live doc if: (success() || failure()) && steps.copylivedoc.outcome == 'success' @@ -275,14 +278,14 @@ jobs: if: (success() || failure()) && steps.buildlivedoc.outcome == 'success' uses: actions/upload-artifact@v4 with: - name: wheels - path: ./venv/var/lib/sage/wheels/sagemath_doc*.whl + name: sagemath_doc_wheels + path: sagemath_doc_wheels.zip - uses: pypa/gh-action-pypi-publish@release/v1 if: (success() || failure()) && steps.buildlivedoc.outcome == 'success' && env.CAN_DEPLOY == 'true' with: user: __token__ password: ${{ secrets.SAGEMATH_PYPI_API_TOKEN }} - packages-dir: wheelhouse/ + packages-dir: wheels/ skip-existing: true verbose: true From 58deba540f1038425d2e33b65185d4b64c0f4789 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Wed, 29 May 2024 21:28:27 -0700 Subject: [PATCH 50/51] build/pkgs/sagemath_doc_*: Install in a tree SAGE_VENV_DOCS --- build/make/Makefile.in | 2 ++ build/pkgs/sagemath_doc_html/trees.txt | 2 +- build/pkgs/sagemath_doc_pdf/trees.txt | 2 +- configure.ac | 4 +++- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/build/make/Makefile.in b/build/make/Makefile.in index 33f53cac228..c6beda74023 100644 --- a/build/make/Makefile.in +++ b/build/make/Makefile.in @@ -58,6 +58,8 @@ SAGE_SPKG_OPTIONS = @SAGE_SPKG_OPTIONS@ # set to empty if --disable-doc is used SAGE_DOCS = @SAGE_DOCS@ SAGE_DOCS_DISABLED_MESSAGE = This Sage build is configured with "configure --disable-doc", so building the documentation will not work. +SAGE_VENV_DOCS = @SAGE_VENV_DOCS@ +SAGE_VENV_DOCS_DISABLED_MESSAGE = This Sage build is configured with "configure --disable-doc", so building the documentation will not work. # Where the Sage distribution installs Python packages. # This can be overridden by 'make SAGE_VENV=/some/venv'. diff --git a/build/pkgs/sagemath_doc_html/trees.txt b/build/pkgs/sagemath_doc_html/trees.txt index 77be9495f24..add51197440 100644 --- a/build/pkgs/sagemath_doc_html/trees.txt +++ b/build/pkgs/sagemath_doc_html/trees.txt @@ -1 +1 @@ -SAGE_DOCS +SAGE_VENV_DOCS diff --git a/build/pkgs/sagemath_doc_pdf/trees.txt b/build/pkgs/sagemath_doc_pdf/trees.txt index 77be9495f24..add51197440 100644 --- a/build/pkgs/sagemath_doc_pdf/trees.txt +++ b/build/pkgs/sagemath_doc_pdf/trees.txt @@ -1 +1 @@ -SAGE_DOCS +SAGE_VENV_DOCS diff --git a/configure.ac b/configure.ac index 5c12ff36ac9..ba9f6dee4e3 100644 --- a/configure.ac +++ b/configure.ac @@ -98,6 +98,7 @@ AC_ARG_WITH([sage-venv], AC_SUBST([SAGE_VENV]) AC_SUBST([SAGE_DOCS], ['${SAGE_LOCAL}'])dnl Quoted so that it is resolved at build time by shell/Makefile +AC_SUBST([SAGE_VENV_DOCS], ['${SAGE_VENV}'])dnl Quoted so that it is resolved at build time by shell/Makefile #--------------------------------------------------------- @@ -477,7 +478,8 @@ AC_ARG_ENABLE([doc], AS_VAR_SET([SAGE_ENABLE_$pkg], [$enableval]) done AS_VAR_IF([enableval], [no], [dnl Disable the docbuild by disabling the install tree for documentation - AS_VAR_SET([SAGE_DOCS], [])dnl + AS_VAR_SET([SAGE_DOCS], []) + AS_VAR_SET([SAGE_VENV_DOCS], []) ]) ]) From 58e30fe8c01cf8e4e9c8b175f26f8414821901b8 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Wed, 29 May 2024 22:20:29 -0700 Subject: [PATCH 51/51] build/pkgs/sagemath_doc_*: Install links into SAGE_DOCS in postinst --- .github/workflows/doc-build.yml | 2 +- build/pkgs/sagemath_doc_html/spkg-postinst.in | 7 +++++++ build/pkgs/sagemath_doc_pdf/spkg-postinst.in | 1 + 3 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 build/pkgs/sagemath_doc_html/spkg-postinst.in create mode 120000 build/pkgs/sagemath_doc_pdf/spkg-postinst.in diff --git a/.github/workflows/doc-build.yml b/.github/workflows/doc-build.yml index c7dbdff8e7b..d5c2ecdc798 100644 --- a/.github/workflows/doc-build.yml +++ b/.github/workflows/doc-build.yml @@ -250,7 +250,7 @@ jobs: export SAGE_LIVE_DOC=yes export SAGE_JUPYTER_SERVER=binder:sagemath/sage-binder-env/dev ./config.status && make SAGE_WHEELS=yes SAGE_EDITABLE=no sagemath_doc_html-no-deps sagemath_doc_pdf-no-deps - (cd local/var/lib/sage/ && zip /sage/sagemath_doc_wheels.zip wheels/sagemath_doc*.whl) + (cd venv/var/lib/sage/ && zip /sage/sagemath_doc_wheels.zip wheels/sagemath_doc*.whl) shell: sh .ci/docker-exec-script.sh BUILD /sage {0} - name: Copy live doc diff --git a/build/pkgs/sagemath_doc_html/spkg-postinst.in b/build/pkgs/sagemath_doc_html/spkg-postinst.in new file mode 100644 index 00000000000..6af97b2de3e --- /dev/null +++ b/build/pkgs/sagemath_doc_html/spkg-postinst.in @@ -0,0 +1,7 @@ +mkdir -p "${SAGE_DOC}" +cd "${SAGE_INST_LOCAL}/share/doc/sage" +for a in *; do + if [ -e "$a" -a ! -e "${SAGE_DOC}/$a" ]; then + ln -sf "${SAGE_INST_LOCAL}/share/doc/sage/$a" "${SAGE_DOC}/$a" + fi +done diff --git a/build/pkgs/sagemath_doc_pdf/spkg-postinst.in b/build/pkgs/sagemath_doc_pdf/spkg-postinst.in new file mode 120000 index 00000000000..21f3c5c19c1 --- /dev/null +++ b/build/pkgs/sagemath_doc_pdf/spkg-postinst.in @@ -0,0 +1 @@ +../sagemath_doc_html/spkg-postinst.in \ No newline at end of file