diff --git a/.github/workflows/ci-distro.yml b/.github/workflows/ci-distro.yml index c7957050fa6..813e27799f9 100644 --- a/.github/workflows/ci-distro.yml +++ b/.github/workflows/ci-distro.yml @@ -19,13 +19,8 @@ on: paths: - '.github/workflows/ci-distro.yml' - 'build/pkgs/**' + - 'build/make/**' - 'configure.ac' - - '!build/pkgs/sage_conf/**' - - '!build/pkgs/sage_docbuild/**' - - '!build/pkgs/sage_setup/**' - - '!build/pkgs/sage_sws2rst/**' - - '!build/pkgs/sagelib/**' - - '!build/pkgs/sagemath_*/**' push: tags: - '*' @@ -35,7 +30,7 @@ on: env: TARGETS_PRE: all-sage-local TARGETS: build - TARGETS_OPTIONAL: ptest + TARGETS_OPTIONAL: ptestlong permissions: packages: write @@ -56,7 +51,7 @@ jobs: # FIXME: duplicated from env.TARGETS targets_pre: all-sage-local targets: build - targets_optional: ptest + targets_optional: ptestlong tox_system_factors: >- ["ubuntu-jammy"] tox_packages_factors: >- @@ -71,7 +66,7 @@ jobs: docker_targets: "with-system-packages configured with-targets-pre with-targets with-targets-optional" targets_pre: all-sage-local targets: build - targets_optional: ptest + targets_optional: ptestlong tox_packages_factors: >- ["standard"] docker_push_repository: ghcr.io/${{ github.repository }}/ diff --git a/.github/workflows/dist.yml b/.github/workflows/dist.yml index 3d741390030..47b49bc16c8 100644 --- a/.github/workflows/dist.yml +++ b/.github/workflows/dist.yml @@ -241,7 +241,7 @@ jobs: run: | "${{ steps.python.outputs.python-path }}" -m pip install cibuildwheel==3.0.1 export PATH=build/bin:$PATH - echo CIBW_BEFORE_ALL="( $(sage-print-system-package-command debian --yes --no-install-recommends install $(sage-get-system-packages debian $SPKGS)) || $(sage-print-system-package-command fedora --yes --no-install-recommends install $(sage-get-system-packages fedora $SPKGS | sed s/pkg-config/pkgconfig/)) || ( $(sage-print-system-package-command homebrew --yes --no-install-recommends install $(sage-get-system-packages homebrew $SPKGS)) || $(sage-print-system-package-command alpine --yes --no-install-recommends install $(sage-get-system-packages alpine $SPKGS)) || echo error ignored) ) && if cp /host/sage-\$AUDITWHEEL_PLAT/config.status . 2>/dev/null; then chmod +x config.status; fi && if [ -x ./config.status ]; then ./config.status; else ./configure --enable-build-as-root ${{ startsWith(matrix.os, 'ubuntu') && '--prefix=/host/sage-\$AUDITWHEEL_PLAT' || '' }} && cp config.status prefix/; fi && MAKE=\"make -j6\" make V=0 $TARGETS_PRE && (echo \"sage_conf @ file://\$(pwd)/pkgs/sage-conf\" && echo \"sage_setup @ file://\$(pwd)/pkgs/sage-setup\") > constraints.txt" >> "$GITHUB_ENV" + echo CIBW_BEFORE_ALL="( $(sage-print-system-package-command debian --yes --no-install-recommends install $(sage-get-system-packages debian $SPKGS)) || $(sage-print-system-package-command fedora --yes --no-install-recommends install $(sage-get-system-packages fedora $SPKGS | sed s/pkg-config/pkgconfig/)) || ( $(sage-print-system-package-command homebrew --yes --no-install-recommends install $(sage-get-system-packages homebrew $SPKGS)) || $(sage-print-system-package-command alpine --yes --no-install-recommends install $(sage-get-system-packages alpine $SPKGS)) || echo error ignored) ) && if cp /host/sage-\$AUDITWHEEL_PLAT/config.status . 2>/dev/null; then chmod +x config.status; fi && if [ -x ./config.status ]; then ./config.status; else ./configure --enable-build-as-root ${{ startsWith(matrix.os, 'ubuntu') && '--prefix=/host/sage-\$AUDITWHEEL_PLAT' || '' }} && cp config.status prefix/; fi && MAKE=\"make -j6\" make V=0 $TARGETS_PRE && echo \"sage_setup @ file://\$(pwd)/pkgs/sage-setup\") > constraints.txt" >> "$GITHUB_ENV" mkdir -p unpacked for sdist in dist/$pkg*.tar.gz; do (cd unpacked && tar xfz - ) < $sdist diff --git a/.gitignore b/.gitignore index 51cf481afa1..184bbc7622a 100644 --- a/.gitignore +++ b/.gitignore @@ -205,16 +205,6 @@ build/pkgs/wheel/version_requirements.txt /pkgs/*/venv* /pkgs/*/.venv* -/pkgs/sage-conf_pypi/sage_root/config.log -/pkgs/sage-conf_pypi/sage_root/config.status -/pkgs/sage-conf_pypi/sage_root/local/ -/pkgs/sage-conf_pypi/sage_root/logs/ -/pkgs/sage-conf_pypi/sage_root/prefix -/pkgs/sage-conf_pypi/sage_root/src/bin/sage-env-config -/pkgs/sage-conf_pypi/sage_root/src/bin/sage-src-env-config -/pkgs/sage-conf_pypi/sage_root/upstream/ -/pkgs/sage-conf_pypi/sage_root/venv - /pkgs/sagemath-objects/setup.cfg /pkgs/sagemath-bliss/setup.cfg /pkgs/sagemath-coxeter3/setup.cfg diff --git a/.vscode/settings.json b/.vscode/settings.json index 887f416bfc4..90063064fcb 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -8,7 +8,6 @@ // Exclude symbolic links into SAGE_ROOT/pkgs/ "build/pkgs/*/src": true, // Exclude symbolic links into SAGE_ROOT/src/ - "pkgs/sage-conf_pypi/sage_root": true, "pkgs/sage-docbuild/sage_docbuild": true, "pkgs/sage-setup/sage_setup": true, "pkgs/sagemath-*/sage": true, diff --git a/README.md b/README.md index 60af9770089..3a79df83174 100644 --- a/README.md +++ b/README.md @@ -434,50 +434,6 @@ in the Installation Guide. [Launching SageMath](https://doc.sagemath.org/html/en/installation/launching.html) in the Sage Installation Guide. -Alternative Installation using PyPI ---------------- - -For installing Sage in a Python environment from PyPI, Sage provides the -`pip`-installable package [sagemath-standard](https://pypi.org/project/sagemath-standard/). - -Unless you need to install Sage into a specific existing environment, we recommend -to create and activate a fresh virtual environment, for example `~/sage-venv/`: - - $ python3 -m venv ~/sage-venv - $ source ~/sage-venv/bin/activate - -As the first installation step, install [sage_conf](https://pypi.org/project/sage-conf/), -which builds various prerequisite packages in a subdirectory of `~/.sage/`: - - (sage-venv) $ python3 -m pip install -v sage_conf - -After a successful installation, a wheelhouse provides various Python packages. -You can list the wheels using the command: - - (sage-venv) $ ls $(sage-config SAGE_SPKG_WHEELS) - -If this gives an error saying that `sage-config` is not found, check any messages -that the `pip install` command may have printed. You may need to adjust your `PATH`, -for example by: - - $ export PATH="$(python3 -c 'import sysconfig; print(sysconfig.get_path("scripts", "posix_user"))'):$PATH" - -Now install the packages from the wheelhouse and the [sage_setup](https://pypi.org/project/sage-conf/) -package, and finally install the Sage library: - - (sage-venv) $ python3 -m pip install $(sage-config SAGE_SPKG_WHEELS)/*.whl sage_setup - (sage-venv) $ python3 -m pip install --no-build-isolation -v sagemath-standard - -The above instructions install the latest stable release of Sage. -To install the latest development version instead, add the switch `--pre` to all invocations of -`python3 -m pip install`. - -**NOTE:** PyPI has various other `pip`-installable packages with the word "sage" in their names. -Some of them are maintained by the SageMath project, some are provided by SageMath users for -various purposes, and others are entirely unrelated to SageMath. Do not use the packages -`sage` and `sagemath`. For a curated list of packages, see the chapter -[Packages and Features](https://doc.sagemath.org/html/en/reference/spkg/index.html) of the -Sage Reference Manual. SageMath Docker images ---------------------- @@ -530,9 +486,6 @@ SAGE_ROOT Root directory (create by git clone) ├── configure Top-level configure script ├── COPYING.txt Copyright information ├── pkgs Source trees of Python distribution packages -│ ├── sage-conf -│ │ ├── sage_conf.py -│ │ └── setup.py │ ├── sage-docbuild │ │ ├── sage_docbuild/ │ │ └── setup.py diff --git a/build/bin/sage-dist-helpers b/build/bin/sage-dist-helpers index f8d07741612..a9c7ad89772 100644 --- a/build/bin/sage-dist-helpers +++ b/build/bin/sage-dist-helpers @@ -395,7 +395,7 @@ sdh_actually_pip_install_wheel() { shift # Issue #32659: pip no longer reinstalls local wheels if the version is the same. # Because neither (1) applying patches nor (2) local changes (in the case - # of sage-conf, sage-setup, etc.) bump the version number, we need to + # of sage-setup, etc.) bump the version number, we need to # override this behavior. The pip install option --force-reinstall does too # much -- it also reinstalls all dependencies, which we do not want. $sudo sage-pip-uninstall "$distname" 2>&1 | sed '/^WARNING: Skipping .* as it is not installed./d' diff --git a/build/make/Makefile.in b/build/make/Makefile.in index db7394b44cc..54633fbf78d 100644 --- a/build/make/Makefile.in +++ b/build/make/Makefile.in @@ -141,7 +141,6 @@ PYPI_WHEEL_PACKAGES = \ # sage_docbuild is here, not in PYPI_WHEEL_PACKAGES, because it depends on sagelib WHEEL_PACKAGES = $(PYPI_WHEEL_PACKAGES) \ - sage_conf \ sagelib \ sage_docbuild diff --git a/build/pkgs/sage_conf/SPKG.rst b/build/pkgs/sage_conf/SPKG.rst deleted file mode 120000 index b4545b4bda6..00000000000 --- a/build/pkgs/sage_conf/SPKG.rst +++ /dev/null @@ -1 +0,0 @@ -src/README.rst \ No newline at end of file diff --git a/build/pkgs/sage_conf/dependencies b/build/pkgs/sage_conf/dependencies deleted file mode 100644 index f2bd00aaf0d..00000000000 --- a/build/pkgs/sage_conf/dependencies +++ /dev/null @@ -1 +0,0 @@ - $(SAGE_ROOT)/pkgs/sage-conf/_sage_conf/_conf.py $(SAGE_ROOT)/pkgs/sage-conf/setup.cfg $(SAGE_ROOT)/pkgs/sage-conf/bin/sage-env-config | $(PYTHON_TOOLCHAIN) $(PYTHON) diff --git a/build/pkgs/sage_conf/package-version.txt b/build/pkgs/sage_conf/package-version.txt deleted file mode 120000 index c4fcb84c1a7..00000000000 --- a/build/pkgs/sage_conf/package-version.txt +++ /dev/null @@ -1 +0,0 @@ -../../../VERSION.txt \ No newline at end of file diff --git a/build/pkgs/sage_conf/spkg-install.in b/build/pkgs/sage_conf/spkg-install.in deleted file mode 120000 index 428e161a850..00000000000 --- a/build/pkgs/sage_conf/spkg-install.in +++ /dev/null @@ -1 +0,0 @@ -../sage_setup/spkg-install.in \ No newline at end of file diff --git a/build/pkgs/sage_conf/spkg-src b/build/pkgs/sage_conf/spkg-src deleted file mode 100755 index c2fa51df092..00000000000 --- a/build/pkgs/sage_conf/spkg-src +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env bash -# -# Script to prepare an sdist tarball for sage_conf -# This script is not used during build. -# -# HOW TO MAKE THE TARBALL: -# ./sage --sh build/pkgs/sage_conf/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 pkgs/sage-conf_pypi -# 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/sage_conf/src b/build/pkgs/sage_conf/src deleted file mode 120000 index 83ff1c1b7d5..00000000000 --- a/build/pkgs/sage_conf/src +++ /dev/null @@ -1 +0,0 @@ -../../../pkgs/sage-conf \ No newline at end of file diff --git a/build/pkgs/sage_conf/type b/build/pkgs/sage_conf/type deleted file mode 100644 index a6a7b9cd726..00000000000 --- a/build/pkgs/sage_conf/type +++ /dev/null @@ -1 +0,0 @@ -standard diff --git a/build/pkgs/sage_conf/version_requirements.txt b/build/pkgs/sage_conf/version_requirements.txt deleted file mode 100644 index bb14b53ee59..00000000000 --- a/build/pkgs/sage_conf/version_requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -# This file is updated on every release by the update-version script -sage-conf ~= 10.8b5 diff --git a/build/pkgs/sagelib/spkg-install.in b/build/pkgs/sagelib/spkg-install.in index 0b5d45e35ca..0e712d430ed 100644 --- a/build/pkgs/sagelib/spkg-install.in +++ b/build/pkgs/sagelib/spkg-install.in @@ -30,7 +30,7 @@ export SAGE_PKGCONFIG=/doesnotexist export SAGE_SHARE=/doesnotexist # However, we only unset SAGE_PKG_CONFIG_PATH. -# sage_setup.setenv receives them from sage_conf via sage.env; +# sage_setup.setenv receives them from sage.env; # the poisoned environment variables would override them. unset SAGE_PKG_CONFIG_PATH diff --git a/build/pkgs/sagemath_bliss/dependencies b/build/pkgs/sagemath_bliss/dependencies index a7915e316b9..8e5c304aae9 100644 --- a/build/pkgs/sagemath_bliss/dependencies +++ b/build/pkgs/sagemath_bliss/dependencies @@ -1 +1 @@ - bliss cysignals | $(PYTHON_TOOLCHAIN) sage_setup sage_conf sagemath_environment cython pkgconfig $(PYTHON) + bliss cysignals | $(PYTHON_TOOLCHAIN) sage_setup sagemath_environment cython pkgconfig $(PYTHON) diff --git a/configure.ac b/configure.ac index f147b79bd98..32cb955aa65 100644 --- a/configure.ac +++ b/configure.ac @@ -189,7 +189,7 @@ dnl This will save users from running into build errors later. AC_MSG_CHECKING([the symbolic links in the source tree]) AS_IF([test -L build/pkgs/liblzma/package-version.txt], [dnl OK AC_MSG_RESULT([intact]) -], [dnl Either replaced by a copy (OK, as done in the sage-conf_pypi sdist) +], [dnl Either replaced by a copy (OK) dnl or replaced by the name of the link target (BAD, misconfigured git clone in WSL) AS_IF([test ! -e build/pkgs/sagelib/src], [dnl AC_MSG_RESULT([intact (with links to embedded source trees pruned)]) @@ -490,14 +490,6 @@ AS_IF([test "x$enable_download_from_upstream_url" = "xyes"], [ ]) AC_SUBST([SAGE_SPKG_OPTIONS]) -AC_ARG_ENABLE([sage_conf], - AS_HELP_STRING([--disable-sage_conf], - [disable build of the sage_conf package]), [ - for pkg in sage_conf; do - AS_VAR_SET([SAGE_ENABLE_$pkg], [$enableval]) - done - ]) - AC_ARG_ENABLE([cvxopt], AS_HELP_STRING([--disable-cvxopt], [disable build of the cvxopt package and its prerequisite suitesparse]), [ diff --git a/constraints_pkgs.txt b/constraints_pkgs.txt index e68a35fa3ad..a557ed04f92 100644 --- a/constraints_pkgs.txt +++ b/constraints_pkgs.txt @@ -22,7 +22,6 @@ # Reference on the format: # https://pip.pypa.io/en/stable/user_guide/#constraints-files # -sage_conf @ file://${SAGE_ROOT}/pkgs/sage-conf sage_docbuild @ file://${SAGE_ROOT}/pkgs/sage-docbuild sage_setup @ file://${SAGE_ROOT}/pkgs/sage-setup sagemath-bliss @ file://${SAGE_ROOT}/pkgs/sagemath-bliss diff --git a/m4/sage_spkg_collect.m4 b/m4/sage_spkg_collect.m4 index 231193ce8fb..8f463ce497f 100644 --- a/m4/sage_spkg_collect.m4 +++ b/m4/sage_spkg_collect.m4 @@ -173,7 +173,7 @@ AC_DEFUN([SAGE_SPKG_FINALIZE], [dnl dnl sage repository (and thus the release tarball). As a result, dnl we do not need to download the sources, which is what dnl "in_sdist" really means. At the time of this writing, the - dnl only standard script packages are sage_conf and sagelib. + dnl only standard script packages are sagelib. dnl The sources of these packages are in subdirectories of dnl $SAGE_ROOT/pkgs. m4_define([in_sdist], [no])dnl diff --git a/pkgs/sage-conf/.gitignore b/pkgs/sage-conf/.gitignore deleted file mode 100644 index 2fff1627b9f..00000000000 --- a/pkgs/sage-conf/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -/_sage_conf/_conf.py -/build -/dist -/*.egg-info -/.tox diff --git a/pkgs/sage-conf/MANIFEST.in b/pkgs/sage-conf/MANIFEST.in deleted file mode 100644 index d156bc24748..00000000000 --- a/pkgs/sage-conf/MANIFEST.in +++ /dev/null @@ -1 +0,0 @@ -include bin/sage-env-config diff --git a/pkgs/sage-conf/README.rst b/pkgs/sage-conf/README.rst deleted file mode 100644 index 21481eabdfa..00000000000 --- a/pkgs/sage-conf/README.rst +++ /dev/null @@ -1,105 +0,0 @@ -sage_conf: Configuration module for the SageMath library (distributable version) -================================================================================ - -Description ------------ - -This distribution package provides: - -- a single Python module, ``sage_conf``, providing configuration information - to the SageMath library at the time of its installation and at its runtime - -- a console script ``sage-config``, for querying the variables of ``sage_conf`` - from the shell - -- a sourcable shell script ``sage-env-config``, providing additional configuration - information in the form of environment variables - -The ``sage_conf`` distribution package is polymorphic: It has several implementations. - - -sage_conf sdist on PyPI ------------------------ - -This implementation of the ``sage_conf`` distribution package comes from -https://github.com/sagemath/sage/issues/29039, which added the directory -`pkgs/sage-conf_pypi `_. - -To install, use ``pip install -v sage_conf``. Using ``-v`` ensures that diagnostic -messages are displayed. - -On installation (or building a wheel), it invokes ``sage_bootstrap`` to establish -a build tree (``SAGE_ROOT``) and installation tree (``SAGE_LOCAL``) for -the SageMath distribution. By default, it uses a subdirectory of ``$HOME/.sage`` -that is specific to the version of the distribution and the version of Python in -use. If several virtual environments over the same version of Python install -``sage_conf``, they will share these trees. - -After installation of ``sage_conf``, a wheelhouse containing wheels of -various libraries is available; type ``ls $(sage-config -SAGE_SPKG_WHEELS)`` to list them and ``pip install $(sage-config -SAGE_SPKG_WHEELS)/*.whl`` to install them. After this, you can install the Sage -library, for example, using ``pip install sagemath-standard``. - - -sage_conf wheels ----------------- - -Prebuilt binary wheels of the ``sage_conf`` distribution package are available -at https://github.com/sagemath/sage-wheels/releases/ - -This implementation of ``sage_conf`` comes from https://github.com/sagemath/sage/issues/31396, -which adds the directory ``pkgs/sage-conf_relocatable/``. - -On building a wheel, it invokes ``sage_bootstrap`` to establish a -build and installation tree (``SAGE_ROOT``, ``SAGE_LOCAL``) in a -subdirectory of the directory ``/var/tmp/``, whose name is specific to -the version of the distribution and the version of Python in use. - -The wheel distributes a copy of the prebuilt ``SAGE_ROOT`` and -``SAGE_LOCAL``. Importing ``sage_conf`` (or using the installed -``sage-config`` script), makes sure that a symlink from the -``/var/tmp`` location to the actual persistent installation location -is created. As the relocated libraries and programs contain the -hardcoded path ``SAGE_LOCAL`` in various ways (including as rpaths), -this symlink is necessary for the prebuilt libraries and programs to -work. - -``/var/tmp`` is a sticky directory on all Linux distributions -following the Filesystem Hierarchy Standard, as well as on macOS. -On multi-user systems, only one user can use a given -version of the distribution; other installation schemes are recommended -for systems with multiple Sage users. - - -sage_conf in the SageMath distribution --------------------------------------- - -The original version of the distribution package ``sage_conf`` is used -internally in the SageMath distribution. It is provided in the directory -`pkgs/sage-conf `_. -This version of the package is generated by the Sage distribution's ``./configure`` -script. - - - -sage_conf in downstream distributions -------------------------------------- - -Downstream packagers and advanced developers and users may want to provide -their own implementation of the distribution package to support the intended -deployment of the SageMath library. - - -License -------- - -GNU General Public License (GPL) v3 or later - -Upstream Contact ----------------- - -https://www.sagemath.org - -This package is included in the source code of the Sage distribution, -in `pkgs/sage-conf* `_. diff --git a/pkgs/sage-conf/VERSION.txt b/pkgs/sage-conf/VERSION.txt deleted file mode 100644 index adba68b254a..00000000000 --- a/pkgs/sage-conf/VERSION.txt +++ /dev/null @@ -1 +0,0 @@ -10.8.beta6 diff --git a/pkgs/sage-conf/_sage_conf/__main__.py b/pkgs/sage-conf/_sage_conf/__main__.py deleted file mode 100644 index 043fcb24328..00000000000 --- a/pkgs/sage-conf/_sage_conf/__main__.py +++ /dev/null @@ -1,19 +0,0 @@ -# Entry point 'sage-config'. It does not depend on any packages. - -def _main(): - from argparse import ArgumentParser - from sys import exit, stdout - - import sage_conf - - parser = ArgumentParser(prog='sage-config') - parser.add_argument('--version', help="show version", action="version", - version='%(prog)s ' + sage_conf.VERSION) - parser.add_argument("VARIABLE", nargs='?', help="output the value of VARIABLE") - args = parser.parse_args() - if args.VARIABLE: - stdout.write('{}\n'.format(getattr(sage_conf, args.VARIABLE))) - else: - for k in dir(sage_conf): - if not k.startswith('_'): - stdout.write('{}={}\n'.format(k, getattr(sage_conf, k))) diff --git a/pkgs/sage-conf/_sage_conf/_conf.py.in b/pkgs/sage-conf/_sage_conf/_conf.py.in index f5de0971554..f35d59b00e6 100644 --- a/pkgs/sage-conf/_sage_conf/_conf.py.in +++ b/pkgs/sage-conf/_sage_conf/_conf.py.in @@ -31,6 +31,7 @@ NTL_LIBDIR = "@NTL_LIBDIR@" # Path to the ecl-config script ECL_CONFIG = "@SAGE_ECL_CONFIG@".replace('${prefix}', SAGE_LOCAL) +# Path to the nauty binaries; of the form "/path/to/" or "/path/to/nauty-" SAGE_NAUTY_BINS_PREFIX = "@SAGE_NAUTY_BINS_PREFIX@" SAGE_ECMBIN = "@SAGE_ECMBIN@" diff --git a/pkgs/sage-conf/bin/sage-env-config b/pkgs/sage-conf/bin/sage-env-config deleted file mode 120000 index 79de861ff96..00000000000 --- a/pkgs/sage-conf/bin/sage-env-config +++ /dev/null @@ -1 +0,0 @@ -../../../src/bin/sage-env-config \ No newline at end of file diff --git a/pkgs/sage-conf/bin/sage-env-config.in b/pkgs/sage-conf/bin/sage-env-config.in deleted file mode 120000 index ad7ba575b2c..00000000000 --- a/pkgs/sage-conf/bin/sage-env-config.in +++ /dev/null @@ -1 +0,0 @@ -../../../src/bin/sage-env-config.in \ No newline at end of file diff --git a/pkgs/sage-conf/pyproject.toml b/pkgs/sage-conf/pyproject.toml deleted file mode 100644 index 9787c3bdf00..00000000000 --- a/pkgs/sage-conf/pyproject.toml +++ /dev/null @@ -1,3 +0,0 @@ -[build-system] -requires = ["setuptools", "wheel"] -build-backend = "setuptools.build_meta" diff --git a/pkgs/sage-conf/sage_conf.py b/pkgs/sage-conf/sage_conf.py deleted file mode 100644 index a5c554043ba..00000000000 --- a/pkgs/sage-conf/sage_conf.py +++ /dev/null @@ -1,6 +0,0 @@ -from _sage_conf._conf import * -from _sage_conf.__main__ import _main - - -if __name__ == "__main__": - _main() diff --git a/pkgs/sage-conf/setup.cfg b/pkgs/sage-conf/setup.cfg deleted file mode 100644 index dac401c303d..00000000000 --- a/pkgs/sage-conf/setup.cfg +++ /dev/null @@ -1,23 +0,0 @@ -[metadata] -name = sage-conf -version = file: VERSION.txt -description = Sage: Open Source Mathematics Software: Configuration module for the SageMath library -long_description = file: README.rst -license = GNU General Public License (GPL) v3 or later -author = The Sage Developers -author_email = sage-support@googlegroups.com -url = https://www.sagemath.org - -[options] -packages = - _sage_conf - -py_modules = - sage_conf - -scripts = - bin/sage-env-config - -[options.entry_points] -console_scripts = - sage-config = sage_conf:_main diff --git a/pkgs/sage-conf/setup.py b/pkgs/sage-conf/setup.py deleted file mode 100644 index afa05966816..00000000000 --- a/pkgs/sage-conf/setup.py +++ /dev/null @@ -1,13 +0,0 @@ -from setuptools import setup -from setuptools.dist import Distribution - -# setuptools plugins considered harmful: -# If build isolation is not in use and setuptools_scm is installed, -# then its file_finders entry point is invoked, which we don't need. -# And with setuptools_scm 8, we get more trouble: -# LookupError: pyproject.toml does not contain a tool.setuptools_scm section -# LookupError: setuptools-scm was unable to detect version ... -# We just remove all handling of "setuptools.finalize_distribution_options" entry points. -Distribution._removed = staticmethod(lambda ep: True) - -setup() diff --git a/pkgs/sage-conf_pypi/.gitignore b/pkgs/sage-conf_pypi/.gitignore deleted file mode 100644 index 6fdda73c500..00000000000 --- a/pkgs/sage-conf_pypi/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/_sage_conf/_conf.py -/build -/dist -/*.egg-info -/.tox -/bin/sage-env-config diff --git a/pkgs/sage-conf_pypi/MANIFEST.in b/pkgs/sage-conf_pypi/MANIFEST.in deleted file mode 100644 index ed0379b28ba..00000000000 --- a/pkgs/sage-conf_pypi/MANIFEST.in +++ /dev/null @@ -1,34 +0,0 @@ -prune .tox -include VERSION.txt -graft bin -graft sage_root -prune sage_root/build/.tox -# These sources are not needed because individual distributions of these are made. -prune sage_root/build/pkgs/*/src* -prune sage_root/pkgs -# Except for this one because config.status writes there -graft sage_root/pkgs/sage-conf -prune sage_root/pkgs/sage-conf/build -prune sage_root/pkgs/sage-conf/dist -prune sage_root/pkgs/sage-conf/*.egg-info -# And this one because of declared dependencies on source files in Makefile.in -graft sage_root/pkgs/sage-docbuild -prune sage_root/pkgs/sage-docbuild/build -prune sage_root/pkgs/sage-docbuild/*.egg-info -# Exclude files generated by config.status (AC_CONFIG_FILES) -exclude _sage_conf/_conf.py -exclude sage_root/pkgs/sage-conf/_sage_conf/_conf.py -exclude bin/sage-env-config -exclude sage_root/pkgs/sage-conf/bin/sage-env-config -exclude sage_root/build/bin/sage-build-env-config -exclude sage_root/build/make/Makefile-auto -exclude sage_root/build/make/Makefile -# -global-exclude .tox -global-exclude *~* -global-exclude *.bak -global-exclude *.orig -global-exclude __pycache__ -global-exclude *.py[co] -global-exclude *.so -global-exclude .DS_Store diff --git a/pkgs/sage-conf_pypi/README.rst b/pkgs/sage-conf_pypi/README.rst deleted file mode 120000 index feda886cd36..00000000000 --- a/pkgs/sage-conf_pypi/README.rst +++ /dev/null @@ -1 +0,0 @@ -../sage-conf/README.rst \ No newline at end of file diff --git a/pkgs/sage-conf_pypi/VERSION.txt b/pkgs/sage-conf_pypi/VERSION.txt deleted file mode 100644 index adba68b254a..00000000000 --- a/pkgs/sage-conf_pypi/VERSION.txt +++ /dev/null @@ -1 +0,0 @@ -10.8.beta6 diff --git a/pkgs/sage-conf_pypi/_sage_conf b/pkgs/sage-conf_pypi/_sage_conf deleted file mode 120000 index d92a91bef8c..00000000000 --- a/pkgs/sage-conf_pypi/_sage_conf +++ /dev/null @@ -1 +0,0 @@ -../sage-conf/_sage_conf \ No newline at end of file diff --git a/pkgs/sage-conf_pypi/bin/sage-env-config.in b/pkgs/sage-conf_pypi/bin/sage-env-config.in deleted file mode 120000 index 59e39e7e944..00000000000 --- a/pkgs/sage-conf_pypi/bin/sage-env-config.in +++ /dev/null @@ -1 +0,0 @@ -../../sage-conf/bin/sage-env-config.in \ No newline at end of file diff --git a/pkgs/sage-conf_pypi/pyproject.toml b/pkgs/sage-conf_pypi/pyproject.toml deleted file mode 120000 index 52c93c824e2..00000000000 --- a/pkgs/sage-conf_pypi/pyproject.toml +++ /dev/null @@ -1 +0,0 @@ -../sage-conf/pyproject.toml \ No newline at end of file diff --git a/pkgs/sage-conf_pypi/sage_conf.py b/pkgs/sage-conf_pypi/sage_conf.py deleted file mode 120000 index f4bca8cc55c..00000000000 --- a/pkgs/sage-conf_pypi/sage_conf.py +++ /dev/null @@ -1 +0,0 @@ -../sage-conf/sage_conf.py \ No newline at end of file diff --git a/pkgs/sage-conf_pypi/sage_root/.homebrew-build-env b/pkgs/sage-conf_pypi/sage_root/.homebrew-build-env deleted file mode 120000 index 18573e75488..00000000000 --- a/pkgs/sage-conf_pypi/sage_root/.homebrew-build-env +++ /dev/null @@ -1 +0,0 @@ -../../../.homebrew-build-env \ No newline at end of file diff --git a/pkgs/sage-conf_pypi/sage_root/.upstream.d b/pkgs/sage-conf_pypi/sage_root/.upstream.d deleted file mode 120000 index 243d6b8c910..00000000000 --- a/pkgs/sage-conf_pypi/sage_root/.upstream.d +++ /dev/null @@ -1 +0,0 @@ -../../../.upstream.d \ No newline at end of file diff --git a/pkgs/sage-conf_pypi/sage_root/Makefile b/pkgs/sage-conf_pypi/sage_root/Makefile deleted file mode 120000 index 62a7b627cbc..00000000000 --- a/pkgs/sage-conf_pypi/sage_root/Makefile +++ /dev/null @@ -1 +0,0 @@ -../../../Makefile \ No newline at end of file diff --git a/pkgs/sage-conf_pypi/sage_root/README.md b/pkgs/sage-conf_pypi/sage_root/README.md deleted file mode 120000 index 8a33348c7d8..00000000000 --- a/pkgs/sage-conf_pypi/sage_root/README.md +++ /dev/null @@ -1 +0,0 @@ -../../../README.md \ No newline at end of file diff --git a/pkgs/sage-conf_pypi/sage_root/VERSION.txt b/pkgs/sage-conf_pypi/sage_root/VERSION.txt deleted file mode 120000 index c4fcb84c1a7..00000000000 --- a/pkgs/sage-conf_pypi/sage_root/VERSION.txt +++ /dev/null @@ -1 +0,0 @@ -../../../VERSION.txt \ No newline at end of file diff --git a/pkgs/sage-conf_pypi/sage_root/bootstrap b/pkgs/sage-conf_pypi/sage_root/bootstrap deleted file mode 100755 index 38df9dbea8a..00000000000 --- a/pkgs/sage-conf_pypi/sage_root/bootstrap +++ /dev/null @@ -1,3 +0,0 @@ -#! /usr/bin/env bash -# This version of the bootstrap script does nothing. -exit 0 diff --git a/pkgs/sage-conf_pypi/sage_root/build b/pkgs/sage-conf_pypi/sage_root/build deleted file mode 120000 index 44735d58664..00000000000 --- a/pkgs/sage-conf_pypi/sage_root/build +++ /dev/null @@ -1 +0,0 @@ -../../../build \ No newline at end of file diff --git a/pkgs/sage-conf_pypi/sage_root/config b/pkgs/sage-conf_pypi/sage_root/config deleted file mode 120000 index 101d543820c..00000000000 --- a/pkgs/sage-conf_pypi/sage_root/config +++ /dev/null @@ -1 +0,0 @@ -../../../config \ No newline at end of file diff --git a/pkgs/sage-conf_pypi/sage_root/configure b/pkgs/sage-conf_pypi/sage_root/configure deleted file mode 120000 index 5cc41f0cbb4..00000000000 --- a/pkgs/sage-conf_pypi/sage_root/configure +++ /dev/null @@ -1 +0,0 @@ -../../../configure \ No newline at end of file diff --git a/pkgs/sage-conf_pypi/sage_root/configure.ac b/pkgs/sage-conf_pypi/sage_root/configure.ac deleted file mode 120000 index 663513d0394..00000000000 --- a/pkgs/sage-conf_pypi/sage_root/configure.ac +++ /dev/null @@ -1 +0,0 @@ -../../../configure.ac \ No newline at end of file diff --git a/pkgs/sage-conf_pypi/sage_root/m4 b/pkgs/sage-conf_pypi/sage_root/m4 deleted file mode 120000 index af1ea766194..00000000000 --- a/pkgs/sage-conf_pypi/sage_root/m4 +++ /dev/null @@ -1 +0,0 @@ -../../../m4 \ No newline at end of file diff --git a/pkgs/sage-conf_pypi/sage_root/pkgs/sage-conf b/pkgs/sage-conf_pypi/sage_root/pkgs/sage-conf deleted file mode 120000 index a5beefae37f..00000000000 --- a/pkgs/sage-conf_pypi/sage_root/pkgs/sage-conf +++ /dev/null @@ -1 +0,0 @@ -../../../sage-conf \ No newline at end of file diff --git a/pkgs/sage-conf_pypi/sage_root/src/bin/sage-env b/pkgs/sage-conf_pypi/sage_root/src/bin/sage-env deleted file mode 120000 index 0e6d834170f..00000000000 --- a/pkgs/sage-conf_pypi/sage_root/src/bin/sage-env +++ /dev/null @@ -1 +0,0 @@ -../../../../../src/bin/sage-env \ No newline at end of file diff --git a/pkgs/sage-conf_pypi/sage_root/src/bin/sage-env-config.in b/pkgs/sage-conf_pypi/sage_root/src/bin/sage-env-config.in deleted file mode 120000 index bee50932c1c..00000000000 --- a/pkgs/sage-conf_pypi/sage_root/src/bin/sage-env-config.in +++ /dev/null @@ -1 +0,0 @@ -../../../../../src/bin/sage-env-config.in \ No newline at end of file diff --git a/pkgs/sage-conf_pypi/sage_root/src/bin/sage-src-env-config.in b/pkgs/sage-conf_pypi/sage_root/src/bin/sage-src-env-config.in deleted file mode 120000 index 5ab2daefac2..00000000000 --- a/pkgs/sage-conf_pypi/sage_root/src/bin/sage-src-env-config.in +++ /dev/null @@ -1 +0,0 @@ -../../../../../src/bin/sage-src-env-config.in \ No newline at end of file diff --git a/pkgs/sage-conf_pypi/sage_root/src/bin/sage-venv-config b/pkgs/sage-conf_pypi/sage_root/src/bin/sage-venv-config deleted file mode 120000 index 48db9b22b1a..00000000000 --- a/pkgs/sage-conf_pypi/sage_root/src/bin/sage-venv-config +++ /dev/null @@ -1 +0,0 @@ -../../../../../src/bin/sage-venv-config \ No newline at end of file diff --git a/pkgs/sage-conf_pypi/sage_root/src/bin/sage-version.sh b/pkgs/sage-conf_pypi/sage_root/src/bin/sage-version.sh deleted file mode 120000 index 39e60394aca..00000000000 --- a/pkgs/sage-conf_pypi/sage_root/src/bin/sage-version.sh +++ /dev/null @@ -1 +0,0 @@ -../../../../../src/bin/sage-version.sh \ No newline at end of file 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/sage-conf_pypi/setup.cfg b/pkgs/sage-conf_pypi/setup.cfg deleted file mode 120000 index 93df2c80a4b..00000000000 --- a/pkgs/sage-conf_pypi/setup.cfg +++ /dev/null @@ -1 +0,0 @@ -../sage-conf/setup.cfg \ No newline at end of file diff --git a/pkgs/sage-conf_pypi/setup.py b/pkgs/sage-conf_pypi/setup.py deleted file mode 100644 index 54dcecf7e17..00000000000 --- a/pkgs/sage-conf_pypi/setup.py +++ /dev/null @@ -1,140 +0,0 @@ -import os -import sys -import shutil -import sysconfig -import platform -import fnmatch - -from setuptools import setup -from setuptools.dist import Distribution -from distutils.command.build_scripts import build_scripts as distutils_build_scripts -from setuptools.command.build_py import build_py as setuptools_build_py -from setuptools.command.editable_wheel import editable_wheel as setuptools_editable_wheel -from setuptools.errors import SetupError - - -# setuptools plugins considered harmful: -# If build isolation is not in use and setuptools_scm is installed, -# then its file_finders entry point is invoked, which we don't need. -# And with setuptools_scm 8, we get more trouble: -# LookupError: pyproject.toml does not contain a tool.setuptools_scm section -# LookupError: setuptools-scm was unable to detect version ... -# We just remove all handling of "setuptools.finalize_distribution_options" entry points. -Distribution._removed = staticmethod(lambda ep: True) - - -class build_py(setuptools_build_py): - - def run(self): - HERE = os.path.dirname(__file__) - if self.editable_mode: - SAGE_ROOT = os.path.join(HERE, 'sage_root') - else: - SAGE_ROOT = self._create_writable_sage_root() - - # For convenience, set up the homebrew env automatically. This is a no-op if homebrew is not present. - if os.environ.get('CONDA_PREFIX', ''): - SETENV = ':' - else: - SETENV = '. ./.homebrew-build-env 2> /dev/null' - - SAGE_LOCAL = os.path.join(SAGE_ROOT, 'local') - - if os.path.exists(os.path.join(SAGE_ROOT, 'config.status')): - print(f'Reusing configured SAGE_ROOT={SAGE_ROOT}') - else: - cmd = f"cd {SAGE_ROOT} && ({SETENV}; ./configure --prefix={SAGE_LOCAL} --with-python={sys.executable} --enable-build-as-root --enable-download-from-upstream-url --with-system-python3=force --with-sage-venv --disable-notebook --disable-sagelib --disable-sage_conf --disable-doc)" - print(f"Running {cmd}") - sys.stdout.flush() - if os.system(cmd) != 0: - print("configure failed; this may be caused by missing build prerequisites.") - sys.stdout.flush() - PREREQ_SPKG = "_prereq bzip2 xz libffi" # includes python3 SPKG_DEPCHECK packages - os.system(f'cd {SAGE_ROOT} && export SYSTEM=$(build/bin/sage-guess-package-system 2>/dev/null) && export PACKAGES="$(build/bin/sage-get-system-packages $SYSTEM {PREREQ_SPKG})" && [ -n "$PACKAGES" ] && echo "You can install the required build prerequisites using the following shell command" && echo "" && build/bin/sage-print-system-package-command $SYSTEM --verbose --sudo install $PACKAGES && echo ""') - raise SetupError("configure failed") - - # Copy over files generated by the configure script - # (see configure.ac AC_CONFIG_FILES) - if self.editable_mode: - pass # same file - else: - shutil.copyfile(os.path.join(SAGE_ROOT, 'pkgs', 'sage-conf', '_sage_conf', '_conf.py'), - os.path.join(HERE, '_sage_conf', '_conf.py')) - shutil.copyfile(os.path.join(SAGE_ROOT, 'src', 'bin', 'sage-env-config'), - os.path.join(HERE, 'bin', 'sage-env-config')) - - # Here we run "make build" -- which builds everything except for sagelib because we - # used configure --disable-sagelib - # Alternative: - # "make build-local" only builds the non-Python packages of the Sage distribution. - # It still makes an (empty) venv in SAGE_VENV, which is unused by default; - # but then a user could use "make build-venv" to build compatible wheels for all Python packages. - # TODO: A target to only build wheels of tricky packages - # (that use native libraries shared with other packages). - SETMAKE = 'if [ -z "$MAKE" ]; then export MAKE="make -j$(PATH=build/bin:$PATH build/bin/sage-build-num-threads | cut -d" " -f 2)"; fi' - TARGETS = 'build' - cmd = f'cd {SAGE_ROOT} && ({SETENV}; {SETMAKE} && $MAKE V=0 ${{SAGE_CONF_TARGETS-{TARGETS}}})' - print(f"Running {cmd}", flush=True) - if os.system(cmd) != 0: - raise SetupError(f"make ${{SAGE_CONF_TARGETS-{TARGETS}}} failed") - - setuptools_build_py.run(self) - - def _create_writable_sage_root(self): - HERE = os.path.dirname(__file__) - DOT_SAGE = os.environ.get('DOT_SAGE', os.path.join(os.environ.get('HOME'), '.sage')) - with open(os.path.join(HERE, 'VERSION.txt')) as f: - sage_version = f.read().strip() - # After #30534, SAGE_LOCAL no longer contains any Python. So we key the SAGE_ROOT only to Sage version - # and architecture. - system = platform.system() - machine = platform.machine() - arch_tag = f'{system}-{machine}' - # TODO: Should be user-configurable with config settings - SAGE_ROOT = os.path.join(DOT_SAGE, f'sage-{sage_version}-{arch_tag}') - - def ignore(path, names): - # exclude all embedded src trees - if fnmatch.fnmatch(path, '*/build/pkgs/*'): - return ['src'] - ### ignore more stuff --- .tox etc. - return [name for name in names - if name in ('.tox', '.git', '__pycache__', - 'prefix', 'local', 'venv', 'upstream', - 'config.status', 'config.log', 'logs')] - - if not os.path.exists(os.path.join(SAGE_ROOT, 'config.status')): - # config.status and other configure output has to be writable. - # So (until the Sage distribution supports VPATH builds - #21469), we have to make a copy of sage_root. - try: - shutil.copytree('sage_root', SAGE_ROOT, - ignore=ignore) # will fail if already exists - except Exception as e: - raise SetupError(f"the directory SAGE_ROOT={SAGE_ROOT} already exists but it is not configured ({e}). " - "Please either remove it and try again, or install in editable mode (pip install -e).") - - return SAGE_ROOT - - -class build_scripts(distutils_build_scripts): - - def run(self): - self.distribution.scripts.append(os.path.join('bin', 'sage-env-config')) - if not self.distribution.entry_points: - self.entry_points = self.distribution.entry_points = dict() - distutils_build_scripts.run(self) - - -class editable_wheel(setuptools_editable_wheel): - r""" - Customized so that exceptions raised by our build_py - do not lead to the "Customization incompatible with editable install" message - """ - _safely_run = setuptools_editable_wheel.run_command - - -setup( - cmdclass=dict(build_py=build_py, - build_scripts=build_scripts, - editable_wheel=editable_wheel) -) diff --git a/pkgs/sage-conf_pypi/tox.ini b/pkgs/sage-conf_pypi/tox.ini deleted file mode 100644 index 7160d4db678..00000000000 --- a/pkgs/sage-conf_pypi/tox.ini +++ /dev/null @@ -1,53 +0,0 @@ -[tox] -envlist = py39, py310, py311, py39-user, py310-user, py311-user - -requires = - # Because of https://github.com/tox-dev/tox/issues/3238, need <4.14.1 - tox<4.14.1 - -[testenv:.pkg] -basepython = py311 -passenv = - MAKE - # So that .homebrew-build-env will work - HOMEBREW - -setenv = - HOME={work_dir}/home - # Passed to 'make' instead of 'build'. We test here: - # - frobby (standalone program with dependency on gmp; tests that .homebrew-build-env is invoked correctly) - # - lrcalc_python (builds a platform wheel, possibly with use of system library) - # - coxeter3 (which allows us to build sagemath-coxeter3) - SAGE_CONF_TARGETS=frobby lrcalc_python coxeter3 - -[testenv:python] -package = wheel -deps = - # For the 'sage' script - sagemath-environment -setenv = - HOME={work_dir}/home -allowlist_externals = - bash - env -commands = - bash -c 'set -ex; eval $SETENV; \ - sage-config; \ - ls $(sage-config SAGE_SPKG_WHEELS); \ - sage -sh -c "frobby genideal"; \ - {envpython} -m pip install $(sage-config SAGE_SPKG_WHEELS)/*.whl' - -[testenv:python-user] -package = wheel -deps = - {[testenv:python]deps} -setenv = - {[testenv:python]setenv} - PYTHONUSERBASE={work_dir}/userbase - SETENV=export PATH={env:PYTHONUSERBASE}/bin:{env:PATH} -system_site_packages = True -install_command = env PATH={env:PYTHONUSERBASE}/bin:{env_bin_dir} python -I -m pip install --user {opts} {packages} -allowlist_externals = - {[testenv:python]allowlist_externals} -commands = - {[testenv:python]commands} diff --git a/pkgs/sagemath-bliss/pyproject.toml.m4 b/pkgs/sagemath-bliss/pyproject.toml.m4 index 40bfebf2489..7f5321551f3 100644 --- a/pkgs/sagemath-bliss/pyproject.toml.m4 +++ b/pkgs/sagemath-bliss/pyproject.toml.m4 @@ -3,7 +3,6 @@ include(`sage_spkg_versions_toml.m4')dnl' -*- conf-toml -*- # Minimum requirements for the build system to execute. requires = [ SPKG_INSTALL_REQUIRES_setuptools - SPKG_INSTALL_REQUIRES_sage_conf SPKG_INSTALL_REQUIRES_sage_setup SPKG_INSTALL_REQUIRES_sagemath_environment SPKG_INSTALL_REQUIRES_cython diff --git a/pkgs/sagemath-environment/pyproject.toml.m4 b/pkgs/sagemath-environment/pyproject.toml.m4 index 5fc7ca4711f..93381fd420d 100644 --- a/pkgs/sagemath-environment/pyproject.toml.m4 +++ b/pkgs/sagemath-environment/pyproject.toml.m4 @@ -15,7 +15,6 @@ dynamic = ["version"] include(`pyproject_toml_metadata.m4')dnl' [project.optional-dependencies] -conf = [SPKG_INSTALL_REQUIRES_sage_conf] # sage.env can optionally use sage_conf docbuild = [SPKG_INSTALL_REQUIRES_sage_docbuild] # For "sage --docbuild" sage = [SPKG_INSTALL_REQUIRES_sagelib] # For "sage", "sage -t", ... cython = [SPKG_INSTALL_REQUIRES_cython] # For "sage --cython" @@ -48,7 +47,6 @@ script-files = [ "bin/sage-venv-config", "bin/sage-version.sh", # Not included: - # - bin/sage-env-config -- installed by sage_conf # - bin/sage-env-config.in -- not to be installed # - bin/sage-run, bin/sage-runtests, ... -- installed by sagemath-repl # - bin/sage-ipython -- uses sage.repl, so installed by sagemath-repl diff --git a/src/bin/sage b/src/bin/sage index c4e5c250193..0391c7be5dd 100755 --- a/src/bin/sage +++ b/src/bin/sage @@ -158,11 +158,6 @@ usage() { # Determine SAGE_ROOT, SAGE_LOCAL, and SAGE_VENV. unset SAGE_VENV -if [ -x "${SELF}-config" ]; then - # optional sage-config console script, installed by sage_conf - export SAGE_ROOT=$("${SELF}-config" SAGE_ROOT) - export SAGE_LOCAL=$("${SELF}-config" SAGE_LOCAL) -fi if [ -f "${SELF}-src-env-config" ]; then # Not installed script, present only in src/bin/ . "${SELF}-src-env-config" >&2 diff --git a/src/bin/sage-env-config.in b/src/bin/sage-env-config.in index 49158df4d4c..ff66cc541ca 100644 --- a/src/bin/sage-env-config.in +++ b/src/bin/sage-env-config.in @@ -18,9 +18,6 @@ # - Environment variables that are only needed at the time of building # SPKGs or sagelib should be set in build/bin/sage-build-env-config # or build/bin/sage-build-env instead. -# - Configuration variables that are only needed by the Sage runtime, -# but not as environment variables, should instead be set in -# pkgs/sage-conf/_sage_conf/_conf.py # ########################################################################## diff --git a/src/bin/sage-src-env-config.in b/src/bin/sage-src-env-config.in index 2949c320665..1f52b3de0bb 100644 --- a/src/bin/sage-src-env-config.in +++ b/src/bin/sage-src-env-config.in @@ -21,9 +21,6 @@ # - Environment variables that are only needed at the time of building # SPKGs or sagelib should be set in build/bin/sage-build-env-config # instead. -# - Configuration variables that are only needed by the Sage runtime, -# but not as environment variables, should instead be set in -# pkgs/sage-conf/_sage_conf/_conf.py # ########################################################################## diff --git a/src/bin/sage-venv-config b/src/bin/sage-venv-config index 6172e9302b4..7eaba41eaae 100644 --- a/src/bin/sage-venv-config +++ b/src/bin/sage-venv-config @@ -10,12 +10,6 @@ # VERSION = 'unknown' -try: - from sage_conf import * -except ImportError: - pass - -from sys import prefix as SAGE_VENV try: from sage.version import version as VERSION @@ -24,7 +18,7 @@ except ImportError: def _main(): from argparse import ArgumentParser - from sys import exit, stdout + from sys import stdout parser = ArgumentParser() parser.add_argument('--version', help="show version", action="version", version='%(prog)s ' + VERSION) diff --git a/src/doc/en/developer/packaging_sage_library.rst b/src/doc/en/developer/packaging_sage_library.rst index 41a8be64dfb..a25261f0936 100644 --- a/src/doc/en/developer/packaging_sage_library.rst +++ b/src/doc/en/developer/packaging_sage_library.rst @@ -529,10 +529,6 @@ Solid arrows indicate ``install_requires``, i.e., a declared runtime dependency. Dashed arrows indicate ``extras_require``, i.e., a declared optional runtime dependency. Not shown in the diagram are build dependencies and optional dependencies for testing. -- `sage_conf `_ is a configuration - module. It provides the configuration variable settings determined by the - ``configure`` script. - - `sagemath-environment `_ provides the connection to the system and software environment. It includes :mod:`sage.env`, :mod:`sage.features`, :mod:`sage.misc.package_dir`, etc. @@ -647,10 +643,6 @@ To create these wheels, use the command ``make wheels``:: (You can also use ``./configure --enable-wheels`` to ensure that these wheels are always available and up to date.) -Note in particular the wheel for **sage-conf**, which provides -configuration variable settings and the connection to the non-Python -packages installed in ``SAGE_LOCAL``. - We can now set up a separate virtual environment, in which we install these wheels and our distribution to be tested. This is where `tox `_ diff --git a/src/sage/all_test.py b/src/sage/all_test.py new file mode 100644 index 00000000000..e6bce8dbe54 --- /dev/null +++ b/src/sage/all_test.py @@ -0,0 +1,28 @@ +import os +import subprocess +import sys + + +def test_import_sage_all_in_fresh_interpreter(): + # Prepare a clean-ish environment, without any sage variables + env = os.environ.copy() + env.pop("PYTHONSTARTUP", None) + for var in list(env): + if var.startswith("SAGE_"): + env.pop(var, None) + + proc = subprocess.run( + [sys.executable, "-c", "import sage.all"], + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + env=env, + text=True, check=False, + ) + assert proc.returncode == 0, ( + "Importing 'sage.all' in a fresh interpreter failed.\n" + f"Return code: {proc.returncode}\n" + f"Stdout:\n{proc.stdout}\n" + f"Stderr:\n{proc.stderr}" + ) + assert proc.stderr == "" + assert proc.stdout == "" diff --git a/src/sage/coding/linear_code.py b/src/sage/coding/linear_code.py index 5be5843b7b2..add7606a6dc 100644 --- a/src/sage/coding/linear_code.py +++ b/src/sage/coding/linear_code.py @@ -231,7 +231,6 @@ class should inherit from this class. Also ``AbstractLinearCode`` should never lazy_import('sage.groups.perm_gps.permgroup_named', 'SymmetricGroup') lazy_import('sage.groups.perm_gps.permgroup', 'PermutationGroup') -lazy_import('sage.interfaces.gap', 'gap') # ***************************************************************************** diff --git a/src/sage/env.py b/src/sage/env.py index 05765414321..fcba9ade863 100644 --- a/src/sage/env.py +++ b/src/sage/env.py @@ -2,27 +2,6 @@ r""" Sage Runtime Environment -Verify that importing ``sage.all`` works in Sage's Python without any -``SAGE_`` environment variables, and has the same ``SAGE_ROOT`` and -``SAGE_LOCAL`` (see also :issue:`29446`). If ``SAGE_ROOT`` is a path, -we normalize it, but keep in mind that ``SAGE_ROOT`` may also be -``None``:: - - sage: env = {k:v for (k,v) in os.environ.items() if not k.startswith("SAGE_")} - sage: from subprocess import check_output - sage: module_name = "sage.all" # hide .all import from the linter - sage: cmd = f"from {module_name} import SAGE_ROOT, SAGE_LOCAL;" - sage: cmd += "from os.path import samefile;" - sage: if SAGE_ROOT is None: - ....: cmd += "s1 = SAGE_ROOT is None;" - ....: else: - ....: cmd += f"s1 = samefile(SAGE_ROOT, '{SAGE_ROOT}');" - sage: cmd += f"s2 = samefile(SAGE_LOCAL, '{SAGE_LOCAL}');" - sage: cmd += "print(s1 and s2);" - sage: out = check_output([sys.executable, "-c", cmd], env=env).decode().strip() # long time - sage: out == "True" # long time - True - AUTHORS: - \R. Andrew Ohana (2012): initial version @@ -48,6 +27,7 @@ from platformdirs import site_data_dir, user_data_dir +import sage.config from sage import version # All variables set by var() appear in this SAGE_ENV dict @@ -149,15 +129,7 @@ def var(key: str, *fallbacks: Optional[str], force: bool = False) -> Optional[st else: value = os.environ.get(key) if value is None: - try: - import sage_conf - value = getattr(sage_conf, key, None) - except ImportError: - try: - import sage.config - value = getattr(sage.config, key, None) - except ImportError: - pass + value = getattr(sage.config, key, None) # Try all fallbacks in order as long as we don't have a non-empty value for f in fallbacks: diff --git a/src/sage/features/nauty.py b/src/sage/features/nauty.py index f0f47bcda28..a36e2961370 100644 --- a/src/sage/features/nauty.py +++ b/src/sage/features/nauty.py @@ -28,6 +28,7 @@ class NautyExecutable(Executable): sage: NautyExecutable('converseg').is_present() # needs nauty FeatureTestResult('nauty_converseg', True) """ + def __init__(self, name): r""" TESTS:: @@ -36,10 +37,13 @@ def __init__(self, name): sage: isinstance(NautyExecutable('geng'), NautyExecutable) True """ - Executable.__init__(self, name=f"nauty_{name}", - executable=f"{SAGE_NAUTY_BINS_PREFIX}{name}", - spkg='nauty', - type='standard') + Executable.__init__( + self, + name=f"nauty_{name}", + executable=f"{SAGE_NAUTY_BINS_PREFIX}{name}", + spkg="nauty", + type="standard", + ) class Nauty(JoinFeature): @@ -53,6 +57,7 @@ class Nauty(JoinFeature): sage: Nauty().is_present() # needs nauty FeatureTestResult('nauty', True) """ + def __init__(self): r""" TESTS:: @@ -61,9 +66,22 @@ def __init__(self): sage: isinstance(Nauty(), Nauty) True """ - JoinFeature.__init__(self, "nauty", - [NautyExecutable(name) - for name in ('directg', 'gentourng', 'geng', 'genbg', 'gentreeg', 'genktreeg')]) + JoinFeature.__init__( + self, + "nauty", + [ + NautyExecutable(name) + for name in ( + "directg", + "gentourng", + "geng", + "genbg", + "gentreeg", + "genktreeg", + "genposetg", + ) + ], + ) def all_features(): diff --git a/src/sage/features/sagemath.py b/src/sage/features/sagemath.py index 05179c410fd..d477cfa0cae 100644 --- a/src/sage/features/sagemath.py +++ b/src/sage/features/sagemath.py @@ -44,30 +44,6 @@ from .join_feature import JoinFeature -class SAGE_SRC(StaticFile): - r""" - A :class:`~sage.features.Feature` which describes the presence of the - monolithic source tree of the Sage library. - """ - def __init__(self): - r""" - TESTS:: - - sage: from sage.features.sagemath import SAGE_SRC - sage: isinstance(SAGE_SRC(), SAGE_SRC) - True - """ - from sage.env import SAGE_SRC - # We check the file bin/sage-src-env-config.in, which by design is: - # - never installed, - # - not included in the sagemath-standard sdist, - # - included only in one modularized sdist, of pkgs/sage-conf_pypi, - # where it appears in a subdirectory (sage_root/src/bin/) - StaticFile.__init__(self, 'SAGE_SRC', - filename='bin/sage-src-env-config.in', - search_path=(SAGE_SRC,) if SAGE_SRC else ()) - - class sagemath_doc_html(StaticFile): r""" A :class:`~sage.features.Feature` which describes the presence of the documentation @@ -1171,35 +1147,36 @@ def all_features(): sage: list(all_features()) [...Feature('sage.combinat'), ...] """ - return [SAGE_SRC(), - sagemath_doc_html(), - sage__combinat(), - sage__geometry__polyhedron(), - sage__graphs(), - sage__groups(), - sage__libs__braiding(), - sage__libs__ecl(), - sage__libs__flint(), - sage__libs__gap(), - sage__libs__giac(), - sage__libs__homfly(), - sage__libs__linbox(), - sage__libs__m4ri(), - sage__libs__ntl(), - sage__libs__pari(), - sage__libs__singular(), - sage__modular(), - sage__modules(), - sage__numerical__mip(), - sage__plot(), - sage__rings__complex_double(), - sage__rings__finite_rings(), - sage__rings__function_field(), - sage__rings__number_field(), - sage__rings__padics(), - sage__rings__polynomial__pbori(), - sage__rings__real_double(), - sage__rings__real_mpfr(), - sage__sat(), - sage__schemes(), - sage__symbolic()] + return [ + sagemath_doc_html(), + sage__combinat(), + sage__geometry__polyhedron(), + sage__graphs(), + sage__groups(), + sage__libs__braiding(), + sage__libs__ecl(), + sage__libs__flint(), + sage__libs__gap(), + sage__libs__giac(), + sage__libs__homfly(), + sage__libs__linbox(), + sage__libs__m4ri(), + sage__libs__ntl(), + sage__libs__pari(), + sage__libs__singular(), + sage__modular(), + sage__modules(), + sage__numerical__mip(), + sage__plot(), + sage__rings__complex_double(), + sage__rings__finite_rings(), + sage__rings__function_field(), + sage__rings__number_field(), + sage__rings__padics(), + sage__rings__polynomial__pbori(), + sage__rings__real_double(), + sage__rings__real_mpfr(), + sage__sat(), + sage__schemes(), + sage__symbolic(), + ] diff --git a/src/sage/meson.build b/src/sage/meson.build index 7f8916219ee..a3bfd44ef8a 100644 --- a/src/sage/meson.build +++ b/src/sage/meson.build @@ -45,7 +45,6 @@ if gap_exe.found() check: true, ) gap_root_paths = gaprun.stdout().strip() - gap_root_paths = '${prefix}/lib/gap;${prefix}/share/gap;' + gaprun.stdout().strip() conf_data.set('GAP_ROOT_PATHS', gap_root_paths) endif ecm_bin = find_program( @@ -54,7 +53,34 @@ ecm_bin = find_program( disabler: true, ) conf_data.set('SAGE_ECMBIN', ecm_bin.full_path()) - +nauty_bins_prefix = '' +nauty_progs = [ + 'directg', + 'gentourng', + 'geng', + 'genbg', + 'gentreeg', + 'genktreeg', + 'genposetg', +] +extra_bin_paths = [] +if get_option('SAGE_LOCAL') != '' + extra_bin_paths += [join_paths(get_option('SAGE_LOCAL'), 'bin')] +endif +foreach prog : nauty_progs + nauty_check = find_program(prog, dirs: extra_bin_paths, required: false) + if not nauty_check.found() + nauty_check = find_program( + 'nauty-' + prog, + dirs: extra_bin_paths, + required: false, + ) + endif + if nauty_check.found() + nauty_bins_prefix = nauty_check.full_path().replace(prog, '') + endif +endforeach +conf_data.set('SAGE_NAUTY_BINS_PREFIX', nauty_bins_prefix) # Packages that need no processing and can be installed directly no_processing = [ 'cli', @@ -82,6 +108,7 @@ py.install_sources( '__init__.py', 'all.py', 'all_cmdline.py', + 'all_test.py', 'env.py', 'version.py', subdir: 'sage', diff --git a/src/sage/misc/package.py b/src/sage/misc/package.py index 3a5d750d6c8..33153aca674 100644 --- a/src/sage/misc/package.py +++ b/src/sage/misc/package.py @@ -39,18 +39,17 @@ # (at your option) any later version. # https://www.gnu.org/licenses/ # **************************************************************************** -from typing import NamedTuple, Optional, Union - -import sage.env - import json import os import subprocess import sys from pathlib import Path -from urllib.request import urlopen -from urllib.error import URLError from ssl import create_default_context as default_context +from typing import NamedTuple, Optional +from urllib.error import URLError +from urllib.request import urlopen + +import sage.env DEFAULT_PYPI = 'https://pypi.org/pypi' @@ -274,13 +273,6 @@ def list_packages(*pkg_types: str, pkg_sources: list[str] = ['normal', 'pip', 's 'babel', ... 'zipp'] - sage: sage_conf_info = L['sage_conf'] - sage: sage_conf_info.type - 'standard' - sage: sage_conf_info.is_installed() - True - sage: sage_conf_info.source - 'script' sage: # optional - sage_spkg internet sage: L = list_packages(pkg_sources=['pip'], local=True)