From 1fd4ddf5b5f49be5b20bacef0e15d6fb6030a48a Mon Sep 17 00:00:00 2001 From: Tobias Diez Date: Thu, 13 Mar 2025 21:30:28 +0100 Subject: [PATCH] Remove obsolete `sage-conf_conda` package --- .vscode/settings.json | 1 - pkgs/sage-conf/README.rst | 9 --- pkgs/sage-conf_conda/.gitignore | 6 -- pkgs/sage-conf_conda/MANIFEST.in | 52 ------------ pkgs/sage-conf_conda/README.rst | 1 - pkgs/sage-conf_conda/VERSION.txt | 1 - pkgs/sage-conf_conda/_sage_conf | 1 - pkgs/sage-conf_conda/bin | 1 - pkgs/sage-conf_conda/pyproject.toml | 1 - pkgs/sage-conf_conda/sage_conf.py | 1 - pkgs/sage-conf_conda/sage_root | 1 - pkgs/sage-conf_conda/setup.cfg | 1 - pkgs/sage-conf_conda/setup.py | 118 ---------------------------- src/doc/en/installation/conda.rst | 6 -- 14 files changed, 200 deletions(-) delete mode 100644 pkgs/sage-conf_conda/.gitignore delete mode 100644 pkgs/sage-conf_conda/MANIFEST.in delete mode 120000 pkgs/sage-conf_conda/README.rst delete mode 100644 pkgs/sage-conf_conda/VERSION.txt delete mode 120000 pkgs/sage-conf_conda/_sage_conf delete mode 120000 pkgs/sage-conf_conda/bin delete mode 120000 pkgs/sage-conf_conda/pyproject.toml delete mode 120000 pkgs/sage-conf_conda/sage_conf.py delete mode 120000 pkgs/sage-conf_conda/sage_root delete mode 120000 pkgs/sage-conf_conda/setup.cfg delete mode 100644 pkgs/sage-conf_conda/setup.py diff --git a/.vscode/settings.json b/.vscode/settings.json index 8998f229f9f..31d4b2681bc 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -9,7 +9,6 @@ // Exclude symbolic links into SAGE_ROOT/pkgs/ "build/pkgs/*/src": true, // Exclude symbolic links into SAGE_ROOT/src/ - "pkgs/sage-conf_conda/sage_root": true, "pkgs/sage-conf_pypi/sage_root": true, "pkgs/sage-docbuild/sage_docbuild": true, "pkgs/sage-setup/sage_setup": true, diff --git a/pkgs/sage-conf/README.rst b/pkgs/sage-conf/README.rst index e86c483c089..21481eabdfa 100644 --- a/pkgs/sage-conf/README.rst +++ b/pkgs/sage-conf/README.rst @@ -82,15 +82,6 @@ This version of the package is generated by the Sage distribution's ``./configur script. -sage_conf for conda -------------------- - -The version of the distribution package in the directory -`pkgs/sage-conf_conda `_ -may be used in an installation method of SageMath, where all packages -are provided by conda. This method is described in -https://doc.sagemath.org/html/en/installation/conda.html#using-conda-to-provide-all-dependencies-for-the-sage-library-experimental - sage_conf in downstream distributions ------------------------------------- diff --git a/pkgs/sage-conf_conda/.gitignore b/pkgs/sage-conf_conda/.gitignore deleted file mode 100644 index 6fdda73c500..00000000000 --- a/pkgs/sage-conf_conda/.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_conda/MANIFEST.in b/pkgs/sage-conf_conda/MANIFEST.in deleted file mode 100644 index 98897c3d4a7..00000000000 --- a/pkgs/sage-conf_conda/MANIFEST.in +++ /dev/null @@ -1,52 +0,0 @@ -prune .tox -include VERSION.txt -graft bin -exclude bin/sage-env-config # generated by configure - -prune sage_root -include sage_root/Makefile -include sage_root/README.md -include sage_root/VERSION.txt -include sage_root/bootstrap -graft sage_root/build -prune sage_root/build/.tox -exclude sage_root/build/bin/sage-build-env-config # generated by configure -exclude sage_root/build/make/Makefile-auto # generated by configure -exclude sage_root/build/make/Makefile # generated by configure - -# These sources are not needed because individual distributions of these are made. -prune sage_root/build/pkgs/*/src* - -graft sage_root/config -include sage_root/configure -include sage_root/configure.ac -graft sage_root/m4 - -# Only these pkgs are needed (because of dependencies on source files, -# see "git grep SAGE_ROOT build/pkgs/*/dependencies") -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 -exclude sage_root/pkgs/sage-conf/_sage_conf/_conf.py # generated by configure -graft sage_root/pkgs/sage-docbuild -prune sage_root/pkgs/sage-docbuild/build -prune sage_root/pkgs/sage-docbuild/dist -prune sage_root/pkgs/sage-docbuild/*.egg-info - -graft sage_root/src/_sage_conf -include sage_root/src/bin/sage-env -include sage_root/src/bin/sage-env-config.in -include sage_root/src/bin/sage-src-env-config.in -include sage_root/src/bin/sage-venv-config -include sage_root/src/bin/sage-version.sh -include sage_root/src/doc/bootstrap # FIXME: should move to builds/pkgs/sagemath_doc_html/ - -global-exclude .tox -global-exclude *~* -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_conda/README.rst b/pkgs/sage-conf_conda/README.rst deleted file mode 120000 index feda886cd36..00000000000 --- a/pkgs/sage-conf_conda/README.rst +++ /dev/null @@ -1 +0,0 @@ -../sage-conf/README.rst \ No newline at end of file diff --git a/pkgs/sage-conf_conda/VERSION.txt b/pkgs/sage-conf_conda/VERSION.txt deleted file mode 100644 index 58dbac5e85b..00000000000 --- a/pkgs/sage-conf_conda/VERSION.txt +++ /dev/null @@ -1 +0,0 @@ -10.6.beta9 diff --git a/pkgs/sage-conf_conda/_sage_conf b/pkgs/sage-conf_conda/_sage_conf deleted file mode 120000 index d92a91bef8c..00000000000 --- a/pkgs/sage-conf_conda/_sage_conf +++ /dev/null @@ -1 +0,0 @@ -../sage-conf/_sage_conf \ No newline at end of file diff --git a/pkgs/sage-conf_conda/bin b/pkgs/sage-conf_conda/bin deleted file mode 120000 index d7471f37a23..00000000000 --- a/pkgs/sage-conf_conda/bin +++ /dev/null @@ -1 +0,0 @@ -../sage-conf_pypi/bin \ No newline at end of file diff --git a/pkgs/sage-conf_conda/pyproject.toml b/pkgs/sage-conf_conda/pyproject.toml deleted file mode 120000 index 52c93c824e2..00000000000 --- a/pkgs/sage-conf_conda/pyproject.toml +++ /dev/null @@ -1 +0,0 @@ -../sage-conf/pyproject.toml \ No newline at end of file diff --git a/pkgs/sage-conf_conda/sage_conf.py b/pkgs/sage-conf_conda/sage_conf.py deleted file mode 120000 index f4bca8cc55c..00000000000 --- a/pkgs/sage-conf_conda/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_conda/sage_root b/pkgs/sage-conf_conda/sage_root deleted file mode 120000 index c25bddb6dd4..00000000000 --- a/pkgs/sage-conf_conda/sage_root +++ /dev/null @@ -1 +0,0 @@ -../.. \ No newline at end of file diff --git a/pkgs/sage-conf_conda/setup.cfg b/pkgs/sage-conf_conda/setup.cfg deleted file mode 120000 index 93df2c80a4b..00000000000 --- a/pkgs/sage-conf_conda/setup.cfg +++ /dev/null @@ -1 +0,0 @@ -../sage-conf/setup.cfg \ No newline at end of file diff --git a/pkgs/sage-conf_conda/setup.py b/pkgs/sage-conf_conda/setup.py deleted file mode 100644 index d3c8a8df3bd..00000000000 --- a/pkgs/sage-conf_conda/setup.py +++ /dev/null @@ -1,118 +0,0 @@ -import os -import sys -import shutil -import sysconfig -import platform -import fnmatch - -from pathlib import Path - -from setuptools import setup -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 - - -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() - - if not os.environ.get('CONDA_PREFIX', ''): - raise SetupError('No conda environment is active. ' - '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)' - print(f"Running {cmd}") - sys.stdout.flush() - if os.system(cmd) != 0: - if os.path.exists(os.path.join(SAGE_ROOT, 'config.status')): - print("Warning: A configuration has been written, but the configure script has exited with an error. " - "Carefully check any messages above before continuing.") - else: - print("Error: The configure script has 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 PACKAGES="$(build/bin/sage-get-system-packages conda {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 conda --verbose --sudo install $PACKAGES && echo ""') - raise SetupError("configure failed") - - # In this mode, we never run "make". - - # 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')) - - 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}-conda') - - 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/src/doc/en/installation/conda.rst b/src/doc/en/installation/conda.rst index 65f03583af6..f091d5c9be7 100644 --- a/src/doc/en/installation/conda.rst +++ b/src/doc/en/installation/conda.rst @@ -108,12 +108,6 @@ Here we assume that you are using a git checkout. $ ./bootstrap $ pip install --no-build-isolation --config-settings editable_mode=compat -v -v --editable ./src - If you encounter any errors, try to install the ``sage-conf`` package first:: - - $ pip install --no-build-isolation -v -v --editable ./pkgs/sage-conf_conda - - and then run the last command again. - - Verify that Sage has been installed:: $ sage -c 'print(version())'