diff --git a/bootstrap-conda b/bootstrap-conda index c64e2a72b6c..aa009b63343 100755 --- a/bootstrap-conda +++ b/bootstrap-conda @@ -17,6 +17,8 @@ OPTIONAL_PACKAGES= SAGELIB_PACKAGES= SAGELIB_OPTIONAL_PACKAGES= DEVELOP_PACKAGES= +UNCONSTRAINED_PACKAGES= +CONSTRAINED_PACKAGES= eval $(sage-package properties --format=shell :all:) @@ -25,6 +27,15 @@ for PKG_BASE in $(sage-package list --has-file distros/conda.txt --exclude _sage SYSTEM_PACKAGES_FILE=$PKG_SCRIPTS/distros/conda.txt PKG_SYSTEM_PACKAGES=$(echo $(${STRIP_COMMENTS} $SYSTEM_PACKAGES_FILE)) if [ -n "$PKG_SYSTEM_PACKAGES" ]; then + case "$PKG_SYSTEM_PACKAGES" in + *([-A-Za-z0-9_ ])) # just a package name + UNCONSTRAINED_PACKAGES+=" $PKG_BASE" + ;; + *) # a package name with version constraints or other decorations; + # we never remove such packages when minimizing package lists + CONSTRAINED_PACKAGES+=" $PKG_BASE" + ;; + esac if [ -f $PKG_SCRIPTS/spkg-configure.m4 ]; then if grep -q SAGE_PYTHON_PACKAGE_CHECK $PKG_SCRIPTS/spkg-configure.m4; then # Python package that would need --enable-system-site-packages to be used @@ -67,7 +78,34 @@ for PKG_BASE in $(sage-package list --has-file distros/conda.txt --exclude _sage done unset PKG_SYSTEM_PACKAGES -[ -n "$BOOTSTRAP_VERBOSE" ] && echo "## Collected:" && set | grep PACKAGES= +[ -n "$BOOTSTRAP_VERBOSE" ] && printf "##\n## Collected:\n##\n" && set | grep PACKAGES= + +# Minimize + + PACKAGES=$(sage-package list $(sage-package list --include-dependencies $PACKAGES --exclude $UNCONSTRAINED_PACKAGES) \ + $(sage-package list --exclude-dependencies $PACKAGES)) + + BOOTSTRAP_PACKAGES=$(sage-package list $(sage-package list --include-dependencies $BOOTSTRAP_PACKAGES --exclude $UNCONSTRAINED_PACKAGES) \ + $(sage-package list --exclude-dependencies $BOOTSTRAP_PACKAGES) \ + --exclude $(sage-package list --include-dependencies $PACKAGES)) + + DEVELOP_PACKAGES=$(sage-package list $(sage-package list --include-dependencies $DEVELOP_PACKAGES --exclude $UNCONSTRAINED_PACKAGES) \ + $(sage-package list --exclude-dependencies $DEVELOP_PACKAGES) \ + --exclude $(sage-package list --include-dependencies $PACKAGES $BOOTSTRAP_PACKAGES)) + + OPTIONAL_PACKAGES=$(sage-package list $(sage-package list --include-dependencies $OPTIONAL_PACKAGES --exclude $UNCONSTRAINED_PACKAGES) \ + $(sage-package list --exclude-dependencies $OPTIONAL_PACKAGES) \ + --exclude $(sage-package list --include-dependencies $PACKAGES $BOOTSTRAP_PACKAGES)) + + SAGELIB_PACKAGES=$(sage-package list $(sage-package list --include-dependencies $SAGELIB_PACKAGES --exclude $UNCONSTRAINED_PACKAGES) \ + $(sage-package list --exclude-dependencies $SAGELIB_PACKAGES) \ + --exclude $(sage-package list --include-dependencies $PACKAGES $BOOTSTRAP_PACKAGES)) + +SAGELIB_OPTIONAL_PACKAGES=$(sage-package list $(sage-package list --include-dependencies $SAGELIB_OPTIONAL_PACKAGES --exclude $UNCONSTRAINED_PACKAGES) \ + $(sage-package list --exclude-dependencies $SAGELIB_OPTIONAL_PACKAGES) \ + --exclude $(sage-package list --include-dependencies $PACKAGES $BOOTSTRAP_PACKAGES $SAGELIB_PACKAGES $OPTIONAL_PACKAGES)) + +[ -n "$BOOTSTRAP_VERBOSE" ] && printf "##\n## Minimized:\n##\n" && set | grep PACKAGES= # Translate to system packages export ENABLE_SYSTEM_SITE_PACKAGES=yes # Disable filtering in sage-get-system-packages @@ -79,7 +117,7 @@ SAGELIB_OPTIONAL_SYSTEM_PACKAGES=$(sage-get-system-packages conda $SAGELIB_OPTIO DEVELOP_SYSTEM_PACKAGES=$(sage-get-system-packages conda $DEVELOP_PACKAGES) unset ENABLE_SYSTEM_SITE_PACKAGES -[ -n "$BOOTSTRAP_VERBOSE" ] && echo "## Translated to system:" && set | grep SYSTEM_PACKAGES= +[ -n "$BOOTSTRAP_VERBOSE" ] && printf "##\n## Translated to system:\n##\n" && set | grep SYSTEM_PACKAGES= echo >&2 $0:$LINENO: generate conda environment files @@ -133,6 +171,7 @@ echo >&2 $0:$LINENO: generate conda environment files ( echo >&4 " - pip:" echo >&5 " - pip:" + echo >&6 " - pip:" for PKG_BASE in $(sage-package list :standard: :optional: --has-file requirements.txt --no-file distros/conda.txt --no-file src; sage-package list :standard: :optional: --has-file version_requirements.txt --no-file requirements.txt --no-file distros/conda.txt --no-file src); do eval PKG_SCRIPTS=\$path_$PKG_BASE PKG_TYPE=\$type_$PKG_BASE SYSTEM_PACKAGES_FILE=$PKG_SCRIPTS/requirements.txt @@ -144,7 +183,7 @@ echo >&2 $0:$LINENO: generate conda environment files else case "$PKG_BASE:$PKG_TYPE" in $DEVELOP_SPKG_PATTERN:*) FD=4;; - *:standard) FD="4 5";; + *:standard) FD="4 5 6";; *) FD=5;; esac ${STRIP_COMMENTS} $SYSTEM_PACKAGES_FILE | while read -r line; do @@ -152,7 +191,7 @@ echo >&2 $0:$LINENO: generate conda environment files done fi done - ) 4>> /dev/null 5>> src/environment-optional-template.yml + ) 4>> /dev/null 5>> src/environment-optional-template.yml 6>>src/environment-template.yml for f in environment environment-optional src/environment src/environment-optional src/environment-dev; do for python_version in 3.9 3.10 3.11; do diff --git a/build/pkgs/argon2_cffi_bindings/distros/conda.txt b/build/pkgs/argon2_cffi_bindings/distros/conda.txt new file mode 100644 index 00000000000..50485097375 --- /dev/null +++ b/build/pkgs/argon2_cffi_bindings/distros/conda.txt @@ -0,0 +1 @@ +argon2-cffi-bindings diff --git a/build/pkgs/brial/dependencies b/build/pkgs/brial/dependencies index fdc17b08c96..b1478c5d070 100644 --- a/build/pkgs/brial/dependencies +++ b/build/pkgs/brial/dependencies @@ -1,4 +1,4 @@ -boost_cropped m4ri libpng | pkgconf +m4ri libpng | pkgconf boost_cropped ---------- All lines of this file are ignored except the first. diff --git a/build/pkgs/cachetools/distros/conda.txt b/build/pkgs/cachetools/distros/conda.txt new file mode 100644 index 00000000000..50d14084a9b --- /dev/null +++ b/build/pkgs/cachetools/distros/conda.txt @@ -0,0 +1 @@ +cachetools diff --git a/build/pkgs/calver/distros/conda.txt b/build/pkgs/calver/distros/conda.txt new file mode 100644 index 00000000000..62948b78bc0 --- /dev/null +++ b/build/pkgs/calver/distros/conda.txt @@ -0,0 +1 @@ +calver diff --git a/build/pkgs/chardet/distros/conda.txt b/build/pkgs/chardet/distros/conda.txt new file mode 100644 index 00000000000..79236f25cda --- /dev/null +++ b/build/pkgs/chardet/distros/conda.txt @@ -0,0 +1 @@ +chardet diff --git a/build/pkgs/cliquer/distros/conda.txt b/build/pkgs/cliquer/distros/conda.txt index 524938db8e3..64789e8d478 100644 --- a/build/pkgs/cliquer/distros/conda.txt +++ b/build/pkgs/cliquer/distros/conda.txt @@ -1 +1,3 @@ -cliquer +cliquer>=1.21 +# We include the version constraint so that bootstrap-conda's environment minimizer +# does not eliminate it (as a declared dependency of the giac SPKG) diff --git a/build/pkgs/colorama/distros/conda.txt b/build/pkgs/colorama/distros/conda.txt new file mode 100644 index 00000000000..3fcfb51b2ad --- /dev/null +++ b/build/pkgs/colorama/distros/conda.txt @@ -0,0 +1 @@ +colorama diff --git a/build/pkgs/contourpy/distros/conda.txt b/build/pkgs/contourpy/distros/conda.txt new file mode 100644 index 00000000000..4c311115d71 --- /dev/null +++ b/build/pkgs/contourpy/distros/conda.txt @@ -0,0 +1 @@ +contourpy diff --git a/build/pkgs/e_antic/dependencies b/build/pkgs/e_antic/dependencies index 8e977a55c13..2f44f9420a2 100644 --- a/build/pkgs/e_antic/dependencies +++ b/build/pkgs/e_antic/dependencies @@ -1,4 +1,4 @@ -$(MP_LIBRARY) flint boost_cropped +$(MP_LIBRARY) flint | boost_cropped ---------- All lines of this file are ignored except the first. diff --git a/build/pkgs/ecl/distros/conda.txt b/build/pkgs/ecl/distros/conda.txt index 100aa2efb32..9394ddfe11b 100644 --- a/build/pkgs/ecl/distros/conda.txt +++ b/build/pkgs/ecl/distros/conda.txt @@ -1 +1 @@ -ecl +ecl>=21.2.1 diff --git a/build/pkgs/gc/distros/conda.txt b/build/pkgs/gc/distros/conda.txt index f09f27a449a..b414550bad2 100644 --- a/build/pkgs/gc/distros/conda.txt +++ b/build/pkgs/gc/distros/conda.txt @@ -1 +1 @@ -bdw-gc +bdw-gc>=7.6.4 diff --git a/build/pkgs/hatch_fancy_pypi_readme/distros/conda.txt b/build/pkgs/hatch_fancy_pypi_readme/distros/conda.txt new file mode 100644 index 00000000000..6d9a1f85903 --- /dev/null +++ b/build/pkgs/hatch_fancy_pypi_readme/distros/conda.txt @@ -0,0 +1 @@ +hatch-fancy-pypi-readme diff --git a/build/pkgs/hatch_nodejs_version/distros/conda.txt b/build/pkgs/hatch_nodejs_version/distros/conda.txt new file mode 100644 index 00000000000..5c606fe80f5 --- /dev/null +++ b/build/pkgs/hatch_nodejs_version/distros/conda.txt @@ -0,0 +1 @@ +hatch-nodejs-version diff --git a/build/pkgs/hatch_vcs/distros/conda.txt b/build/pkgs/hatch_vcs/distros/conda.txt new file mode 100644 index 00000000000..04e2069fbb3 --- /dev/null +++ b/build/pkgs/hatch_vcs/distros/conda.txt @@ -0,0 +1 @@ +hatch-vcs diff --git a/build/pkgs/jupymake/distros/conda.txt b/build/pkgs/jupymake/distros/conda.txt new file mode 100644 index 00000000000..cbe1e95bc17 --- /dev/null +++ b/build/pkgs/jupymake/distros/conda.txt @@ -0,0 +1 @@ +# The presence of this file ensures that we do not try to pip-install JuPyMake (there is no polymake conda package). diff --git a/build/pkgs/jupyterlab_widgets/distros/conda.txt b/build/pkgs/jupyterlab_widgets/distros/conda.txt new file mode 100644 index 00000000000..185418ca78f --- /dev/null +++ b/build/pkgs/jupyterlab_widgets/distros/conda.txt @@ -0,0 +1 @@ +jupyterlab_widgets diff --git a/build/pkgs/libatomic_ops/distros/conda.txt b/build/pkgs/libatomic_ops/distros/conda.txt index a6f2a51c512..d26fc733055 100644 --- a/build/pkgs/libatomic_ops/distros/conda.txt +++ b/build/pkgs/libatomic_ops/distros/conda.txt @@ -1 +1 @@ -libatomic_ops +libatomic_ops>=7.6.2 diff --git a/build/pkgs/mathics/distros/conda.txt b/build/pkgs/mathics/distros/conda.txt deleted file mode 100644 index 800ac5e8aa4..00000000000 --- a/build/pkgs/mathics/distros/conda.txt +++ /dev/null @@ -1 +0,0 @@ -mathics3 diff --git a/build/pkgs/meson/distros/conda.txt b/build/pkgs/meson/distros/conda.txt new file mode 100644 index 00000000000..0b9952eaa15 --- /dev/null +++ b/build/pkgs/meson/distros/conda.txt @@ -0,0 +1 @@ +meson diff --git a/build/pkgs/meson_python/distros/conda.txt b/build/pkgs/meson_python/distros/conda.txt new file mode 100644 index 00000000000..9705cab644e --- /dev/null +++ b/build/pkgs/meson_python/distros/conda.txt @@ -0,0 +1 @@ +meson-python diff --git a/build/pkgs/papilo/dependencies b/build/pkgs/papilo/dependencies index 0ec4f49b131..91b517b965d 100644 --- a/build/pkgs/papilo/dependencies +++ b/build/pkgs/papilo/dependencies @@ -1 +1 @@ -$(MP_LIBRARY) boost_cropped onetbb $(BLAS) gfortran | cmake +$(MP_LIBRARY) onetbb $(BLAS) gfortran | cmake boost_cropped diff --git a/build/pkgs/pycygwin/distros/conda.txt b/build/pkgs/pycygwin/distros/conda.txt new file mode 100644 index 00000000000..ff24f9d7844 --- /dev/null +++ b/build/pkgs/pycygwin/distros/conda.txt @@ -0,0 +1 @@ +# The presence of this file ensures that we do not try to pip-install pycygwin -- which would fail with a compilation error diff --git a/build/pkgs/pyproject_api/distros/conda.txt b/build/pkgs/pyproject_api/distros/conda.txt new file mode 100644 index 00000000000..3f2ab4cb2a0 --- /dev/null +++ b/build/pkgs/pyproject_api/distros/conda.txt @@ -0,0 +1 @@ +pyproject-api diff --git a/build/pkgs/pyproject_metadata/distros/conda.txt b/build/pkgs/pyproject_metadata/distros/conda.txt new file mode 100644 index 00000000000..7ca7140f9d4 --- /dev/null +++ b/build/pkgs/pyproject_metadata/distros/conda.txt @@ -0,0 +1 @@ +pyproject-metadata diff --git a/build/pkgs/sagelib/dependencies b/build/pkgs/sagelib/dependencies index b1ebfd0825e..7e9f687c0ad 100644 --- a/build/pkgs/sagelib/dependencies +++ b/build/pkgs/sagelib/dependencies @@ -1,4 +1,4 @@ -FORCE $(SCRIPTS) boost_cropped $(BLAS) brial cliquer cypari cysignals cython ecl eclib ecm flint libgd gap giac givaro glpk gmpy2 gsl iml importlib_metadata importlib_resources jupyter_core lcalc lrcalc_python libbraiding libhomfly libpng linbox m4ri m4rie memory_allocator mpc mpfi mpfr $(MP_LIBRARY) ntl numpy pari pip pkgconfig planarity ppl pplpy primesieve primecount primecountpy $(PYTHON) requests rw sage_conf singular symmetrica typing_extensions $(PCFILES) | $(PYTHON_TOOLCHAIN) sage_setup $(PYTHON) pythran +FORCE $(SCRIPTS) $(BLAS) brial cliquer cypari cysignals cython ecl eclib ecm flint libgd gap giac givaro glpk gmpy2 gsl iml importlib_metadata importlib_resources jupyter_core lcalc lrcalc_python libbraiding libhomfly libpng linbox m4ri m4rie memory_allocator mpc mpfi mpfr $(MP_LIBRARY) ntl numpy pari pip pkgconfig planarity ppl pplpy primesieve primecount primecountpy $(PYTHON) requests rw sage_conf singular symmetrica typing_extensions $(PCFILES) | $(PYTHON_TOOLCHAIN) sage_setup $(PYTHON) pythran boost_cropped ---------- All lines of this file are ignored except the first. diff --git a/build/pkgs/soplex/dependencies b/build/pkgs/soplex/dependencies index 32c8bdd67ec..34ed6d2cf4f 100644 --- a/build/pkgs/soplex/dependencies +++ b/build/pkgs/soplex/dependencies @@ -1 +1 @@ -$(MP_LIBRARY) mpfr boost_cropped zlib papilo | cmake +$(MP_LIBRARY) mpfr zlib papilo | cmake boost_cropped diff --git a/build/pkgs/trove_classifiers/distros/conda.txt b/build/pkgs/trove_classifiers/distros/conda.txt new file mode 100644 index 00000000000..b8333e0eb25 --- /dev/null +++ b/build/pkgs/trove_classifiers/distros/conda.txt @@ -0,0 +1 @@ +trove-classifiers diff --git a/pkgs/sage-conf_conda/setup.py b/pkgs/sage-conf_conda/setup.py index 96f163dfe5a..91203f1decf 100644 --- a/pkgs/sage-conf_conda/setup.py +++ b/pkgs/sage-conf_conda/setup.py @@ -29,8 +29,8 @@ def run(self): 'See https://doc.sagemath.org/html/en/installation/conda.html on how to get started.') cmd = f"cd {SAGE_ROOT} && ./configure --enable-build-as-root --with-system-python3=force --disable-notebook --disable-sagelib --disable-sage_conf --disable-doc" - cmd += ' --with-python=$CONDA_PREFIX/bin/python --prefix="$CONDA_PREFIX"' - cmd += ' $(for pkg in $(PATH="build/bin:$PATH" build/bin/sage-package list :standard: --exclude rpy2 --has-file spkg-configure.m4 --has-file distros/conda.txt); do echo --with-system-$pkg=force; done)' + cmd += ' --with-python=$CONDA_PREFIX/bin/python --prefix="$CONDA_PREFIX" --enable-system-site-packages' + cmd += ' $(for pkg in $(PATH="build/bin:$PATH" build/bin/sage-package list :standard: --exclude rpy2 --has-file spkg-configure.m4 --has-file distros/conda.txt --exclude-dependencies); do echo --with-system-$pkg=force; done)' print(f"Running {cmd}") sys.stdout.flush() if os.system(cmd) != 0: