From 413b081b16ace2392d362ed54d12f166ad30cf6a Mon Sep 17 00:00:00 2001 From: Tobias Diez Date: Thu, 21 Apr 2022 11:54:53 +0000 Subject: [PATCH 01/15] Add conda dev environment --- src/doc/bootstrap | 14 ++- src/environment-dev.yml | 206 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 219 insertions(+), 1 deletion(-) create mode 100644 src/environment-dev.yml diff --git a/src/doc/bootstrap b/src/doc/bootstrap index 4a85f15d57e..a00811223fa 100755 --- a/src/doc/bootstrap +++ b/src/doc/bootstrap @@ -65,7 +65,7 @@ for SYSTEM in arch debian fedora cygwin homebrew conda; do done if [ "${SYSTEM}" = "conda" ]; then if [ "${BOOTSTRAP_QUIET}" = "no" ]; then - echo >&2 $0:$LINENO: installing environment.yml, environment-optional.yml, src/environment.yml and src/environment-optional.yml + echo >&2 $0:$LINENO: generate conda enviroment files fi echo "name: sage-build" > environment.yml echo "channels:" >> environment.yml @@ -79,6 +79,18 @@ for SYSTEM in arch debian fedora cygwin homebrew conda; do for pkg in $SAGELIB_SYSTEM_PACKAGES; do echo " - $pkg" >> src/environment.yml done + sed 's/name: sage/name: sage-dev/' src/environment.yml > src/environment-dev.yml + echo " # Packages needed for ./bootstrap" >> src/environment-dev.yml + BOOTSTRAP_PACKAGES=$(echo $(${STRIP_COMMENTS} build/pkgs/_bootstrap/distros/conda.txt)) + for pkg in $BOOTSTRAP_PACKAGES; do + echo " - $pkg" >> src/environment-dev.yml + done + echo " # Additional dev tools" >> src/environment-dev.yml + echo " - openssh" >> src/environment-dev.yml + echo " - pycodestyle" >> src/environment-dev.yml + echo " - pytest" >> src/environment-dev.yml + echo " - jupyter_sphinx" >> src/environment-dev.yml + cp environment.yml environment-optional.yml echo " # optional packages" >> environment-optional.yml for pkg in $OPTIONAL_SYSTEM_PACKAGES; do diff --git a/src/environment-dev.yml b/src/environment-dev.yml new file mode 100644 index 00000000000..6d99447b852 --- /dev/null +++ b/src/environment-dev.yml @@ -0,0 +1,206 @@ +name: sage-dev +channels: + - conda-forge + - nodefaults +dependencies: + - compilers + - make + - m4 + - perl + - python + - tar + - bc + - pkg-config + - arb + - boost-cpp + - brial + - bzip2 + - cddlib + - cliquer + - cmake + - curl + - ecl + - eclib + - ecm + - fflas-ffpack + - libflint + - flintqs + - fplll + - freetype + - bdw-gc + - gengetopt + - gf2x + - gfan + - fortran-compiler + - giac + - givaro + - glpk + - gmp + - gsl + - iml + - lcalc + - libatomic_ops + - libbraiding + - libffi + - libgd + - libhomfly + - xz + - libpng + - linbox + - lrcalc + - m4ri + - m4rie + - mpc + - mpfi + - mpfr + - nauty + - ncurses + - ntl + - openblas + - blas=2.*=openblas + - openssl + - palp + - pari + - pari-elldata + - pari-galdata + - pari-galpol + - pari-seadata + - pari-galdata + - pari-seadata-small + - patch + - pcre + - pkg-config + - planarity + - ppl + - primecount + - primesieve + - qhull + - r + - r-essentials + - readline + - rw + - singular + - sqlite + - suitesparse + - symmetrica + - sympow + - tachyon + - tox + - xz + - zeromq + - zlib + - zn_poly + - alabaster + - attrs + - babel + - backcall + - beautifulsoup4 + - bleach + - certifi + - cffi + - sagemath-db-combinatorial-designs + - sagemath-db-conway-polynomials + - cvxopt + - cycler + - cypari2 + - cysignals + - cython + - python-dateutil + - decorator + - defusedxml + - docutils + - sagemath-db-elliptic-curves + - entrypoints + - fpylll + - gap-defaults + - gmpy2 + - sagemath-db-graphs + - html5lib + - imagesize + - importlib_metadata + - ipykernel + - ipython + - ipython_genutils + - ipywidgets + - jedi + - jinja2 + - jmol + - jsonschema + - jupyter_client + - jupyter_core + - kiwisolver + - python-lrcalc + - markupsafe + - mathjax + - "matplotlib>=3.5.1" + - maxima + - memory-allocator + - mistune + - mpmath + - nbconvert + - nbformat + - networkx + - notebook + - numpy + - packaging + - pandocfilters + - parso + - pexpect + - pickleshare + - pillow + - pip + - pkgconfig + - sagemath-db-polytopes + - pplpy + - primecountpy + - prometheus_client + - prompt_toolkit + - ptyprocess + - pybind11 + - pycparser + - pygments + - pyparsing + - pyrsistent + - pytz + - pyzmq + - requests + - rpy2 + - sagetex + - scipy + - send2trash + - setuptools + - setuptools_scm + - simplegeneric + - six + - snowballstemmer + - sphinx + - sphinxcontrib-applehelp + - sphinxcontrib-devhelp + - sphinxcontrib-htmlhelp + - sphinxcontrib-jsmath + - sphinxcontrib-qthelp + - sphinxcontrib-serializinghtml + - sphinxcontrib-websupport + - sympy + - terminado + - testpath + - three.js + - tornado + - traitlets + - tzlocal + - vcversioner + - wcwidth + - webencodings + - wheel + - widgetsnbextension + - zipp + # Packages needed for ./bootstrap + - gettext + - autoconf + - automake + - libtool + # Additional dev tools + - openssh + - pycodestyle + - pytest + - jupyter_sphinx From aa144e6c45fa9a76ebfbe69b011d4da0b8a76b7c Mon Sep 17 00:00:00 2001 From: Tobias Diez Date: Fri, 22 Apr 2022 10:11:52 +0000 Subject: [PATCH 02/15] Add distros/conda for jupyter_sphinx --- build/pkgs/jupyter_sphinx/distros/conda.txt | 1 + src/doc/bootstrap | 1 - src/environment-dev.yml | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) create mode 100644 build/pkgs/jupyter_sphinx/distros/conda.txt diff --git a/build/pkgs/jupyter_sphinx/distros/conda.txt b/build/pkgs/jupyter_sphinx/distros/conda.txt new file mode 100644 index 00000000000..e9b59e89755 --- /dev/null +++ b/build/pkgs/jupyter_sphinx/distros/conda.txt @@ -0,0 +1 @@ +jupyter_sphinx diff --git a/src/doc/bootstrap b/src/doc/bootstrap index a00811223fa..14886524d58 100755 --- a/src/doc/bootstrap +++ b/src/doc/bootstrap @@ -89,7 +89,6 @@ for SYSTEM in arch debian fedora cygwin homebrew conda; do echo " - openssh" >> src/environment-dev.yml echo " - pycodestyle" >> src/environment-dev.yml echo " - pytest" >> src/environment-dev.yml - echo " - jupyter_sphinx" >> src/environment-dev.yml cp environment.yml environment-optional.yml echo " # optional packages" >> environment-optional.yml diff --git a/src/environment-dev.yml b/src/environment-dev.yml index 6d99447b852..bef6a1f4a2b 100644 --- a/src/environment-dev.yml +++ b/src/environment-dev.yml @@ -128,6 +128,7 @@ dependencies: - jsonschema - jupyter_client - jupyter_core + - jupyter_sphinx - kiwisolver - python-lrcalc - markupsafe @@ -203,4 +204,3 @@ dependencies: - openssh - pycodestyle - pytest - - jupyter_sphinx From 281155921993173a75e18c7c23af782acc6a902e Mon Sep 17 00:00:00 2001 From: Tobias Diez Date: Wed, 27 Apr 2022 17:17:32 +0000 Subject: [PATCH 03/15] Introduce new bootstrap-conda command --- .gitignore | 1 + bootstrap-conda | 78 +++++++++++++++ src/doc/bootstrap | 52 ++-------- src/environment-dev.yml | 206 ---------------------------------------- 4 files changed, 86 insertions(+), 251 deletions(-) create mode 100755 bootstrap-conda delete mode 100644 src/environment-dev.yml diff --git a/.gitignore b/.gitignore index 942a4388eeb..84c0c28eca8 100644 --- a/.gitignore +++ b/.gitignore @@ -23,6 +23,7 @@ /environment.yml /environment-optional.yml /src/environment.yml +/src/environment-dev.yml /src/environment-optional.yml /src/setup.cfg diff --git a/bootstrap-conda b/bootstrap-conda new file mode 100755 index 00000000000..9fac4e8d58a --- /dev/null +++ b/bootstrap-conda @@ -0,0 +1,78 @@ +#!/bin/bash + +######################################################################## +# Generate auto-generated conda environment files +######################################################################### + +STRIP_COMMENTS="sed s/#.*//;" +RECOMMENDED_SPKG_PATTERN="@(_recommended$(for a in $(head -n 1 build/pkgs/_recommended/dependencies); do echo -n "|"$a; done))" + +BOOTSTRAP_PACKAGES=$(echo $(${STRIP_COMMENTS} build/pkgs/_bootstrap/distros/conda.txt)) +SYSTEM_PACKAGES= +OPTIONAL_SYSTEM_PACKAGES= +SAGELIB_SYSTEM_PACKAGES= +SAGELIB_OPTIONAL_SYSTEM_PACKAGES= +RECOMMENDED_SYSTEM_PACKAGES= +for PKG_BASE in $(./sage --package list --has-file distros/conda.txt); do + PKG_SCRIPTS=build/pkgs/$PKG_BASE + SYSTEM_PACKAGES_FILE=$PKG_SCRIPTS/distros/conda.txt + PKG_TYPE=$(cat $PKG_SCRIPTS/type) + PKG_SYSTEM_PACKAGES=$(echo $(${STRIP_COMMENTS} $SYSTEM_PACKAGES_FILE)) + 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" + ;; + $RECOMMENDED_SPKG_PATTERN:*) + RECOMMENDED_SYSTEM_PACKAGES+=" $PKG_SYSTEM_PACKAGES" + ;; + *) + OPTIONAL_SYSTEM_PACKAGES+=" $PKG_SYSTEM_PACKAGES" + ;; + esac + else + case "$PKG_TYPE" in + standard) + SAGELIB_SYSTEM_PACKAGES+=" $PKG_SYSTEM_PACKAGES" + ;; + *) + SAGELIB_OPTIONAL_SYSTEM_PACKAGES+=" $PKG_SYSTEM_PACKAGES" + ;; + esac + fi + fi +done +echo >&2 $0:$LINENO: generate conda enviroment files +echo "name: sage-build" > environment.yml +echo "channels:" >> environment.yml +echo " - conda-forge" >> environment.yml +echo " - nodefaults" >> environment.yml +echo "dependencies:" >> environment.yml +for pkg in $SYSTEM_PACKAGES; do + echo " - $pkg" >> environment.yml +done +echo " # Packages needed for ./bootstrap" >> environment.yml +for pkg in $BOOTSTRAP_PACKAGES; do + echo " - $pkg" >> environment.yml +done +sed 's/name: sage-build/name: sage/' environment.yml > src/environment.yml +for pkg in $SAGELIB_SYSTEM_PACKAGES; do + echo " - $pkg" >> src/environment.yml +done +sed 's/name: sage/name: sage-dev/' src/environment.yml > src/environment-dev.yml +echo " # Additional dev tools" >> src/environment-dev.yml +echo " - openssh" >> src/environment-dev.yml +echo " - pycodestyle" >> src/environment-dev.yml +echo " - pytest" >> src/environment-dev.yml + +cp environment.yml environment-optional.yml + echo " # optional packages" >> environment-optional.yml +for pkg in $OPTIONAL_SYSTEM_PACKAGES; do + echo " - $pkg" >> environment-optional.yml + done +cp src/environment.yml src/environment-optional.yml + echo " # optional packages" >> src/environment-optional.yml +for pkg in $OPTIONAL_SYSTEM_PACKAGES $SAGELIB_OPTIONAL_SYSTEM_PACKAGES; do + echo " - $pkg" >> src/environment-optional.yml +done diff --git a/src/doc/bootstrap b/src/doc/bootstrap index 14886524d58..90ae09160ba 100755 --- a/src/doc/bootstrap +++ b/src/doc/bootstrap @@ -27,7 +27,7 @@ shopt -s extglob RECOMMENDED_SPKG_PATTERN="@(_recommended$(for a in $(head -n 1 build/pkgs/_recommended/dependencies); do echo -n "|"$a; done))" -for SYSTEM in arch debian fedora cygwin homebrew conda; do +for SYSTEM in arch debian fedora cygwin homebrew; do SYSTEM_PACKAGES= OPTIONAL_SYSTEM_PACKAGES= SAGELIB_SYSTEM_PACKAGES= @@ -63,51 +63,13 @@ for SYSTEM in arch debian fedora cygwin homebrew conda; do fi fi done - if [ "${SYSTEM}" = "conda" ]; then - if [ "${BOOTSTRAP_QUIET}" = "no" ]; then - echo >&2 $0:$LINENO: generate conda enviroment files - fi - echo "name: sage-build" > environment.yml - echo "channels:" >> environment.yml - echo " - conda-forge" >> environment.yml - echo " - nodefaults" >> environment.yml - echo "dependencies:" >> environment.yml - for pkg in $SYSTEM_PACKAGES; do - echo " - $pkg" >> environment.yml - done - sed 's/name: sage-build/name: sage/' environment.yml > src/environment.yml - for pkg in $SAGELIB_SYSTEM_PACKAGES; do - echo " - $pkg" >> src/environment.yml - done - sed 's/name: sage/name: sage-dev/' src/environment.yml > src/environment-dev.yml - echo " # Packages needed for ./bootstrap" >> src/environment-dev.yml - BOOTSTRAP_PACKAGES=$(echo $(${STRIP_COMMENTS} build/pkgs/_bootstrap/distros/conda.txt)) - for pkg in $BOOTSTRAP_PACKAGES; do - echo " - $pkg" >> src/environment-dev.yml - done - echo " # Additional dev tools" >> src/environment-dev.yml - echo " - openssh" >> src/environment-dev.yml - echo " - pycodestyle" >> src/environment-dev.yml - echo " - pytest" >> src/environment-dev.yml - - cp environment.yml environment-optional.yml - echo " # optional packages" >> environment-optional.yml - for pkg in $OPTIONAL_SYSTEM_PACKAGES; do - echo " - $pkg" >> environment-optional.yml - done - cp src/environment.yml src/environment-optional.yml - echo " # optional packages" >> src/environment-optional.yml - for pkg in $OPTIONAL_SYSTEM_PACKAGES $SAGELIB_OPTIONAL_SYSTEM_PACKAGES; do - echo " - $pkg" >> src/environment-optional.yml - done - else - if [ "${BOOTSTRAP_QUIET}" = "no" ]; then - echo >&2 $0:$LINENO: installing "$OUTPUT_DIR"/$SYSTEM"*.txt" - fi - echo "$(sage-print-system-package-command $SYSTEM --prompt --sudo install $(echo $(echo $SYSTEM_PACKAGES | xargs -n 1 echo | sort | uniq)))" > "$OUTPUT_DIR"/$SYSTEM.txt - echo "$(sage-print-system-package-command $SYSTEM --prompt --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 --sudo install $(echo $(echo $RECOMMENDED_SYSTEM_PACKAGES | xargs -n 1 echo | sort | uniq)))" > "$OUTPUT_DIR"/$SYSTEM-recommended.txt + + if [ "${BOOTSTRAP_QUIET}" = "no" ]; then + echo >&2 $0:$LINENO: installing "$OUTPUT_DIR"/$SYSTEM"*.txt" fi + echo "$(sage-print-system-package-command $SYSTEM --prompt --sudo install $(echo $(echo $SYSTEM_PACKAGES | xargs -n 1 echo | sort | uniq)))" > "$OUTPUT_DIR"/$SYSTEM.txt + echo "$(sage-print-system-package-command $SYSTEM --prompt --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 --sudo install $(echo $(echo $RECOMMENDED_SYSTEM_PACKAGES | xargs -n 1 echo | sort | uniq)))" > "$OUTPUT_DIR"/$SYSTEM-recommended.txt done OUTPUT_DIR="src/doc/en/reference/spkg" diff --git a/src/environment-dev.yml b/src/environment-dev.yml deleted file mode 100644 index bef6a1f4a2b..00000000000 --- a/src/environment-dev.yml +++ /dev/null @@ -1,206 +0,0 @@ -name: sage-dev -channels: - - conda-forge - - nodefaults -dependencies: - - compilers - - make - - m4 - - perl - - python - - tar - - bc - - pkg-config - - arb - - boost-cpp - - brial - - bzip2 - - cddlib - - cliquer - - cmake - - curl - - ecl - - eclib - - ecm - - fflas-ffpack - - libflint - - flintqs - - fplll - - freetype - - bdw-gc - - gengetopt - - gf2x - - gfan - - fortran-compiler - - giac - - givaro - - glpk - - gmp - - gsl - - iml - - lcalc - - libatomic_ops - - libbraiding - - libffi - - libgd - - libhomfly - - xz - - libpng - - linbox - - lrcalc - - m4ri - - m4rie - - mpc - - mpfi - - mpfr - - nauty - - ncurses - - ntl - - openblas - - blas=2.*=openblas - - openssl - - palp - - pari - - pari-elldata - - pari-galdata - - pari-galpol - - pari-seadata - - pari-galdata - - pari-seadata-small - - patch - - pcre - - pkg-config - - planarity - - ppl - - primecount - - primesieve - - qhull - - r - - r-essentials - - readline - - rw - - singular - - sqlite - - suitesparse - - symmetrica - - sympow - - tachyon - - tox - - xz - - zeromq - - zlib - - zn_poly - - alabaster - - attrs - - babel - - backcall - - beautifulsoup4 - - bleach - - certifi - - cffi - - sagemath-db-combinatorial-designs - - sagemath-db-conway-polynomials - - cvxopt - - cycler - - cypari2 - - cysignals - - cython - - python-dateutil - - decorator - - defusedxml - - docutils - - sagemath-db-elliptic-curves - - entrypoints - - fpylll - - gap-defaults - - gmpy2 - - sagemath-db-graphs - - html5lib - - imagesize - - importlib_metadata - - ipykernel - - ipython - - ipython_genutils - - ipywidgets - - jedi - - jinja2 - - jmol - - jsonschema - - jupyter_client - - jupyter_core - - jupyter_sphinx - - kiwisolver - - python-lrcalc - - markupsafe - - mathjax - - "matplotlib>=3.5.1" - - maxima - - memory-allocator - - mistune - - mpmath - - nbconvert - - nbformat - - networkx - - notebook - - numpy - - packaging - - pandocfilters - - parso - - pexpect - - pickleshare - - pillow - - pip - - pkgconfig - - sagemath-db-polytopes - - pplpy - - primecountpy - - prometheus_client - - prompt_toolkit - - ptyprocess - - pybind11 - - pycparser - - pygments - - pyparsing - - pyrsistent - - pytz - - pyzmq - - requests - - rpy2 - - sagetex - - scipy - - send2trash - - setuptools - - setuptools_scm - - simplegeneric - - six - - snowballstemmer - - sphinx - - sphinxcontrib-applehelp - - sphinxcontrib-devhelp - - sphinxcontrib-htmlhelp - - sphinxcontrib-jsmath - - sphinxcontrib-qthelp - - sphinxcontrib-serializinghtml - - sphinxcontrib-websupport - - sympy - - terminado - - testpath - - three.js - - tornado - - traitlets - - tzlocal - - vcversioner - - wcwidth - - webencodings - - wheel - - widgetsnbextension - - zipp - # Packages needed for ./bootstrap - - gettext - - autoconf - - automake - - libtool - # Additional dev tools - - openssh - - pycodestyle - - pytest From 2a8c1c3e160f15b27fcd51efc97c491009ab7aac Mon Sep 17 00:00:00 2001 From: Tobias Diez Date: Sun, 1 May 2022 10:27:07 +0000 Subject: [PATCH 04/15] Invoke bootstrap-conda during bootstrap --- bootstrap | 1 + 1 file changed, 1 insertion(+) diff --git a/bootstrap b/bootstrap index afe67841f96..d059afc0482 100755 --- a/bootstrap +++ b/bootstrap @@ -158,6 +158,7 @@ SAGE_SPKG_FINALIZE([$pkgname], [$pkgtype], [$SPKG_SOURCE], [$SPKG_TREE_VAR])" # ONLY stderr, and to re-output the results back to stderr leaving # stdout alone. Basically we swap the two descriptors using a # third, filter, and then swap them back. + ./bootstrap-conda && \ src/doc/bootstrap && \ install_config_rpath && \ aclocal -I m4 && \ From 7f51ef0980537fcf2158c453ada6f8d5648ea38d Mon Sep 17 00:00:00 2001 From: Tobias Diez Date: Sun, 1 May 2022 10:27:24 +0000 Subject: [PATCH 05/15] Also delete dev env config file --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index 9e8955a07f6..08c0d1b6beb 100644 --- a/Makefile +++ b/Makefile @@ -171,6 +171,7 @@ bootstrap-clean: rm -f src/doc/en/reference/repl/*.txt rm -f environment.yml rm -f src/environment.yml + rm -f src/environment-dev.yml rm -f environment-optional.yml rm -f src/environment-optional.yml rm -f src/Pipfile From d091d2772f6f6b9db2b9ae29dc5a1570d323d734 Mon Sep 17 00:00:00 2001 From: Tobias Diez Date: Sun, 1 May 2022 11:17:36 +0000 Subject: [PATCH 06/15] Update documentation --- .vscode/settings.json | 4 +++ src/doc/en/installation/conda.rst | 50 ++++++++++++------------------- 2 files changed, 23 insertions(+), 31 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 5844f80998f..82b8dd69b5d 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -19,4 +19,8 @@ "src" ], "python.testing.unittestEnabled": false, + "cSpell.words": [ + "Conda", + "Cython" + ], } diff --git a/src/doc/en/installation/conda.rst b/src/doc/en/installation/conda.rst index 153456747eb..a56d090f55e 100644 --- a/src/doc/en/installation/conda.rst +++ b/src/doc/en/installation/conda.rst @@ -48,25 +48,22 @@ To use Sage from there, Using conda to provide system packages for the Sage distribution ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -If Conda is installed (check by typing ``conda info``), there are two ways to -prepare for installing SageMath from source: +If Conda is installed (check by typing ``conda info``), one can install SageMath +from source as follows: - If you are using a git checkout:: - $ ./bootstrap + $ ./bootstrap-conda - - Create a new empty environment and activate:: + - Create a new conda environment including all standard packages + recognized by sage, and activate it:: - $ conda create -n sage-build + $ conda env create --file environment.yml $ conda activate sage-build - - Install standard packages recognized by sage's ``spkg-configure`` mechanism:: - - $ conda env update --file environment.yml -n sage-build - - - Or install all standard and optional packages recognized by sage:: - - $ conda env update --file environment-optional.yml -n sage-build + Alternatively, use ``environment-optional.yml`` in place of + ``environment.yml`` to create an environment with all standard and optional + packages recognized by sage. - Then the SageMath distribution will be built using the compilers provided by Conda and using many packages installed by Conda:: @@ -100,29 +97,20 @@ Here we assume that you are using a git checkout. $ conda install mamba - - Create and activate a new conda environment that provides the - bootstrapping prerequisites. You can replace 3.9 by another Python - version:: - - $ mamba create -n sage-build python=3.9 \ - gettext autoconf automake libtool pkg-config - $ conda activate sage-build - - - Run ``bootstrap``; this generates the files ``src/environment*.yml`` used + - Generate the conda environment files ``src/environment*.yml`` used in the next step:: - $ ./bootstrap - - - Populate the conda environment with the dependencies of Sage:: + $ ./bootstrap-conda - $ mamba env update -n sage-build -f src/environment.yml # alternatively, use + - Create and activate a new conda environment with the dependencies of Sage + and a few additional developer tools:: - Alternatively, you can use ``src/environment-optional.yml``, which will - install some additional packages. + $ mamba env create --file src/environment-dev.yml + $ conda activate sage-dev - - Activate the conda environment again:: - - $ conda activate sage-build + Alternatively, you can use ``src/environment.yml`` or + ``src/environment-optional.yml``, which will only install standard + (and optional) packages without any additional developer tools. - Run the ``configure`` script:: @@ -147,7 +135,7 @@ Here we assume that you are using a git checkout. $ sage -c 'print(version())' SageMath version 9.6.beta5, Release Date: 2022-03-12 -Note that ``make`` is not used at all. All dependencies +Note that ``make`` is not used at all. All dependencies (including all Python packages) are provided by conda. Thus, you will get a working version of Sage much faster. However, From 0716595df2c4fbcf312dc9aab4039656e3b87efe Mon Sep 17 00:00:00 2001 From: Tobias Diez Date: Mon, 2 May 2022 15:06:13 +0000 Subject: [PATCH 07/15] Add missing bootstrap and combine pip install command --- src/doc/en/installation/conda.rst | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/doc/en/installation/conda.rst b/src/doc/en/installation/conda.rst index 9eb026862ef..fc79c6974ce 100644 --- a/src/doc/en/installation/conda.rst +++ b/src/doc/en/installation/conda.rst @@ -121,6 +121,7 @@ Here we assume that you are using a git checkout. - Run the ``configure`` script:: + $ ./bootstrap $ ./configure --with-python=$CONDA_PREFIX/bin/python \ --prefix=$CONDA_PREFIX \ $(for pkg in $(./sage -package list :standard: \ @@ -129,13 +130,9 @@ Here we assume that you are using a git checkout. echo --with-system-$pkg=force; \ done) - - Install the build prerequisites of the Sage library:: - - $ pip install --no-build-isolation -v -v --editable pkgs/sage-conf pkgs/sage-setup - - - Install the Sage library:: + - Install the build prerequisites and the Sage library:: - $ pip install --no-build-isolation -v -v --editable src + $ pip install --no-build-isolation -v -v --editable pkgs/sage-conf pkgs/sage-setup src - Verify that Sage has been installed:: @@ -154,6 +151,6 @@ library is installed in editable mode. This means that when you only edit Python files, there is no need to rebuild the library; it suffices to restart Sage. -After editing any Cython files, rebuild by repeating the command:: +After editing any Cython files, rebuild the Sage library using:: $ pip install --no-build-isolation -v -v --editable src From 10338a76ce5812db62f4ac72a17e6c6330f1fb8c Mon Sep 17 00:00:00 2001 From: Tobias Diez Date: Mon, 2 May 2022 15:09:21 +0000 Subject: [PATCH 08/15] Change ci as well --- .github/workflows/ci-conda.yml | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci-conda.yml b/.github/workflows/ci-conda.yml index a91f2efe044..42b15c52555 100644 --- a/.github/workflows/ci-conda.yml +++ b/.github/workflows/ci-conda.yml @@ -43,15 +43,8 @@ jobs: bash ~/miniconda.sh -b -p $HOME/miniconda echo "CONDA=$HOME/miniconda" >> $GITHUB_ENV - - name: Install bootstrap prerequisites - run: | - export PATH="$(pwd)/build/bin:$PATH" - SYSTEM=$(sage-guess-package-system) - eval $(sage-print-system-package-command $SYSTEM --sudo install $(sage-get-system-packages $SYSTEM _bootstrap)) - - # Create conda environment file - - name: Bootstrap - run: ./bootstrap + - name: Create conda environment files + run: ./bootstrap-conda - name: Cache conda packages uses: actions/cache@v2 @@ -80,6 +73,7 @@ jobs: shell: bash -l {0} continue-on-error: true run: | + ./bootstrap echo "::add-matcher::.github/workflows/configure-systempackage-problem-matcher.json" ./configure --enable-build-as-root --with-python=$CONDA_PREFIX/bin/python --prefix=$CONDA_PREFIX $(for pkg in $(./sage -package list :standard: --has-file spkg-configure.m4 --has-file distros/conda.txt); do echo --with-system-$pkg=force; done) echo "::remove-matcher owner=configure-system-package-warning::" @@ -88,8 +82,7 @@ jobs: - name: Build shell: bash -l {0} run: | - pip install --no-build-isolation -v -v -e pkgs/sage-conf pkgs/sage-setup - pip install --no-build-isolation -v -v -e src + pip install --no-build-isolation -v -v -e pkgs/sage-conf pkgs/sage-setup src env: SAGE_NUM_THREADS: 2 From 0cf7334736fa9ec9fb2af8099722767fea2bdc0d Mon Sep 17 00:00:00 2001 From: Tobias Diez Date: Tue, 3 May 2022 22:07:53 +0000 Subject: [PATCH 09/15] Add sage-setup as install-requires dep --- src/setup.cfg.m4 | 1 + 1 file changed, 1 insertion(+) diff --git a/src/setup.cfg.m4 b/src/setup.cfg.m4 index aff2e5d7cf8..8cd7753b55a 100644 --- a/src/setup.cfg.m4 +++ b/src/setup.cfg.m4 @@ -30,6 +30,7 @@ python_requires = >=3.7, <3.11 install_requires = esyscmd(`sage-get-system-packages install-requires \ sage_conf \ + sage_setup \ six \ | sed "2,\$s/^/ /;"')dnl' dnl From build/pkgs/sagelib/dependencies From 6d2b14978335da5bfd8148266183a8abd5f32cce Mon Sep 17 00:00:00 2001 From: Tobias Diez Date: Tue, 3 May 2022 23:11:22 +0000 Subject: [PATCH 10/15] Use relative paths to not install src package --- .github/workflows/ci-conda.yml | 2 +- src/doc/en/installation/conda.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-conda.yml b/.github/workflows/ci-conda.yml index 42b15c52555..b8f551e2d63 100644 --- a/.github/workflows/ci-conda.yml +++ b/.github/workflows/ci-conda.yml @@ -82,7 +82,7 @@ jobs: - name: Build shell: bash -l {0} run: | - pip install --no-build-isolation -v -v -e pkgs/sage-conf pkgs/sage-setup src + pip install --no-build-isolation -v -v -e ./pkgs/sage-conf ./pkgs/sage-setup ./src env: SAGE_NUM_THREADS: 2 diff --git a/src/doc/en/installation/conda.rst b/src/doc/en/installation/conda.rst index fc79c6974ce..611b99a4684 100644 --- a/src/doc/en/installation/conda.rst +++ b/src/doc/en/installation/conda.rst @@ -132,7 +132,7 @@ Here we assume that you are using a git checkout. - Install the build prerequisites and the Sage library:: - $ pip install --no-build-isolation -v -v --editable pkgs/sage-conf pkgs/sage-setup src + $ pip install --no-build-isolation -v -v --editable ./pkgs/sage-conf ./pkgs/sage-setup ./src - Verify that Sage has been installed:: From 1dba3ba01d15153940f310a9e1c427f00d4460d6 Mon Sep 17 00:00:00 2001 From: Tobias Diez Date: Tue, 3 May 2022 23:15:25 +0000 Subject: [PATCH 11/15] Maybe thats the correct shebang? --- bootstrap-conda | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bootstrap-conda b/bootstrap-conda index 9fac4e8d58a..356c621895b 100755 --- a/bootstrap-conda +++ b/bootstrap-conda @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash ######################################################################## # Generate auto-generated conda environment files From c1b2fbf6b82fb388cbb143453b2eeaa428b604ff Mon Sep 17 00:00:00 2001 From: Tobias Diez Date: Tue, 3 May 2022 23:31:40 +0000 Subject: [PATCH 12/15] Revert install_requires change --- src/setup.cfg.m4 | 1 - 1 file changed, 1 deletion(-) diff --git a/src/setup.cfg.m4 b/src/setup.cfg.m4 index 8cd7753b55a..aff2e5d7cf8 100644 --- a/src/setup.cfg.m4 +++ b/src/setup.cfg.m4 @@ -30,7 +30,6 @@ python_requires = >=3.7, <3.11 install_requires = esyscmd(`sage-get-system-packages install-requires \ sage_conf \ - sage_setup \ six \ | sed "2,\$s/^/ /;"')dnl' dnl From build/pkgs/sagelib/dependencies From ad56ba3dab303edea7cdd2d449c69feaaf624beb Mon Sep 17 00:00:00 2001 From: Tobias Diez Date: Wed, 4 May 2022 09:40:18 +0000 Subject: [PATCH 13/15] Go back to two pip installs for now --- .github/workflows/ci-conda.yml | 3 ++- src/doc/en/installation/conda.rst | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-conda.yml b/.github/workflows/ci-conda.yml index b8f551e2d63..74e37b3a408 100644 --- a/.github/workflows/ci-conda.yml +++ b/.github/workflows/ci-conda.yml @@ -82,7 +82,8 @@ jobs: - name: Build shell: bash -l {0} run: | - pip install --no-build-isolation -v -v -e ./pkgs/sage-conf ./pkgs/sage-setup ./src + pip install --no-build-isolation -v -v -e ./pkgs/sage-conf ./pkgs/sage-setup + pip install --no-build-isolation -v -v -e ./src env: SAGE_NUM_THREADS: 2 diff --git a/src/doc/en/installation/conda.rst b/src/doc/en/installation/conda.rst index 611b99a4684..7b9d21a0772 100644 --- a/src/doc/en/installation/conda.rst +++ b/src/doc/en/installation/conda.rst @@ -132,7 +132,8 @@ Here we assume that you are using a git checkout. - Install the build prerequisites and the Sage library:: - $ pip install --no-build-isolation -v -v --editable ./pkgs/sage-conf ./pkgs/sage-setup ./src + $ pip install --no-build-isolation -v -v --editable ./pkgs/sage-conf ./pkgs/sage-setup + $ pip install --no-build-isolation -v -v --editable ./src - Verify that Sage has been installed:: From b42f5f51e716d6d01cb491699220ba42c674cd5c Mon Sep 17 00:00:00 2001 From: Tobias Diez Date: Sun, 8 May 2022 08:39:10 +0000 Subject: [PATCH 14/15] Readd how to use specific python version --- src/doc/en/installation/conda.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/doc/en/installation/conda.rst b/src/doc/en/installation/conda.rst index 7b9d21a0772..36b1834cca3 100644 --- a/src/doc/en/installation/conda.rst +++ b/src/doc/en/installation/conda.rst @@ -119,6 +119,10 @@ Here we assume that you are using a git checkout. ``src/environment-optional.yml``, which will only install standard (and optional) packages without any additional developer tools. + By default, the most recent version of Python supported by Sage is + installed. You can use the additional option ``python=3.9`` in the above + ``env create`` command to use another Python version (here 3.9). + - Run the ``configure`` script:: $ ./bootstrap From 87f360ca7a4703b6c45ad3427363ccf4ae531b2c Mon Sep 17 00:00:00 2001 From: Tobias Diez Date: Mon, 9 May 2022 11:47:37 +0000 Subject: [PATCH 15/15] Readd name arg --- src/doc/en/installation/conda.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/doc/en/installation/conda.rst b/src/doc/en/installation/conda.rst index 36b1834cca3..b9f70332a0d 100644 --- a/src/doc/en/installation/conda.rst +++ b/src/doc/en/installation/conda.rst @@ -62,7 +62,7 @@ from source as follows: - Create a new conda environment including all standard packages recognized by sage, and activate it:: - $ conda env create --file environment.yml + $ conda env create --file environment.yml --name sage-build $ conda activate sage-build Alternatively, use ``environment-optional.yml`` in place of @@ -98,7 +98,7 @@ Here we assume that you are using a git checkout. $ export SAGE_NUM_THREADS=24 - - As a recommended step, install the ``mamba`` package manager. If + - As a recommended step, install the ``mamba`` package manager. If you skip this step, replace ``mamba`` by ``conda`` in the following steps:: @@ -112,7 +112,7 @@ Here we assume that you are using a git checkout. - Create and activate a new conda environment with the dependencies of Sage and a few additional developer tools:: - $ mamba env create --file src/environment-dev.yml + $ mamba env create --file src/environment-dev.yml --name sage-dev $ conda activate sage-dev Alternatively, you can use ``src/environment.yml`` or @@ -121,7 +121,7 @@ Here we assume that you are using a git checkout. By default, the most recent version of Python supported by Sage is installed. You can use the additional option ``python=3.9`` in the above - ``env create`` command to use another Python version (here 3.9). + ``env create`` command to select another Python version (here 3.9). - Run the ``configure`` script::