From 26e16c7362a4a9833436bb36fc8b420da9ded798 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sun, 14 Mar 2021 20:49:42 -0700 Subject: [PATCH 01/39] Add configure option --disable-sagelib --- build/make/Makefile.in | 1 - configure.ac | 8 ++++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/build/make/Makefile.in b/build/make/Makefile.in index 8ba89d78c74..f15eea4a139 100644 --- a/build/make/Makefile.in +++ b/build/make/Makefile.in @@ -232,7 +232,6 @@ base-toolchain: _clean-broken-gcc base # All targets except for the base packages all-sage: \ - sagelib \ $(INSTALLED_PACKAGE_INSTS) \ $(UNINSTALLED_PACKAGES_CLEANS) diff --git a/configure.ac b/configure.ac index e331c30435d..cc9303a7aac 100644 --- a/configure.ac +++ b/configure.ac @@ -428,6 +428,14 @@ AS_IF([test "x$enable_download_from_upstream_url" = "xyes"], [ ]) AC_SUBST([SAGE_SPKG_OPTIONS]) +AC_ARG_ENABLE([sagelib], + AS_HELP_STRING([--disable-sagelib], + [disable build of the Sage library and packages depending on it]), [ + for pkg in sagelib sage_docbuild; do + AS_VAR_SET([SAGE_ENABLE_$pkg], [$enableval]) + done + ]) + AC_ARG_ENABLE([notebook], AS_HELP_STRING([--disable-notebook], [disable build of the Jupyter notebook and related packages]), [ From 3dc9618377133f7983a374630cd3459568a3a10a Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Mon, 29 Jun 2020 14:34:45 -0700 Subject: [PATCH 02/39] pkgs/sage-conf_pypi: New --- build/bin/write-dockerfile.sh | 2 +- build/pkgs/sage_conf/spkg-src | 4 +- pkgs/sage-conf/.gitignore | 2 + pkgs/sage-conf/pyproject.toml | 3 + pkgs/sage-conf/sage_conf.py.in | 2 + pkgs/sage-conf_pypi/.gitignore | 5 ++ pkgs/sage-conf_pypi/MANIFEST.in | 16 ++++ pkgs/sage-conf_pypi/README.rst | 44 ++++++++++ pkgs/sage-conf_pypi/VERSION.txt | 1 + pkgs/sage-conf_pypi/bin/sage-env-config.in | 1 + pkgs/sage-conf_pypi/pyproject.toml | 3 + pkgs/sage-conf_pypi/sage_conf.py.in | 1 + .../sage_root/.homebrew-build-env | 1 + pkgs/sage-conf_pypi/sage_root/Makefile | 1 + pkgs/sage-conf_pypi/sage_root/README.md | 1 + pkgs/sage-conf_pypi/sage_root/VERSION.txt | 1 + pkgs/sage-conf_pypi/sage_root/bootstrap | 3 + pkgs/sage-conf_pypi/sage_root/build | 1 + pkgs/sage-conf_pypi/sage_root/config | 1 + pkgs/sage-conf_pypi/sage_root/configure | 1 + pkgs/sage-conf_pypi/sage_root/configure.ac | 1 + pkgs/sage-conf_pypi/sage_root/m4 | 1 + pkgs/sage-conf_pypi/sage_root/src/bin | 1 + .../sage_root/src/doc/bootstrap | 3 + pkgs/sage-conf_pypi/setup.cfg | 20 +++++ pkgs/sage-conf_pypi/setup.py | 82 +++++++++++++++++++ pkgs/sage-conf_pypi/tox.ini | 12 +++ 27 files changed, 210 insertions(+), 4 deletions(-) create mode 100644 pkgs/sage-conf/pyproject.toml create mode 100644 pkgs/sage-conf_pypi/.gitignore create mode 100644 pkgs/sage-conf_pypi/MANIFEST.in create mode 100644 pkgs/sage-conf_pypi/README.rst create mode 120000 pkgs/sage-conf_pypi/VERSION.txt create mode 120000 pkgs/sage-conf_pypi/bin/sage-env-config.in create mode 100644 pkgs/sage-conf_pypi/pyproject.toml create mode 120000 pkgs/sage-conf_pypi/sage_conf.py.in create mode 120000 pkgs/sage-conf_pypi/sage_root/.homebrew-build-env create mode 120000 pkgs/sage-conf_pypi/sage_root/Makefile create mode 120000 pkgs/sage-conf_pypi/sage_root/README.md create mode 120000 pkgs/sage-conf_pypi/sage_root/VERSION.txt create mode 100755 pkgs/sage-conf_pypi/sage_root/bootstrap create mode 120000 pkgs/sage-conf_pypi/sage_root/build create mode 120000 pkgs/sage-conf_pypi/sage_root/config create mode 120000 pkgs/sage-conf_pypi/sage_root/configure create mode 120000 pkgs/sage-conf_pypi/sage_root/configure.ac create mode 120000 pkgs/sage-conf_pypi/sage_root/m4 create mode 120000 pkgs/sage-conf_pypi/sage_root/src/bin create mode 100755 pkgs/sage-conf_pypi/sage_root/src/doc/bootstrap create mode 100644 pkgs/sage-conf_pypi/setup.cfg create mode 100644 pkgs/sage-conf_pypi/setup.py create mode 100644 pkgs/sage-conf_pypi/tox.ini diff --git a/build/bin/write-dockerfile.sh b/build/bin/write-dockerfile.sh index b381f677a48..908b7a572bf 100755 --- a/build/bin/write-dockerfile.sh +++ b/build/bin/write-dockerfile.sh @@ -186,7 +186,7 @@ FROM with-system-packages as bootstrapped #:bootstrapping: RUN mkdir -p /sage WORKDIR /sage -ADD Makefile VERSION.txt README.md bootstrap configure.ac sage ./ +ADD Makefile VERSION.txt COPYING.txt condarc.yml README.md bootstrap configure.ac sage .homebrew-build-env tox.ini Pipfile.m4 ./ ADD src/doc/bootstrap src/doc/bootstrap ADD src/bin src/bin ADD m4 ./m4 diff --git a/build/pkgs/sage_conf/spkg-src b/build/pkgs/sage_conf/spkg-src index cad851bd9d5..af6e8b16342 100755 --- a/build/pkgs/sage_conf/spkg-src +++ b/build/pkgs/sage_conf/spkg-src @@ -15,7 +15,5 @@ fi # Exit on failure set -e -cd build/pkgs/sage_conf - -cd src +cd pkgs/sage-conf_pypi python3 -u setup.py --no-user-cfg sdist --dist-dir "$SAGE_DISTFILES" diff --git a/pkgs/sage-conf/.gitignore b/pkgs/sage-conf/.gitignore index c94082c9d9a..2975b16e54b 100644 --- a/pkgs/sage-conf/.gitignore +++ b/pkgs/sage-conf/.gitignore @@ -1,2 +1,4 @@ /sage_conf.py /setup.cfg +/build +/*.egg-info diff --git a/pkgs/sage-conf/pyproject.toml b/pkgs/sage-conf/pyproject.toml new file mode 100644 index 00000000000..9787c3bdf00 --- /dev/null +++ b/pkgs/sage-conf/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["setuptools", "wheel"] +build-backend = "setuptools.build_meta" diff --git a/pkgs/sage-conf/sage_conf.py.in b/pkgs/sage-conf/sage_conf.py.in index 0686462c96a..1b85d2e7c64 100644 --- a/pkgs/sage-conf/sage_conf.py.in +++ b/pkgs/sage-conf/sage_conf.py.in @@ -44,6 +44,8 @@ THREEJS_DIR = SAGE_LOCAL + "/share/threejs" OPENMP_CFLAGS = "@OPENMP_CFLAGS@" OPENMP_CXXFLAGS = "@OPENMP_CXXFLAGS@" +SAGE_SPKG_WHEELS = "@prefix@/var/lib/sage/wheels" + # Entry point 'sage-config'. It does not depend on any packages. def _main(): diff --git a/pkgs/sage-conf_pypi/.gitignore b/pkgs/sage-conf_pypi/.gitignore new file mode 100644 index 00000000000..3bb4a6af5d1 --- /dev/null +++ b/pkgs/sage-conf_pypi/.gitignore @@ -0,0 +1,5 @@ +/sage_conf.py +/build +/dist +/*.egg-info +/.tox diff --git a/pkgs/sage-conf_pypi/MANIFEST.in b/pkgs/sage-conf_pypi/MANIFEST.in new file mode 100644 index 00000000000..59c5e9d8290 --- /dev/null +++ b/pkgs/sage-conf_pypi/MANIFEST.in @@ -0,0 +1,16 @@ +graft sage_root +# These sources are not needed because individual distributions of these are made. +prune sage_root/build/pkgs/*/src* +# Except for this one because config.status writes there +graft sage_root/build/pkgs/sage_conf/src +prune sage_root/build/pkgs/sage_conf/src/build +# And this one because of declared dependencies on source files in Makefile.in +graft sage_root/build/pkgs/sage_docbuild/src +prune sage_root/build/pkgs/sage_docbuild/src/build +prune sage_root/build/pkgs/sage_docbuild/src/sage_docbuild.egg-info +# +global-exclude .tox +global-exclude *~* +global-exclude *.bak +global-exclude __pycache__ +global-exclude *.pyc diff --git a/pkgs/sage-conf_pypi/README.rst b/pkgs/sage-conf_pypi/README.rst new file mode 100644 index 00000000000..81cf41c321e --- /dev/null +++ b/pkgs/sage-conf_pypi/README.rst @@ -0,0 +1,44 @@ +sage_conf: Configuration module for the SageMath library (sdist version) +======================================================================== + +Description +----------- + +This 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 + +This version of the package is suitable to be put as a source distribution on PyPI. + +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``. + + +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 ``src/pkgs/sage_conf-pypi/``. diff --git a/pkgs/sage-conf_pypi/VERSION.txt b/pkgs/sage-conf_pypi/VERSION.txt new file mode 120000 index 00000000000..43f4773d7de --- /dev/null +++ b/pkgs/sage-conf_pypi/VERSION.txt @@ -0,0 +1 @@ +../../src/VERSION.txt \ 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 new file mode 120000 index 00000000000..4fd6ef7d1fd --- /dev/null +++ b/pkgs/sage-conf_pypi/bin/sage-env-config.in @@ -0,0 +1 @@ +../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 new file mode 100644 index 00000000000..9787c3bdf00 --- /dev/null +++ b/pkgs/sage-conf_pypi/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["setuptools", "wheel"] +build-backend = "setuptools.build_meta" diff --git a/pkgs/sage-conf_pypi/sage_conf.py.in b/pkgs/sage-conf_pypi/sage_conf.py.in new file mode 120000 index 00000000000..ed20b4df7fd --- /dev/null +++ b/pkgs/sage-conf_pypi/sage_conf.py.in @@ -0,0 +1 @@ +../sage-conf/sage_conf.py.in \ 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 new file mode 120000 index 00000000000..18573e75488 --- /dev/null +++ b/pkgs/sage-conf_pypi/sage_root/.homebrew-build-env @@ -0,0 +1 @@ +../../../.homebrew-build-env \ No newline at end of file diff --git a/pkgs/sage-conf_pypi/sage_root/Makefile b/pkgs/sage-conf_pypi/sage_root/Makefile new file mode 120000 index 00000000000..62a7b627cbc --- /dev/null +++ b/pkgs/sage-conf_pypi/sage_root/Makefile @@ -0,0 +1 @@ +../../../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 new file mode 120000 index 00000000000..8a33348c7d8 --- /dev/null +++ b/pkgs/sage-conf_pypi/sage_root/README.md @@ -0,0 +1 @@ +../../../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 new file mode 120000 index 00000000000..c4fcb84c1a7 --- /dev/null +++ b/pkgs/sage-conf_pypi/sage_root/VERSION.txt @@ -0,0 +1 @@ +../../../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 new file mode 100755 index 00000000000..38df9dbea8a --- /dev/null +++ b/pkgs/sage-conf_pypi/sage_root/bootstrap @@ -0,0 +1,3 @@ +#! /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 new file mode 120000 index 00000000000..44735d58664 --- /dev/null +++ b/pkgs/sage-conf_pypi/sage_root/build @@ -0,0 +1 @@ +../../../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 new file mode 120000 index 00000000000..101d543820c --- /dev/null +++ b/pkgs/sage-conf_pypi/sage_root/config @@ -0,0 +1 @@ +../../../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 new file mode 120000 index 00000000000..5cc41f0cbb4 --- /dev/null +++ b/pkgs/sage-conf_pypi/sage_root/configure @@ -0,0 +1 @@ +../../../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 new file mode 120000 index 00000000000..663513d0394 --- /dev/null +++ b/pkgs/sage-conf_pypi/sage_root/configure.ac @@ -0,0 +1 @@ +../../../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 new file mode 120000 index 00000000000..af1ea766194 --- /dev/null +++ b/pkgs/sage-conf_pypi/sage_root/m4 @@ -0,0 +1 @@ +../../../m4 \ No newline at end of file diff --git a/pkgs/sage-conf_pypi/sage_root/src/bin b/pkgs/sage-conf_pypi/sage_root/src/bin new file mode 120000 index 00000000000..459186de7e0 --- /dev/null +++ b/pkgs/sage-conf_pypi/sage_root/src/bin @@ -0,0 +1 @@ +../../../../src/bin \ 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 new file mode 100755 index 00000000000..2a2bb398b9a --- /dev/null +++ b/pkgs/sage-conf_pypi/sage_root/src/doc/bootstrap @@ -0,0 +1,3 @@ +#! /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 new file mode 100644 index 00000000000..859f59ddee3 --- /dev/null +++ b/pkgs/sage-conf_pypi/setup.cfg @@ -0,0 +1,20 @@ +[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] +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_pypi/setup.py b/pkgs/sage-conf_pypi/setup.py new file mode 100644 index 00000000000..3592a26ddbd --- /dev/null +++ b/pkgs/sage-conf_pypi/setup.py @@ -0,0 +1,82 @@ +import os +import sys +import shutil + +from setuptools import setup +from distutils.command.build_scripts import build_scripts as distutils_build_scripts +from distutils.command.build_py import build_py as distutils_build_py +from distutils.errors import (DistutilsSetupError, DistutilsModuleError, + DistutilsOptionError) + +class build_py(distutils_build_py): + + def run(self): + DOT_SAGE = os.environ.get('DOT_SAGE', os.path.join(os.environ.get('HOME'), '.sage')) + HERE = os.path.dirname(__file__) + with open(os.path.join(HERE, 'VERSION.txt')) as f: + sage_version = f.read().strip() + # For convenience, set up the homebrew env automatically. This is a no-op if homebrew is not present. + SETENV = '(. ./.homebrew-build-env 2> /dev/null || :)' + # Until pynac is repackaged as a pip-installable package (#30534), SAGE_LOCAL still has to be specific to + # the Python version. Note that as of pynac-0.7.26.sage-2020-04-03, on Cygwin, pynac is linked through + # to libpython; whereas on all other platforms, it is not linked through, so we only key it to the SOABI. + soabi = sysconfig.get_config_var('SOABI') + if sys.platform == 'cygwin': + libdir_tag = sysconfig.get_config_var('LIBDIR').replace(' ', '-').replace('\\', '-').replace('/', '-') + ldversion = sysconfig.get_config_var('LDVERSION') + python_tag = f'{libdir_tag}-{ldversion}' + else: + python_tag = soabi + # TODO: These two should be user-configurable with options passed to "setup.py install" + SAGE_ROOT = os.path.join(DOT_SAGE, f'sage-{sage_version}-{python_tag}') + SAGE_LOCAL = os.path.join(SAGE_ROOT, 'local') + if os.path.exists(os.path.join(SAGE_ROOT, 'config.status')): + print(f'Reusing SAGE_ROOT={SAGE_ROOT}') + else: + # 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) # will fail if already exists + except Exception: + raise DistutilsSetupError(f"the directory SAGE_ROOT={SAGE_ROOT} already exists but it is not configured. Please remove it and try again.") + cmd = f"cd {SAGE_ROOT} && {SETENV} && ./configure --prefix={SAGE_LOCAL} --with-python={sys.executable} --enable-build-as-root --with-system-python3=force --disable-notebook --disable-sagelib" + print(f"Running {cmd}") + if os.system(cmd) != 0: + raise DistutilsSetupError("configure failed") + # 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_LOCAL, 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' + cmd = f'cd {SAGE_ROOT} && {SETENV} && {SETMAKE} && $MAKE V=0 build' + if os.system(cmd) != 0: + raise DistutilsSetupError("make build-local failed") + + # Install configuration + shutil.copyfile(os.path.join(SAGE_ROOT, 'build', 'pkgs', 'sage_conf', 'src', 'sage_conf.py'), + os.path.join(HERE, 'sage_conf.py')) + if not self.distribution.py_modules: + self.py_modules = self.distribution.py_modules = [] + self.distribution.py_modules.append('sage_conf') + shutil.copyfile(os.path.join(SAGE_ROOT, 'src', 'bin', 'sage-env-config'), + os.path.join(HERE, 'bin', 'sage-env-config')) + distutils_build_py.run(self) + +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() + if 'console_scripts' not in self.distribution.entry_points: + self.distribution.entry_points['console_scripts'] = [] + self.distribution.entry_points['console_scripts'].append('sage-config=sage_conf:_main') + distutils_build_scripts.run(self) + +setup( + cmdclass=dict(build_py=build_py, build_scripts=build_scripts) +) diff --git a/pkgs/sage-conf_pypi/tox.ini b/pkgs/sage-conf_pypi/tox.ini new file mode 100644 index 00000000000..b530bd10554 --- /dev/null +++ b/pkgs/sage-conf_pypi/tox.ini @@ -0,0 +1,12 @@ +[tox] +envlist = python + +[testenv] +passenv = + MAKE + +setenv = + HOME={envdir} + +commands = + sage-config From ba67c92a5056241e0273feb9b701fb0c56b48683 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Fri, 25 Jun 2021 00:29:09 -0700 Subject: [PATCH 03/39] Put pkgs/sage-conf in the root --- pkgs/sage-conf_pypi/sage_root/pkgs/sage-conf | 1 + 1 file changed, 1 insertion(+) create mode 120000 pkgs/sage-conf_pypi/sage_root/pkgs/sage-conf diff --git a/pkgs/sage-conf_pypi/sage_root/pkgs/sage-conf b/pkgs/sage-conf_pypi/sage_root/pkgs/sage-conf new file mode 120000 index 00000000000..a5beefae37f --- /dev/null +++ b/pkgs/sage-conf_pypi/sage_root/pkgs/sage-conf @@ -0,0 +1 @@ +../../../sage-conf \ No newline at end of file From e825a9f554fcc4eda8665fa9b9f708d6382b324d Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Fri, 25 Jun 2021 11:44:19 -0700 Subject: [PATCH 04/39] pkgs/sage-conf_pypi: Fixup MANIFEST.in, setup.py --- pkgs/sage-conf_pypi/MANIFEST.in | 1 + pkgs/sage-conf_pypi/setup.py | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/pkgs/sage-conf_pypi/MANIFEST.in b/pkgs/sage-conf_pypi/MANIFEST.in index 59c5e9d8290..bb46a994f5d 100644 --- a/pkgs/sage-conf_pypi/MANIFEST.in +++ b/pkgs/sage-conf_pypi/MANIFEST.in @@ -1,3 +1,4 @@ +include VERSION.txt graft sage_root # These sources are not needed because individual distributions of these are made. prune sage_root/build/pkgs/*/src* diff --git a/pkgs/sage-conf_pypi/setup.py b/pkgs/sage-conf_pypi/setup.py index 3592a26ddbd..631bf64149a 100644 --- a/pkgs/sage-conf_pypi/setup.py +++ b/pkgs/sage-conf_pypi/setup.py @@ -1,14 +1,16 @@ import os import sys import shutil +import sysconfig from setuptools import setup from distutils.command.build_scripts import build_scripts as distutils_build_scripts -from distutils.command.build_py import build_py as distutils_build_py +from setuptools.command.build_py import build_py as setuptools_build_py +from setuptools.command.egg_info import egg_info as setuptools_egg_info from distutils.errors import (DistutilsSetupError, DistutilsModuleError, DistutilsOptionError) -class build_py(distutils_build_py): +class build_py(setuptools_build_py): def run(self): DOT_SAGE = os.environ.get('DOT_SAGE', os.path.join(os.environ.get('HOME'), '.sage')) @@ -52,7 +54,7 @@ def run(self): # 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' - cmd = f'cd {SAGE_ROOT} && {SETENV} && {SETMAKE} && $MAKE V=0 build' + cmd = f'cd {SAGE_ROOT} && {SETENV} && {SETMAKE} && $MAKE V=0 build-local' if os.system(cmd) != 0: raise DistutilsSetupError("make build-local failed") From ad8bad166890a0df0794d7eadf1d383f3c7fd4a8 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Fri, 25 Jun 2021 12:01:36 -0700 Subject: [PATCH 05/39] Makefile (pypi-sdists): New --- Makefile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Makefile b/Makefile index 567bffbffd0..6aaf4a0b4e1 100644 --- a/Makefile +++ b/Makefile @@ -79,6 +79,13 @@ download: dist: build/make/Makefile ./sage --sdist +pypi-sdists: + ./sage --sh build/pkgs/sage_conf/spkg-src + ./sage --sh build/pkgs/sage_sws2rst/spkg-src + ./sage --sh build/pkgs/sage_docbuild/spkg-src + ./sage --sh build/pkgs/sagelib/spkg-src + @echo "Built sdists are in upstream/" + # ssl: build Sage, and also install pyOpenSSL. This is necessary for # running the secure notebook. This make target requires internet # access. Note that this requires that your system have OpenSSL From 8c0ccf319cf038e836c38f494d380f30eb5413ca Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Tue, 6 Apr 2021 17:39:03 -0700 Subject: [PATCH 06/39] src/pkgs/sage_conf*/README.rst: Unify the files build/pkgs/sagelib/src/README.rst: Link to sage-conf on pypi Signed-off-by: Matthias Koeppe Fixup: Add missing symlinks src/pkgs/sage_conf-{pypi,relocatable}/README.rst --- pkgs/sage-conf/README.rst | 83 ++++++++++++++++++++++++++++--- pkgs/sage-conf_pypi/README.rst | 45 +---------------- pkgs/sagemath-standard/README.rst | 5 +- 3 files changed, 80 insertions(+), 53 deletions(-) mode change 100644 => 120000 pkgs/sage-conf_pypi/README.rst diff --git a/pkgs/sage-conf/README.rst b/pkgs/sage-conf/README.rst index 1c08375b03a..7b28f9f0de6 100644 --- a/pkgs/sage-conf/README.rst +++ b/pkgs/sage-conf/README.rst @@ -1,10 +1,10 @@ -sage_conf: Configuration module for the SageMath library -======================================================== +sage_conf: Configuration module for the SageMath library (distributable version) +================================================================================ Description ----------- -This package provides: +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 @@ -15,10 +15,77 @@ This package provides: - a sourcable shell script ``sage-env-config``, providing additional configuration information in the form of environment variables -This version of the package is generated by the Sage distribution's ``configure`` -script. Downstream packagers and advanced developers and users may want to provide -their own implementation of the package to support the intended deployment of -the SageMath library. +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://trac.sagemath.org/ticket/29039, which adds the directory +``src/pkgs/sage_conf-pypi/``. + +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://trac.sagemath.org/ticket/31396, +which adds the directory ``src/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 and +on Cygwin. 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 +``build/pkgs/sage_conf/src``. 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 ------- @@ -31,4 +98,4 @@ Upstream Contact https://www.sagemath.org This package is included in the source code of the Sage distribution, -in ``/sage_conf``. +in ``pkgs/sage-conf``. diff --git a/pkgs/sage-conf_pypi/README.rst b/pkgs/sage-conf_pypi/README.rst deleted file mode 100644 index 81cf41c321e..00000000000 --- a/pkgs/sage-conf_pypi/README.rst +++ /dev/null @@ -1,44 +0,0 @@ -sage_conf: Configuration module for the SageMath library (sdist version) -======================================================================== - -Description ------------ - -This 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 - -This version of the package is suitable to be put as a source distribution on PyPI. - -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``. - - -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 ``src/pkgs/sage_conf-pypi/``. diff --git a/pkgs/sage-conf_pypi/README.rst b/pkgs/sage-conf_pypi/README.rst new file mode 120000 index 00000000000..2ef14860f06 --- /dev/null +++ b/pkgs/sage-conf_pypi/README.rst @@ -0,0 +1 @@ +../sage_conf/README.rst \ No newline at end of file diff --git a/pkgs/sagemath-standard/README.rst b/pkgs/sagemath-standard/README.rst index 52e0533c8c2..5709c22249b 100644 --- a/pkgs/sagemath-standard/README.rst +++ b/pkgs/sagemath-standard/README.rst @@ -22,7 +22,10 @@ About this experimental pip-installable source distribution This pip-installable source distribution `sagemath-standard` is an experimental distribution of the Sage Library. Use at your own risk. -Building `sagemath-standard` has a large number of system packages as prerequisites. See https://doc.sagemath.org/html/en/installation/source.html#linux-recommended-installation +Building `sagemath-standard` has a large number of system packages as prerequisites. +See https://doc.sagemath.org/html/en/installation/source.html#linux-recommended-installation for partial lists for various systems. +The connection to the system environment is facilitated through the https://pypi.org/project/sage-conf/ distribution package. + A modularization effort is in progress with the goal of making it possible to install parts of the Sage Library with fewer prerequisites. https://trac.sagemath.org/ticket/29705 From 2181f10720e2c6531b33d84be0cc0aeb8e660030 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Fri, 25 Jun 2021 12:59:56 -0700 Subject: [PATCH 07/39] pkgs/sage-conf_pypi: Fixup --- pkgs/sage-conf_pypi/MANIFEST.in | 1 + pkgs/sage-conf_pypi/README.rst | 2 +- pkgs/sage-conf_pypi/bin/sage-env-config.in | 2 +- pkgs/sage-conf_pypi/setup.cfg | 6 +----- pkgs/sage-conf_pypi/setup.py | 2 +- 5 files changed, 5 insertions(+), 8 deletions(-) diff --git a/pkgs/sage-conf_pypi/MANIFEST.in b/pkgs/sage-conf_pypi/MANIFEST.in index bb46a994f5d..744d661c092 100644 --- a/pkgs/sage-conf_pypi/MANIFEST.in +++ b/pkgs/sage-conf_pypi/MANIFEST.in @@ -1,4 +1,5 @@ include VERSION.txt +graft bin graft sage_root # These sources are not needed because individual distributions of these are made. prune sage_root/build/pkgs/*/src* diff --git a/pkgs/sage-conf_pypi/README.rst b/pkgs/sage-conf_pypi/README.rst index 2ef14860f06..feda886cd36 120000 --- a/pkgs/sage-conf_pypi/README.rst +++ b/pkgs/sage-conf_pypi/README.rst @@ -1 +1 @@ -../sage_conf/README.rst \ No newline at end of file +../sage-conf/README.rst \ 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 index 4fd6ef7d1fd..59e39e7e944 120000 --- a/pkgs/sage-conf_pypi/bin/sage-env-config.in +++ b/pkgs/sage-conf_pypi/bin/sage-env-config.in @@ -1 +1 @@ -../sage-conf/bin/sage-env-config.in \ No newline at end of file +../../sage-conf/bin/sage-env-config.in \ No newline at end of file diff --git a/pkgs/sage-conf_pypi/setup.cfg b/pkgs/sage-conf_pypi/setup.cfg index 859f59ddee3..a024eb955a0 100644 --- a/pkgs/sage-conf_pypi/setup.cfg +++ b/pkgs/sage-conf_pypi/setup.cfg @@ -1,5 +1,5 @@ [metadata] -name = sage_conf +name = sage-conf version = file: VERSION.txt description = Sage: Open Source Mathematics Software: Configuration module for the SageMath library long_description = file: README.rst @@ -14,7 +14,3 @@ py_modules = scripts = bin/sage-env-config - -[options.entry_points] -console_scripts = - sage-config = sage_conf:_main diff --git a/pkgs/sage-conf_pypi/setup.py b/pkgs/sage-conf_pypi/setup.py index 631bf64149a..2ed29f0d500 100644 --- a/pkgs/sage-conf_pypi/setup.py +++ b/pkgs/sage-conf_pypi/setup.py @@ -66,7 +66,7 @@ def run(self): self.distribution.py_modules.append('sage_conf') shutil.copyfile(os.path.join(SAGE_ROOT, 'src', 'bin', 'sage-env-config'), os.path.join(HERE, 'bin', 'sage-env-config')) - distutils_build_py.run(self) + setuptools_build_py.run(self) class build_scripts(distutils_build_scripts): From 9a6a4b2bdfc11fefc4602da2fb69416af8a1754b Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Mon, 15 Jun 2020 11:45:26 -0700 Subject: [PATCH 08/39] sage.env: Do not die if DOT_SAGE is None --- src/sage/env.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sage/env.py b/src/sage/env.py index e792ca80450..b50f04b1375 100644 --- a/src/sage/env.py +++ b/src/sage/env.py @@ -317,7 +317,7 @@ def _get_shared_lib_path(*libnames: str) -> Optional[str]: GAP_SO = var("GAP_SO", _get_shared_lib_path("gap", "")) # post process -if ' ' in DOT_SAGE: +if DOT_SAGE is not None and ' ' in DOT_SAGE: if UNAME[:6] == 'CYGWIN': # on windows/cygwin it is typical for the home directory # to have a space in it. Fortunately, users also have From 206a6dcccdb760a57417b0a404092c5a714bffd1 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Mon, 15 Jun 2020 11:43:41 -0700 Subject: [PATCH 09/39] sage.misc.misc, sage.misc.persist, sage.structure.formal_sum: Make some imports local to functions --- src/sage/misc/misc.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/sage/misc/misc.py b/src/sage/misc/misc.py index 4580f836f18..acfa554965d 100644 --- a/src/sage/misc/misc.py +++ b/src/sage/misc/misc.py @@ -43,7 +43,6 @@ import resource import pdb import warnings -import sage.misc.prandom as random from .lazy_string import lazy_string import sage.server.support @@ -925,6 +924,7 @@ def random_sublist(X, s): sage: is_sublist(sublist, S) True """ + import sage.misc.prandom as random return [a for a in X if random.random() <= s] def is_sublist(X, Y): @@ -1029,6 +1029,7 @@ def _some_tuples_sampling(elements, repeat, max_samples, n): True """ from sage.rings.integer import Integer + import sage.misc.prandom as random N = n if repeat is None else n**repeat # We sample on range(N) and create tuples manually since we don't want to create the list of all possible tuples in memory for a in random.sample(range(N), max_samples): @@ -1278,6 +1279,7 @@ def embedded(): sage: sage.misc.misc.embedded() # output True if in the notebook False """ + import sage.server.support return sage.server.support.EMBEDDED_MODE From edb00b2257d231641d790a238d9a8d9ea40252da Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sun, 14 Jun 2020 23:12:23 -0700 Subject: [PATCH 10/39] build/pkgs/sage_objects: New build/pkgs/sage_objects: Add dependencies, get minimal tox working Version with sage.structure, sage.categories that builds OK; uses gmpy2 On the way to get sage.structure.all importing build/pkgs/sage_objects/src/tox.ini: Add comments, test more Now we can import sage.categories.all build/pkgs/sage_objects/src/setup.py: Remove unused imports build/pkgs/sage_objects/src/setup.py: Remove code for namespace packages and distribution filtering build/pkgs/sage_objects/: Add/update metadata build/pkgs/sage_objects/src/README.md: Add doc links build/pkgs/sage_objects/spkg-install: Replace by the script from sage_tdlib build/pkgs/sage_objects/dependencies: Add more build/pkgs/sage_objects: Do not install, only test with tox, for now --- build/pkgs/sage_objects/dependencies | 3 ++ build/pkgs/sage_objects/package-version.txt | 1 + build/pkgs/sage_objects/spkg-install | 8 +++ build/pkgs/sage_objects/spkg-src | 21 ++++++++ build/pkgs/sage_objects/src/MANIFEST.in | 57 ++++++++++++++++++++ build/pkgs/sage_objects/src/README.md | 13 +++++ build/pkgs/sage_objects/src/requirements.txt | 4 ++ build/pkgs/sage_objects/src/sage | 1 + build/pkgs/sage_objects/src/sage_setup | 1 + build/pkgs/sage_objects/src/setup.cfg | 15 ++++++ build/pkgs/sage_objects/src/setup.py | 26 +++++++++ build/pkgs/sage_objects/src/tox.ini | 19 +++++++ build/pkgs/sage_objects/type | 1 + 13 files changed, 170 insertions(+) create mode 100644 build/pkgs/sage_objects/dependencies create mode 120000 build/pkgs/sage_objects/package-version.txt create mode 100755 build/pkgs/sage_objects/spkg-install create mode 100755 build/pkgs/sage_objects/spkg-src create mode 100644 build/pkgs/sage_objects/src/MANIFEST.in create mode 100644 build/pkgs/sage_objects/src/README.md create mode 100644 build/pkgs/sage_objects/src/requirements.txt create mode 120000 build/pkgs/sage_objects/src/sage create mode 120000 build/pkgs/sage_objects/src/sage_setup create mode 100644 build/pkgs/sage_objects/src/setup.cfg create mode 100644 build/pkgs/sage_objects/src/setup.py create mode 100644 build/pkgs/sage_objects/src/tox.ini create mode 100644 build/pkgs/sage_objects/type diff --git a/build/pkgs/sage_objects/dependencies b/build/pkgs/sage_objects/dependencies new file mode 100644 index 00000000000..cd26ff79da6 --- /dev/null +++ b/build/pkgs/sage_objects/dependencies @@ -0,0 +1,3 @@ +FORCE $(PYTHON) cysignals gmpy2 | $(PYTHON_TOOLCHAIN) cython pkgconfig $(and $(filter-out no,$(SAGE_CHECK)), tox) + +# FORCE: Always run the spkg-install script diff --git a/build/pkgs/sage_objects/package-version.txt b/build/pkgs/sage_objects/package-version.txt new file mode 120000 index 00000000000..cf10fe4b4e4 --- /dev/null +++ b/build/pkgs/sage_objects/package-version.txt @@ -0,0 +1 @@ +../sagelib/package-version.txt \ No newline at end of file diff --git a/build/pkgs/sage_objects/spkg-install b/build/pkgs/sage_objects/spkg-install new file mode 100755 index 00000000000..59e83e7010f --- /dev/null +++ b/build/pkgs/sage_objects/spkg-install @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +cd src + +if [ "$SAGE_CHECK" != no ]; then + tox +fi +# We skip the install for now. +exit 0 diff --git a/build/pkgs/sage_objects/spkg-src b/build/pkgs/sage_objects/spkg-src new file mode 100755 index 00000000000..ea8aa3fcad7 --- /dev/null +++ b/build/pkgs/sage_objects/spkg-src @@ -0,0 +1,21 @@ +#!/usr/bin/env bash +# +# Script to prepare an sdist tarball for sage_objects +# This script is not used during build. +# +# HOW TO MAKE THE TARBALL: +# 1) ./sage --sh build/pkgs/sage_objects/spkg-src + +if [ -z "$SAGE_ROOT" ] ; then + echo >&2 "Error - SAGE_ROOT undefined ... exiting" + echo >&2 "Maybe run 'sage -sh'?" + exit 1 +fi + +# Exit on failure +set -e + +cd build/pkgs/sage_objects + +cd src +sage-python23 -u setup.py --no-user-cfg sdist --dist-dir "$SAGE_DISTFILES" diff --git a/build/pkgs/sage_objects/src/MANIFEST.in b/build/pkgs/sage_objects/src/MANIFEST.in new file mode 100644 index 00000000000..e39c8ba1765 --- /dev/null +++ b/build/pkgs/sage_objects/src/MANIFEST.in @@ -0,0 +1,57 @@ +prune sage +graft sage/cpython +include sage/__init__.py # FIXME: Needs to become a namespace package +include sage/env.py # FIXME: sage_setup must be changed so it does not depend on it +include sage/version.py # FIXME: likewise + +graft sage/structure +graft sage/categories +include sage/misc/__init__.py +include sage/misc/classcall_metaclass.* +include sage/misc/inherit_comparison*.* +include sage/misc/weak_dict.* +include sage/misc/nested_class*.* +include sage/misc/abstract_method.* +include sage/misc/cachefunc.* +include sage/misc/decorators.* +include sage/misc/c3_controlled.* +include sage/misc/lazy_attribute.* +include sage/misc/function_mangling.* +include sage/misc/lazy_string.* +include sage/misc/lazy_format.* +include sage/misc/unknown.* +include sage/misc/fast_methods.* +include sage/misc/constant_function.* +include sage/misc/call.* +include sage/misc/bindable_class.* + +include sage/misc/misc_c.* # prod + +include sage/misc/flatten.* # dep of sage/categories/coxeter_groups.py + +include sage/misc/lazy_import*.* +include sage/misc/sageinspect.* # dep of sage/misc/lazy_import +graft sage/docs # dep of sage/misc/lazy_import + +include sage/misc/persist.* +include sage/misc/misc.* # dep of sage/misc/persist +include sage/misc/sage_unittest.* # dep of sage/misc/persist + +include sage/ext/__init__.py +include sage/ext/stdsage.pxd +include sage/sets/__init__.py +include sage/sets/pythonclass.* +include sage/arith/__init__.py +include sage/arith/power.* +include sage/arith/numerical_approx.* +# integers... +include sage/arith/long.* +include sage/rings/__init__.py +include sage/rings/integer_fake.* +include sage/libs/__init__.py +graft sage/libs/gmp + + + +## What we do not want: +# sage/misc/latex -- this should really go to another package diff --git a/build/pkgs/sage_objects/src/README.md b/build/pkgs/sage_objects/src/README.md new file mode 100644 index 00000000000..66211e90866 --- /dev/null +++ b/build/pkgs/sage_objects/src/README.md @@ -0,0 +1,13 @@ +# sage-objects # + +This package provides a small, fundamental subset of the modules of sagelib, making Sage objects, the element/parent framework, categories, the coercion system and the related metaclasses available. + +## Documentation ## + +* [Categories](https://doc.sagemath.org/html/en/reference/categories/index.html) + +* [Structure](https://doc.sagemath.org/html/en/reference/structure/index.html) + +* [Coercion](https://doc.sagemath.org/html/en/reference/coercion/index.html) + +* [Classes, Metaclasses](https://doc.sagemath.org/html/en/reference/misc/index.html#special-base-classes-decorators-etc) diff --git a/build/pkgs/sage_objects/src/requirements.txt b/build/pkgs/sage_objects/src/requirements.txt new file mode 100644 index 00000000000..17cc7d8081d --- /dev/null +++ b/build/pkgs/sage_objects/src/requirements.txt @@ -0,0 +1,4 @@ +Cython==0.29.17 +pkgconfig # really needed? +cysignals +gmpy2==2.1.0b1 diff --git a/build/pkgs/sage_objects/src/sage b/build/pkgs/sage_objects/src/sage new file mode 120000 index 00000000000..c4f2d5df534 --- /dev/null +++ b/build/pkgs/sage_objects/src/sage @@ -0,0 +1 @@ +../../../../src/sage \ No newline at end of file diff --git a/build/pkgs/sage_objects/src/sage_setup b/build/pkgs/sage_objects/src/sage_setup new file mode 120000 index 00000000000..a2cca6f09f7 --- /dev/null +++ b/build/pkgs/sage_objects/src/sage_setup @@ -0,0 +1 @@ +../../../../src/sage_setup \ No newline at end of file diff --git a/build/pkgs/sage_objects/src/setup.cfg b/build/pkgs/sage_objects/src/setup.cfg new file mode 100644 index 00000000000..49cc887fe4e --- /dev/null +++ b/build/pkgs/sage_objects/src/setup.cfg @@ -0,0 +1,15 @@ +[metadata] +name = sage-objects +description = Sage: Open Source Mathematics Software: Sage objects, elements, parents, categories, coercion, metaclasses +long_description = file: README.md +license = GNU General Public License (GPL) v2 or later +author = The Sage Developers +author_email = https://groups.google.com/group/sage-support +url = https://www.sagemath.org + +[options] +install_requires = + Cython + pkgconfig + cysignals + gmpy2>=2.1.0b1 diff --git a/build/pkgs/sage_objects/src/setup.py b/build/pkgs/sage_objects/src/setup.py new file mode 100644 index 00000000000..43784b9b3a3 --- /dev/null +++ b/build/pkgs/sage_objects/src/setup.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python + +from distutils import log +from setuptools import setup + +from sage_setup.command.sage_build_cython import sage_build_cython +from sage_setup.command.sage_build_ext import sage_build_ext + +from sage_setup.find import find_python_sources +python_packages, python_modules, cython_modules = find_python_sources( + '.', ['sage']) # for now, we do the filtering using MANIFEST + +log.warn('python_packages = {0}'.format(python_packages)) +log.warn('python_modules = {0}'.format(python_modules)) +log.warn('cython_modules = {0}'.format(cython_modules)) + +from sage.env import SAGE_VERSION + +setup( + version = SAGE_VERSION, + cmdclass = dict(build_cython=sage_build_cython, + build_ext=sage_build_ext), + packages = python_packages, + py_modules = python_modules, + ext_modules = cython_modules +) diff --git a/build/pkgs/sage_objects/src/tox.ini b/build/pkgs/sage_objects/src/tox.ini new file mode 100644 index 00000000000..8bd3e423f83 --- /dev/null +++ b/build/pkgs/sage_objects/src/tox.ini @@ -0,0 +1,19 @@ +# First pip-install tox: +# +# ./sage -pip install tox +# +# To build and test in the tox environment: +# +# ./sage -sh -c '(cd build/pkgs/sage_objects/src && tox)' +# +# To test interactively: +# +# build/pkgs/sage_objects/src/.tox/python/bin/python +# +[tox] + +[testenv] +deps = -rrequirements.txt +commands = + # Beware of the treacherous non-src layout. "./sage/" shadows the install sage package. + python -c 'import sys; "" in sys.path and sys.path.remove(""); import sage.cpython.builtin_types, sage.cpython.cython_metaclass, sage.cpython.debug, sage.structure.all, sage.categories.all' diff --git a/build/pkgs/sage_objects/type b/build/pkgs/sage_objects/type new file mode 100644 index 00000000000..9839eb20815 --- /dev/null +++ b/build/pkgs/sage_objects/type @@ -0,0 +1 @@ +experimental From 83ed0ca1cb505061131df4cd6805ad2e1f1c95a0 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Mon, 15 Jun 2020 12:19:21 -0700 Subject: [PATCH 11/39] sage.structure.all: Import .formal_sum lazily to avoid pulling in sage.modules sage.categories.all: Resolve a circular import build/pkgs/sage_objects/src/tox.ini: Add test build/pkgs/sage_categories: New (lightly edited copy of sage_objects) build/pkgs/sage_objects: Only include the most basic categories build/pkgs/sage_objects: Install some scripts from bin build/pkgs/sage_objects: Add the doctester Break out *.all__sage_objects from sage.all, sage.misc.all, sage.categories.all build/pkgs/sage_objects/dependencies: Add ipython - for doctester --- build/pkgs/sage_categories/dependencies | 1 + .../pkgs/sage_categories/package-version.txt | 1 + build/pkgs/sage_categories/spkg-install | 1 + build/pkgs/sage_categories/spkg-src | 21 +++++++ build/pkgs/sage_categories/src/MANIFEST.in | 57 +++++++++++++++++++ build/pkgs/sage_categories/src/README.md | 15 +++++ .../pkgs/sage_categories/src/requirements.txt | 1 + build/pkgs/sage_categories/src/sage | 1 + build/pkgs/sage_categories/src/sage_setup | 1 + build/pkgs/sage_categories/src/setup.cfg | 15 +++++ build/pkgs/sage_categories/src/setup.py | 1 + build/pkgs/sage_categories/src/tox.ini | 22 +++++++ build/pkgs/sage_categories/type | 1 + build/pkgs/sage_objects/dependencies | 3 +- build/pkgs/sage_objects/src/MANIFEST.in | 47 +++++++++++++-- build/pkgs/sage_objects/src/bin | 1 + build/pkgs/sage_objects/src/setup.py | 8 ++- build/pkgs/sage_objects/src/tox.ini | 11 +++- src/sage/all__sage_objects.py | 5 ++ src/sage/categories/all.py | 19 +------ src/sage/categories/all__sage_objects.py | 31 ++++++++++ src/sage/misc/all.py | 26 +-------- src/sage/misc/all__sage_objects.py | 30 ++++++++++ src/sage/structure/all.py | 4 +- 24 files changed, 274 insertions(+), 49 deletions(-) create mode 120000 build/pkgs/sage_categories/dependencies create mode 120000 build/pkgs/sage_categories/package-version.txt create mode 120000 build/pkgs/sage_categories/spkg-install create mode 100755 build/pkgs/sage_categories/spkg-src create mode 100644 build/pkgs/sage_categories/src/MANIFEST.in create mode 100644 build/pkgs/sage_categories/src/README.md create mode 120000 build/pkgs/sage_categories/src/requirements.txt create mode 120000 build/pkgs/sage_categories/src/sage create mode 120000 build/pkgs/sage_categories/src/sage_setup create mode 100644 build/pkgs/sage_categories/src/setup.cfg create mode 120000 build/pkgs/sage_categories/src/setup.py create mode 100644 build/pkgs/sage_categories/src/tox.ini create mode 100644 build/pkgs/sage_categories/type create mode 120000 build/pkgs/sage_objects/src/bin create mode 100644 src/sage/all__sage_objects.py create mode 100644 src/sage/categories/all__sage_objects.py create mode 100644 src/sage/misc/all__sage_objects.py diff --git a/build/pkgs/sage_categories/dependencies b/build/pkgs/sage_categories/dependencies new file mode 120000 index 00000000000..f6c91d7b4c5 --- /dev/null +++ b/build/pkgs/sage_categories/dependencies @@ -0,0 +1 @@ +../sage_objects/dependencies \ No newline at end of file diff --git a/build/pkgs/sage_categories/package-version.txt b/build/pkgs/sage_categories/package-version.txt new file mode 120000 index 00000000000..cf10fe4b4e4 --- /dev/null +++ b/build/pkgs/sage_categories/package-version.txt @@ -0,0 +1 @@ +../sagelib/package-version.txt \ No newline at end of file diff --git a/build/pkgs/sage_categories/spkg-install b/build/pkgs/sage_categories/spkg-install new file mode 120000 index 00000000000..29170ce6e4b --- /dev/null +++ b/build/pkgs/sage_categories/spkg-install @@ -0,0 +1 @@ +../sage_objects/spkg-install \ No newline at end of file diff --git a/build/pkgs/sage_categories/spkg-src b/build/pkgs/sage_categories/spkg-src new file mode 100755 index 00000000000..94a345725d5 --- /dev/null +++ b/build/pkgs/sage_categories/spkg-src @@ -0,0 +1,21 @@ +#!/usr/bin/env bash +# +# Script to prepare an sdist tarball for sage_categories +# This script is not used during build. +# +# HOW TO MAKE THE TARBALL: +# ./sage --sh build/pkgs/sage_categories/spkg-src + +if [ -z "$SAGE_ROOT" ] ; then + echo >&2 "Error - SAGE_ROOT undefined ... exiting" + echo >&2 "Maybe run 'sage -sh'?" + exit 1 +fi + +# Exit on failure +set -e + +cd build/pkgs/sage_categories + +cd src +sage-python23 -u setup.py --no-user-cfg sdist --dist-dir "$SAGE_DISTFILES" diff --git a/build/pkgs/sage_categories/src/MANIFEST.in b/build/pkgs/sage_categories/src/MANIFEST.in new file mode 100644 index 00000000000..e39c8ba1765 --- /dev/null +++ b/build/pkgs/sage_categories/src/MANIFEST.in @@ -0,0 +1,57 @@ +prune sage +graft sage/cpython +include sage/__init__.py # FIXME: Needs to become a namespace package +include sage/env.py # FIXME: sage_setup must be changed so it does not depend on it +include sage/version.py # FIXME: likewise + +graft sage/structure +graft sage/categories +include sage/misc/__init__.py +include sage/misc/classcall_metaclass.* +include sage/misc/inherit_comparison*.* +include sage/misc/weak_dict.* +include sage/misc/nested_class*.* +include sage/misc/abstract_method.* +include sage/misc/cachefunc.* +include sage/misc/decorators.* +include sage/misc/c3_controlled.* +include sage/misc/lazy_attribute.* +include sage/misc/function_mangling.* +include sage/misc/lazy_string.* +include sage/misc/lazy_format.* +include sage/misc/unknown.* +include sage/misc/fast_methods.* +include sage/misc/constant_function.* +include sage/misc/call.* +include sage/misc/bindable_class.* + +include sage/misc/misc_c.* # prod + +include sage/misc/flatten.* # dep of sage/categories/coxeter_groups.py + +include sage/misc/lazy_import*.* +include sage/misc/sageinspect.* # dep of sage/misc/lazy_import +graft sage/docs # dep of sage/misc/lazy_import + +include sage/misc/persist.* +include sage/misc/misc.* # dep of sage/misc/persist +include sage/misc/sage_unittest.* # dep of sage/misc/persist + +include sage/ext/__init__.py +include sage/ext/stdsage.pxd +include sage/sets/__init__.py +include sage/sets/pythonclass.* +include sage/arith/__init__.py +include sage/arith/power.* +include sage/arith/numerical_approx.* +# integers... +include sage/arith/long.* +include sage/rings/__init__.py +include sage/rings/integer_fake.* +include sage/libs/__init__.py +graft sage/libs/gmp + + + +## What we do not want: +# sage/misc/latex -- this should really go to another package diff --git a/build/pkgs/sage_categories/src/README.md b/build/pkgs/sage_categories/src/README.md new file mode 100644 index 00000000000..f71edf120f0 --- /dev/null +++ b/build/pkgs/sage_categories/src/README.md @@ -0,0 +1,15 @@ +# sage-categories # + +This package, building upon `sage-objects`, provides a subset of the modules of sagelib that make +various categories available without introducing dependencies on additional mathematical libraries. + + +## Documentation ## + +* [Categories](https://doc.sagemath.org/html/en/reference/categories/index.html) + +* [Structure](https://doc.sagemath.org/html/en/reference/structure/index.html) + +* [Coercion](https://doc.sagemath.org/html/en/reference/coercion/index.html) + +* [Classes, Metaclasses](https://doc.sagemath.org/html/en/reference/misc/index.html#special-base-classes-decorators-etc) diff --git a/build/pkgs/sage_categories/src/requirements.txt b/build/pkgs/sage_categories/src/requirements.txt new file mode 120000 index 00000000000..309cb437f48 --- /dev/null +++ b/build/pkgs/sage_categories/src/requirements.txt @@ -0,0 +1 @@ +../../sage_objects/src/requirements.txt \ No newline at end of file diff --git a/build/pkgs/sage_categories/src/sage b/build/pkgs/sage_categories/src/sage new file mode 120000 index 00000000000..c4f2d5df534 --- /dev/null +++ b/build/pkgs/sage_categories/src/sage @@ -0,0 +1 @@ +../../../../src/sage \ No newline at end of file diff --git a/build/pkgs/sage_categories/src/sage_setup b/build/pkgs/sage_categories/src/sage_setup new file mode 120000 index 00000000000..a2cca6f09f7 --- /dev/null +++ b/build/pkgs/sage_categories/src/sage_setup @@ -0,0 +1 @@ +../../../../src/sage_setup \ No newline at end of file diff --git a/build/pkgs/sage_categories/src/setup.cfg b/build/pkgs/sage_categories/src/setup.cfg new file mode 100644 index 00000000000..49cc887fe4e --- /dev/null +++ b/build/pkgs/sage_categories/src/setup.cfg @@ -0,0 +1,15 @@ +[metadata] +name = sage-objects +description = Sage: Open Source Mathematics Software: Sage objects, elements, parents, categories, coercion, metaclasses +long_description = file: README.md +license = GNU General Public License (GPL) v2 or later +author = The Sage Developers +author_email = https://groups.google.com/group/sage-support +url = https://www.sagemath.org + +[options] +install_requires = + Cython + pkgconfig + cysignals + gmpy2>=2.1.0b1 diff --git a/build/pkgs/sage_categories/src/setup.py b/build/pkgs/sage_categories/src/setup.py new file mode 120000 index 00000000000..8559f35c6fe --- /dev/null +++ b/build/pkgs/sage_categories/src/setup.py @@ -0,0 +1 @@ +../../sage_objects/src/setup.py \ No newline at end of file diff --git a/build/pkgs/sage_categories/src/tox.ini b/build/pkgs/sage_categories/src/tox.ini new file mode 100644 index 00000000000..b19ae7acb5d --- /dev/null +++ b/build/pkgs/sage_categories/src/tox.ini @@ -0,0 +1,22 @@ +# First pip-install tox: +# +# ./sage -pip install tox +# +# To build and test in the tox environment: +# +# ./sage -sh -c '(cd build/pkgs/sage_objects/src && tox)' +# +# To test interactively: +# +# build/pkgs/sage_objects/src/.tox/python/bin/python +# +[tox] + +[testenv] +deps = -rrequirements.txt +commands = + # Beware of the treacherous non-src layout. "./sage/" shadows the install sage package. + python -c 'import sys; "" in sys.path and sys.path.remove(""); import sage.cpython.builtin_types, sage.cpython.cython_metaclass, sage.cpython.debug, sage.structure.all, sage.categories.all' + + # Test that importing sage.categories.all initializes categories + python -c 'import sys; "" in sys.path and sys.path.remove(""); from sage.categories.all import *; SimplicialComplexes(); FunctionFields()' diff --git a/build/pkgs/sage_categories/type b/build/pkgs/sage_categories/type new file mode 100644 index 00000000000..9839eb20815 --- /dev/null +++ b/build/pkgs/sage_categories/type @@ -0,0 +1 @@ +experimental diff --git a/build/pkgs/sage_objects/dependencies b/build/pkgs/sage_objects/dependencies index cd26ff79da6..fcacb179b57 100644 --- a/build/pkgs/sage_objects/dependencies +++ b/build/pkgs/sage_objects/dependencies @@ -1,3 +1,4 @@ -FORCE $(PYTHON) cysignals gmpy2 | $(PYTHON_TOOLCHAIN) cython pkgconfig $(and $(filter-out no,$(SAGE_CHECK)), tox) +FORCE $(PYTHON) cysignals gmpy2 ipython | $(PYTHON_TOOLCHAIN) cython pkgconfig $(and $(filter-out no,$(SAGE_CHECK)), tox) # FORCE: Always run the spkg-install script +# ipython - for the doctester diff --git a/build/pkgs/sage_objects/src/MANIFEST.in b/build/pkgs/sage_objects/src/MANIFEST.in index e39c8ba1765..409798109a0 100644 --- a/build/pkgs/sage_objects/src/MANIFEST.in +++ b/build/pkgs/sage_objects/src/MANIFEST.in @@ -4,9 +4,34 @@ include sage/__init__.py # FIXME: Needs to become a namespace package include sage/env.py # FIXME: sage_setup must be changed so it does not depend on it include sage/version.py # FIXME: likewise +global-include all__sage_objects.py + graft sage/structure -graft sage/categories -include sage/misc/__init__.py +include sage/categories/__init__.py # FIXME: Needs to become a namespace package +include sage/categories/action.* +include sage/categories/algebra_functor.* +include sage/categories/basic.* +include sage/categories/cartesian_product.* +include sage/categories/category*.* +include sage/categories/covariant_functorial_construction.* +include sage/categories/functor.* +include sage/categories/homset.* +include sage/categories/homsets.* +include sage/categories/map.* +include sage/categories/morphism.* +include sage/categories/isomorphic_objects.* +include sage/categories/objects.* +include sage/categories/primer.* +include sage/categories/pushout.* +include sage/categories/quotients.* +include sage/categories/realizations.* +include sage/categories/sets_cat.* +include sage/categories/sets_with_partial_maps.* +include sage/categories/subobjects.* +include sage/categories/subquotients.* +include sage/categories/with_realizations.* + +include sage/misc/__init__.py # FIXME: Needs to become a namespace package include sage/misc/classcall_metaclass.* include sage/misc/inherit_comparison*.* include sage/misc/weak_dict.* @@ -25,8 +50,9 @@ include sage/misc/constant_function.* include sage/misc/call.* include sage/misc/bindable_class.* +include sage/misc/verbose.* +include sage/misc/repr.* include sage/misc/misc_c.* # prod - include sage/misc/flatten.* # dep of sage/categories/coxeter_groups.py include sage/misc/lazy_import*.* @@ -34,7 +60,6 @@ include sage/misc/sageinspect.* # dep of sage/misc/lazy_import graft sage/docs # dep of sage/misc/lazy_import include sage/misc/persist.* -include sage/misc/misc.* # dep of sage/misc/persist include sage/misc/sage_unittest.* # dep of sage/misc/persist include sage/ext/__init__.py @@ -55,3 +80,17 @@ graft sage/libs/gmp ## What we do not want: # sage/misc/latex -- this should really go to another package + + +## For doctesting +include bin/sage +include bin/sage-env +include bin/sage-env-config +include bin/sage-python +include bin/sage-runtests +graft sage/doctest +include sage/misc/temporary_file.* +include sage/misc/randstate.* + +graft sage/repl +graft sage/server diff --git a/build/pkgs/sage_objects/src/bin b/build/pkgs/sage_objects/src/bin new file mode 120000 index 00000000000..459186de7e0 --- /dev/null +++ b/build/pkgs/sage_objects/src/bin @@ -0,0 +1 @@ +../../../../src/bin \ No newline at end of file diff --git a/build/pkgs/sage_objects/src/setup.py b/build/pkgs/sage_objects/src/setup.py index 43784b9b3a3..a85190c180d 100644 --- a/build/pkgs/sage_objects/src/setup.py +++ b/build/pkgs/sage_objects/src/setup.py @@ -22,5 +22,11 @@ build_ext=sage_build_ext), packages = python_packages, py_modules = python_modules, - ext_modules = cython_modules + ext_modules = cython_modules, + scripts = [## The sage script + 'bin/sage', + 'bin/sage-env', + 'bin/sage-env-config', + 'bin/sage-runtests', + ], ) diff --git a/build/pkgs/sage_objects/src/tox.ini b/build/pkgs/sage_objects/src/tox.ini index 8bd3e423f83..e064df2027c 100644 --- a/build/pkgs/sage_objects/src/tox.ini +++ b/build/pkgs/sage_objects/src/tox.ini @@ -14,6 +14,15 @@ [testenv] deps = -rrequirements.txt + +setenv = + # Sage scripts such as sage-runtests like to use $HOME/.sage + HOME={envdir} + commands = # Beware of the treacherous non-src layout. "./sage/" shadows the install sage package. - python -c 'import sys; "" in sys.path and sys.path.remove(""); import sage.cpython.builtin_types, sage.cpython.cython_metaclass, sage.cpython.debug, sage.structure.all, sage.categories.all' + python -c 'import sys; "" in sys.path and sys.path.remove(""); import sage.structure.all, sage.categories.sets_cat' + + python -c 'import sys; "" in sys.path and sys.path.remove(""); from sage.all__sage_objects import *' + + sage-runtests --all diff --git a/src/sage/all__sage_objects.py b/src/sage/all__sage_objects.py new file mode 100644 index 00000000000..cba0dfe5677 --- /dev/null +++ b/src/sage/all__sage_objects.py @@ -0,0 +1,5 @@ +# TODO: More to be moved from all.py + +from sage.misc.all__sage_objects import * +from sage.structure.all import * +from sage.categories.all__sage_objects import * diff --git a/src/sage/categories/all.py b/src/sage/categories/all.py index 053fd577d24..ba59e5d9431 100644 --- a/src/sage/categories/all.py +++ b/src/sage/categories/all.py @@ -1,8 +1,8 @@ from sage.misc.lazy_import import lazy_import -from .category import Category +from .all__sage_objects import * -from .category_types import Elements +from .basic import * from .chain_complexes import ChainComplexes, HomologyFunctor @@ -10,25 +10,10 @@ from .tensor import tensor from .signed_tensor import tensor_signed -from .cartesian_product import cartesian_product - -from .functor import (ForgetfulFunctor, - IdentityFunctor) - -from .homset import (Hom, hom, - End, end, - Homset, HomsetWithBase) - -from .morphism import Morphism - -from .basic import * - -from .realizations import Realizations from .g_sets import GSets from .pointed_sets import PointedSets -from .sets_with_partial_maps import SetsWithPartialMaps from .sets_with_grading import SetsWithGrading from .groupoid import Groupoid diff --git a/src/sage/categories/all__sage_objects.py b/src/sage/categories/all__sage_objects.py new file mode 100644 index 00000000000..dee0881d787 --- /dev/null +++ b/src/sage/categories/all__sage_objects.py @@ -0,0 +1,31 @@ +# Subset of sage.categories.all that is made available by the sage-objects distribution + +from sage.misc.lazy_import import lazy_import + +# Resolve a circular import so that "import sage.categories.all" can succeed +# in initializing the category system. +import sage.structure.category_object # imports sage.categories.category + +# Small part of "from .basic import *": +from .objects import Objects +from .sets_cat import Sets, EmptySetError + + +from .category import Category + +from .category_types import Elements + +from .cartesian_product import cartesian_product + +from .functor import (ForgetfulFunctor, + IdentityFunctor) + +from .homset import (Hom, hom, + End, end, + Homset, HomsetWithBase) + +from .morphism import Morphism + +from .realizations import Realizations + +from .sets_with_partial_maps import SetsWithPartialMaps diff --git a/src/sage/misc/all.py b/src/sage/misc/all.py index d108d4e5f74..9cf8bf1251a 100644 --- a/src/sage/misc/all.py +++ b/src/sage/misc/all.py @@ -1,6 +1,8 @@ from .lazy_attribute import lazy_attribute, lazy_class_attribute from .lazy_import import lazy_import +from .all__sage_objects import * + from .misc import (BackslashOperator, cputime, union, uniq, powerset, subsets, @@ -11,34 +13,20 @@ newton_method_sizes, compose, nest) -from .verbose import (set_verbose, set_verbose_files, - get_verbose_files, unset_verbose_files, get_verbose) -lazy_import('sage.misc.verbose', 'verbose', - deprecation=17815) -from .call import attrcall - from .banner import version, banner from .temporary_file import tmp_dir, tmp_filename -from .misc_c import prod, running_total, balanced_sum -mul = prod -add = sum - from .dev_tools import runsnake, import_statements from .html import html, pretty_print_default -from .repr import repr_lincomb - from .table import table from .sage_timeit_class import timeit from .edit_module import edit, set_edit_template -from .flatten import flatten - from .map_threaded import map_threaded from .session import load_session, save_session, show_identifiers @@ -83,8 +71,6 @@ lazy_import("sage.misc.cython", "cython_lambda") lazy_import("sage.misc.cython", "cython_compile", "cython") -from .persist import save, load, dumps, loads, db, db_save - from .func_persist import func_persist from .functional import (additive_order, @@ -149,8 +135,6 @@ from .trace import trace -from .constant_function import ConstantFunction - from .cachefunc import CachedFunction, cached_function, cached_method, cached_in_parent_method, disk_cached_function from .abstract_method import abstract_method @@ -159,14 +143,8 @@ from .prandom import * -from .sage_unittest import TestSuite - from .explain_pickle import explain_pickle, unpickle_newobj, unpickle_global, unpickle_build, unpickle_instantiate, unpickle_persistent, unpickle_extension, unpickle_appends -from .decorators import specialize, sage_wraps, infix_operator - -from .unknown import Unknown, UnknownError - lazy_import('sage.misc.inline_fortran', 'fortran') diff --git a/src/sage/misc/all__sage_objects.py b/src/sage/misc/all__sage_objects.py new file mode 100644 index 00000000000..993e17656fe --- /dev/null +++ b/src/sage/misc/all__sage_objects.py @@ -0,0 +1,30 @@ +# Subset of sage.misc.all that is made available by the sage-objects distribution + +import sage.structure.all # to break a cyclic import + +from .lazy_attribute import lazy_attribute, lazy_class_attribute +from .lazy_import import lazy_import + +from .verbose import (set_verbose, set_verbose_files, + get_verbose_files, unset_verbose_files, get_verbose) +lazy_import('sage.misc.verbose', 'verbose', + deprecation=17815) +from .call import attrcall + +from .misc_c import prod, running_total, balanced_sum +mul = prod +add = sum + +from .repr import repr_lincomb + +from .flatten import flatten + +from .persist import save, load, dumps, loads, db, db_save + +from .constant_function import ConstantFunction + +from .sage_unittest import TestSuite + +from .decorators import specialize, sage_wraps, infix_operator + +from .unknown import Unknown, UnknownError diff --git a/src/sage/structure/all.py b/src/sage/structure/all.py index 459ece332a3..5360f3e1d74 100644 --- a/src/sage/structure/all.py +++ b/src/sage/structure/all.py @@ -23,7 +23,9 @@ from .proof import all as proof -from .formal_sum import FormalSums, FormalSum +from sage.misc.lazy_import import lazy_import +lazy_import('sage.structure.formal_sum', ['FormalSums', 'FormalSum']) +del lazy_import from .mutability import Mutability From d876c55fbac6697aeacff876d636cfa4c0c38f65 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Mon, 22 Jun 2020 16:13:05 -0700 Subject: [PATCH 12/39] src/sage: Move more to all__sage_objects.py --- src/sage/all__sage_objects.py | 4 ++++ src/sage/misc/all.py | 4 ---- src/sage/misc/all__sage_objects.py | 4 ++++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/sage/all__sage_objects.py b/src/sage/all__sage_objects.py index cba0dfe5677..1c9770a1031 100644 --- a/src/sage/all__sage_objects.py +++ b/src/sage/all__sage_objects.py @@ -1,5 +1,9 @@ # TODO: More to be moved from all.py +# This import also sets up the interrupt handler +from cysignals.signals import (AlarmInterrupt, SignalError, + sig_on_reset as sig_on_count) + from sage.misc.all__sage_objects import * from sage.structure.all import * from sage.categories.all__sage_objects import * diff --git a/src/sage/misc/all.py b/src/sage/misc/all.py index 9cf8bf1251a..292873af780 100644 --- a/src/sage/misc/all.py +++ b/src/sage/misc/all.py @@ -135,10 +135,6 @@ from .trace import trace -from .cachefunc import CachedFunction, cached_function, cached_method, cached_in_parent_method, disk_cached_function - -from .abstract_method import abstract_method - from .randstate import seed, set_random_seed, initial_seed, current_randstate from .prandom import * diff --git a/src/sage/misc/all__sage_objects.py b/src/sage/misc/all__sage_objects.py index 993e17656fe..3090b5a8913 100644 --- a/src/sage/misc/all__sage_objects.py +++ b/src/sage/misc/all__sage_objects.py @@ -28,3 +28,7 @@ from .decorators import specialize, sage_wraps, infix_operator from .unknown import Unknown, UnknownError + +from .cachefunc import CachedFunction, cached_function, cached_method, cached_in_parent_method, disk_cached_function + +from .abstract_method import abstract_method From 6ebf4f398f9afa1132997c5414805b6d26bcd21b Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Mon, 22 Jun 2020 16:13:40 -0700 Subject: [PATCH 13/39] build/pkgs/sage_objects: Make doctesting work Add from sage_objects MANIFEST.in Update from sage_objects tox.ini build/pkgs/sage_categories/src/setup.cfg: Fix up build/pkgs/sage_categories/src/MANIFEST.in: Add a bit from sage.rings build/pkgs/sage_categories/src/bin: New symlink build/pkgs/sage_categories/src/MANIFEST.in: More tweaks --- build/pkgs/sage_categories/src/MANIFEST.in | 29 ++++++++++++++++++-- build/pkgs/sage_categories/src/bin | 1 + build/pkgs/sage_categories/src/setup.cfg | 4 +-- build/pkgs/sage_categories/src/tox.ini | 15 ++++++++-- build/pkgs/sage_objects/src/MANIFEST.in | 3 ++ build/pkgs/sage_objects/src/requirements.txt | 1 + build/pkgs/sage_objects/src/tox.ini | 5 +++- 7 files changed, 51 insertions(+), 7 deletions(-) create mode 120000 build/pkgs/sage_categories/src/bin diff --git a/build/pkgs/sage_categories/src/MANIFEST.in b/build/pkgs/sage_categories/src/MANIFEST.in index e39c8ba1765..2b6b85f7a05 100644 --- a/build/pkgs/sage_categories/src/MANIFEST.in +++ b/build/pkgs/sage_categories/src/MANIFEST.in @@ -4,6 +4,8 @@ include sage/__init__.py # FIXME: Needs to become a namespace package include sage/env.py # FIXME: sage_setup must be changed so it does not depend on it include sage/version.py # FIXME: likewise +global-include all__sage_objects.py + graft sage/structure graft sage/categories include sage/misc/__init__.py @@ -25,8 +27,9 @@ include sage/misc/constant_function.* include sage/misc/call.* include sage/misc/bindable_class.* +include sage/misc/verbose.* +include sage/misc/repr.* include sage/misc/misc_c.* # prod - include sage/misc/flatten.* # dep of sage/categories/coxeter_groups.py include sage/misc/lazy_import*.* @@ -34,7 +37,6 @@ include sage/misc/sageinspect.* # dep of sage/misc/lazy_import graft sage/docs # dep of sage/misc/lazy_import include sage/misc/persist.* -include sage/misc/misc.* # dep of sage/misc/persist include sage/misc/sage_unittest.* # dep of sage/misc/persist include sage/ext/__init__.py @@ -51,7 +53,30 @@ include sage/rings/integer_fake.* include sage/libs/__init__.py graft sage/libs/gmp +# Extra in sage_categories: +include sage/rings/ideal.* +include sage/rings/ring.* +# include sage/rings/integer*.* # depends on cypari, flint +# include sage/rings/rational*.* +# include sage/rings/infinity.* ## What we do not want: # sage/misc/latex -- this should really go to another package + + +## For doctesting +include bin/sage +include bin/sage-env +include bin/sage-env-config +include bin/sage-python +include bin/sage-runtests +graft sage/doctest +include sage/misc/temporary_file.* +include sage/misc/randstate.* +include sage/misc/misc.* # walltime, cputime +# graft sage/features +include sage/misc/package.* + +graft sage/repl +graft sage/server diff --git a/build/pkgs/sage_categories/src/bin b/build/pkgs/sage_categories/src/bin new file mode 120000 index 00000000000..459186de7e0 --- /dev/null +++ b/build/pkgs/sage_categories/src/bin @@ -0,0 +1 @@ +../../../../src/bin \ No newline at end of file diff --git a/build/pkgs/sage_categories/src/setup.cfg b/build/pkgs/sage_categories/src/setup.cfg index 49cc887fe4e..1e89af2c930 100644 --- a/build/pkgs/sage_categories/src/setup.cfg +++ b/build/pkgs/sage_categories/src/setup.cfg @@ -1,6 +1,6 @@ [metadata] -name = sage-objects -description = Sage: Open Source Mathematics Software: Sage objects, elements, parents, categories, coercion, metaclasses +name = sage-categories +description = Sage: Open Source Mathematics Software: Sage categories and basic rings long_description = file: README.md license = GNU General Public License (GPL) v2 or later author = The Sage Developers diff --git a/build/pkgs/sage_categories/src/tox.ini b/build/pkgs/sage_categories/src/tox.ini index b19ae7acb5d..d7f063cffb8 100644 --- a/build/pkgs/sage_categories/src/tox.ini +++ b/build/pkgs/sage_categories/src/tox.ini @@ -4,19 +4,30 @@ # # To build and test in the tox environment: # -# ./sage -sh -c '(cd build/pkgs/sage_objects/src && tox)' +# ./sage -sh -c '(cd build/pkgs/sage_categories/src && tox)' # # To test interactively: # -# build/pkgs/sage_objects/src/.tox/python/bin/python +# build/pkgs/sage_categories/src/.tox/python/bin/python # [tox] [testenv] deps = -rrequirements.txt + +setenv = + # Sage scripts such as sage-runtests like to use $HOME/.sage + HOME={envdir} + +whitelist_externals = + bash + + commands = # Beware of the treacherous non-src layout. "./sage/" shadows the install sage package. python -c 'import sys; "" in sys.path and sys.path.remove(""); import sage.cpython.builtin_types, sage.cpython.cython_metaclass, sage.cpython.debug, sage.structure.all, sage.categories.all' # Test that importing sage.categories.all initializes categories python -c 'import sys; "" in sys.path and sys.path.remove(""); from sage.categories.all import *; SimplicialComplexes(); FunctionFields()' + + bash -c 'cd bin && SAGE_SRC=$(python -c "from sage.env import SAGE_SRC; print(SAGE_SRC)") && sage-runtests --environment=sage.all__sage_objects --optional=sage $SAGE_SRC/sage/structure' diff --git a/build/pkgs/sage_objects/src/MANIFEST.in b/build/pkgs/sage_objects/src/MANIFEST.in index 409798109a0..0d8a79a3b39 100644 --- a/build/pkgs/sage_objects/src/MANIFEST.in +++ b/build/pkgs/sage_objects/src/MANIFEST.in @@ -91,6 +91,9 @@ include bin/sage-runtests graft sage/doctest include sage/misc/temporary_file.* include sage/misc/randstate.* +include sage/misc/misc.* # walltime, cputime +# graft sage/features +include sage/misc/package.* graft sage/repl graft sage/server diff --git a/build/pkgs/sage_objects/src/requirements.txt b/build/pkgs/sage_objects/src/requirements.txt index 17cc7d8081d..f3f832a6a81 100644 --- a/build/pkgs/sage_objects/src/requirements.txt +++ b/build/pkgs/sage_objects/src/requirements.txt @@ -2,3 +2,4 @@ Cython==0.29.17 pkgconfig # really needed? cysignals gmpy2==2.1.0b1 +ipython<6 diff --git a/build/pkgs/sage_objects/src/tox.ini b/build/pkgs/sage_objects/src/tox.ini index e064df2027c..ee2b8484fee 100644 --- a/build/pkgs/sage_objects/src/tox.ini +++ b/build/pkgs/sage_objects/src/tox.ini @@ -19,10 +19,13 @@ setenv = # Sage scripts such as sage-runtests like to use $HOME/.sage HOME={envdir} +whitelist_externals = + bash + commands = # Beware of the treacherous non-src layout. "./sage/" shadows the install sage package. python -c 'import sys; "" in sys.path and sys.path.remove(""); import sage.structure.all, sage.categories.sets_cat' python -c 'import sys; "" in sys.path and sys.path.remove(""); from sage.all__sage_objects import *' - sage-runtests --all + bash -c 'cd bin && SAGE_SRC=$(python -c "from sage.env import SAGE_SRC; print(SAGE_SRC)") && sage-runtests --environment=sage.all__sage_objects --optional=sage $SAGE_SRC/sage/structure' From 7e1d73116ccd94cd1cabbc3df861034a65c74e23 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Mon, 29 Jun 2020 11:51:57 -0700 Subject: [PATCH 14/39] Set up all__sage_categories.py --- build/pkgs/sage_categories/src/MANIFEST.in | 5 ++++- build/pkgs/sage_categories/src/tox.ini | 2 +- src/sage/all__sage_categories.py | 5 +++++ src/sage/rings/all.py | 2 ++ src/sage/rings/all__sage_categories.py | 6 ++++++ src/sage/rings/ideal.py | 4 ++-- 6 files changed, 20 insertions(+), 4 deletions(-) create mode 100644 src/sage/all__sage_categories.py create mode 100644 src/sage/rings/all__sage_categories.py diff --git a/build/pkgs/sage_categories/src/MANIFEST.in b/build/pkgs/sage_categories/src/MANIFEST.in index 2b6b85f7a05..d28ba5ae55f 100644 --- a/build/pkgs/sage_categories/src/MANIFEST.in +++ b/build/pkgs/sage_categories/src/MANIFEST.in @@ -5,6 +5,7 @@ include sage/env.py # FIXME: sage_setup must be changed so it does not de include sage/version.py # FIXME: likewise global-include all__sage_objects.py +global-include all__sage_categories.py graft sage/structure graft sage/categories @@ -39,6 +40,8 @@ graft sage/docs # dep of sage/misc/lazy_import include sage/misc/persist.* include sage/misc/sage_unittest.* # dep of sage/misc/persist +include sage/misc/prandom.* # dep of sage/rings/ring + include sage/ext/__init__.py include sage/ext/stdsage.pxd include sage/sets/__init__.py @@ -56,7 +59,7 @@ graft sage/libs/gmp # Extra in sage_categories: include sage/rings/ideal.* include sage/rings/ring.* -# include sage/rings/integer*.* # depends on cypari, flint +# include sage/rings/integer*.* # depends on cypari, flint - https://trac.sagemath.org/ticket/30022 # include sage/rings/rational*.* # include sage/rings/infinity.* diff --git a/build/pkgs/sage_categories/src/tox.ini b/build/pkgs/sage_categories/src/tox.ini index d7f063cffb8..cf2411bbf31 100644 --- a/build/pkgs/sage_categories/src/tox.ini +++ b/build/pkgs/sage_categories/src/tox.ini @@ -30,4 +30,4 @@ commands = # Test that importing sage.categories.all initializes categories python -c 'import sys; "" in sys.path and sys.path.remove(""); from sage.categories.all import *; SimplicialComplexes(); FunctionFields()' - bash -c 'cd bin && SAGE_SRC=$(python -c "from sage.env import SAGE_SRC; print(SAGE_SRC)") && sage-runtests --environment=sage.all__sage_objects --optional=sage $SAGE_SRC/sage/structure' + bash -c 'cd bin && SAGE_SRC=$(python -c "from sage.env import SAGE_SRC; print(SAGE_SRC)") && sage-runtests --environment=sage.all__sage_categories --optional=sage $SAGE_SRC/sage/structure' diff --git a/src/sage/all__sage_categories.py b/src/sage/all__sage_categories.py new file mode 100644 index 00000000000..9aba871b139 --- /dev/null +++ b/src/sage/all__sage_categories.py @@ -0,0 +1,5 @@ +from .all__sage_objects import * + +from sage.categories.all import * + +from sage.rings.all__sage_categories import * diff --git a/src/sage/rings/all.py b/src/sage/rings/all.py index 50f0a4e190c..db82d2bee81 100644 --- a/src/sage/rings/all.py +++ b/src/sage/rings/all.py @@ -12,6 +12,8 @@ # **************************************************************************** from sage.misc.lazy_import import lazy_import +from .all__sage_categories import * + # Ring base classes from .ring import (Ring, Field, CommutativeRing, IntegralDomain, DedekindDomain, PrincipalIdealDomain, EuclideanDomain) diff --git a/src/sage/rings/all__sage_categories.py b/src/sage/rings/all__sage_categories.py new file mode 100644 index 00000000000..8d14e7afcda --- /dev/null +++ b/src/sage/rings/all__sage_categories.py @@ -0,0 +1,6 @@ +# Ring base classes +from .ring import Ring + +# Ideals +from .ideal import Ideal +ideal = Ideal diff --git a/src/sage/rings/ideal.py b/src/sage/rings/ideal.py index 53076ac62ed..eb8594b6f77 100644 --- a/src/sage/rings/ideal.py +++ b/src/sage/rings/ideal.py @@ -28,11 +28,9 @@ from types import GeneratorType -import sage.misc.latex as latex import sage.rings.ring from sage.structure.element import MonoidElement from sage.structure.richcmp import rich_to_bool, richcmp -import sage.rings.infinity from sage.structure.sequence import Sequence def Ideal(*args, **kwds): @@ -536,6 +534,7 @@ def _latex_(self): sage: latex(3*ZZ) # indirect doctest \left(3\right)\Bold{Z} """ + import sage.misc.latex as latex return '\\left(%s\\right)%s' % (", ".join(latex.latex(g) for g in self.gens()), latex.latex(self.ring())) @@ -1803,6 +1802,7 @@ def FieldIdeal(R): q = R.base_ring().order() + import sage.rings.infinity if q is sage.rings.infinity.infinity: raise TypeError("Cannot construct field ideal for R.base_ring().order()==infinity") From b7b8cf300d2357d61b4d795e75823d215a8d9f1c Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 25 Jul 2020 22:48:42 -0700 Subject: [PATCH 15/39] build/pkgs/sage_{categories,objects}/src/MANIFEST.in: Add sage/misc/superseded build/pkgs/sage_objects/src/requirements.txt: Update build/pkgs/{sage_objects,sage_categories}/src/MANIFEST.in: Update for 9.2 build/pkgs/sage_objects/src/setup.py: Add macOS multiprocessing fix from src/setup.py Rename sage_objects, sage_categories to sagemath_objects, sagemath_categories, update metadata build/pkgs/sagemath_{objects,categories}/src/MANIFEST.in: Prune/exclude more build/pkgs/sagemath_{objects,categories}: Update README --- build/pkgs/sage_categories/dependencies | 1 - build/pkgs/sage_categories/spkg-install | 1 - build/pkgs/sage_categories/src/README.md | 15 -------- .../pkgs/sage_categories/src/requirements.txt | 1 - build/pkgs/sage_categories/src/setup.cfg | 15 -------- build/pkgs/sage_categories/src/setup.py | 1 - build/pkgs/sage_objects/src/README.md | 13 ------- build/pkgs/sage_objects/src/requirements.txt | 5 --- build/pkgs/sage_objects/src/setup.cfg | 15 -------- build/pkgs/sagemath_categories/dependencies | 1 + .../package-version.txt | 0 build/pkgs/sagemath_categories/spkg-install | 1 + .../spkg-src | 6 ++-- .../src/MANIFEST.in | 7 ++++ build/pkgs/sagemath_categories/src/README.rst | 35 +++++++++++++++++++ .../src/bin | 0 .../sagemath_categories/src/requirements.txt | 1 + .../src/sage | 0 .../src/sage_setup | 0 build/pkgs/sagemath_categories/src/setup.cfg | 31 ++++++++++++++++ build/pkgs/sagemath_categories/src/setup.py | 1 + .../src/tox.ini | 4 +-- .../type | 0 .../dependencies | 0 .../package-version.txt | 0 .../spkg-install | 0 .../spkg-src | 6 ++-- .../src/MANIFEST.in | 7 ++++ build/pkgs/sagemath_objects/src/README.rst | 35 +++++++++++++++++++ .../src/bin | 0 .../sagemath_objects/src/requirements.txt | 5 +++ .../src/sage | 0 .../src/sage_setup | 0 build/pkgs/sagemath_objects/src/setup.cfg | 31 ++++++++++++++++ .../src/setup.py | 7 ++++ .../src/tox.ini | 6 ++-- .../{sage_objects => sagemath_objects}/type | 0 37 files changed, 173 insertions(+), 78 deletions(-) delete mode 120000 build/pkgs/sage_categories/dependencies delete mode 120000 build/pkgs/sage_categories/spkg-install delete mode 100644 build/pkgs/sage_categories/src/README.md delete mode 120000 build/pkgs/sage_categories/src/requirements.txt delete mode 100644 build/pkgs/sage_categories/src/setup.cfg delete mode 120000 build/pkgs/sage_categories/src/setup.py delete mode 100644 build/pkgs/sage_objects/src/README.md delete mode 100644 build/pkgs/sage_objects/src/requirements.txt delete mode 100644 build/pkgs/sage_objects/src/setup.cfg create mode 120000 build/pkgs/sagemath_categories/dependencies rename build/pkgs/{sage_categories => sagemath_categories}/package-version.txt (100%) create mode 120000 build/pkgs/sagemath_categories/spkg-install rename build/pkgs/{sage_objects => sagemath_categories}/spkg-src (69%) rename build/pkgs/{sage_categories => sagemath_categories}/src/MANIFEST.in (95%) create mode 100644 build/pkgs/sagemath_categories/src/README.rst rename build/pkgs/{sage_categories => sagemath_categories}/src/bin (100%) create mode 120000 build/pkgs/sagemath_categories/src/requirements.txt rename build/pkgs/{sage_categories => sagemath_categories}/src/sage (100%) rename build/pkgs/{sage_categories => sagemath_categories}/src/sage_setup (100%) create mode 100644 build/pkgs/sagemath_categories/src/setup.cfg create mode 120000 build/pkgs/sagemath_categories/src/setup.py rename build/pkgs/{sage_categories => sagemath_categories}/src/tox.ini (88%) rename build/pkgs/{sage_categories => sagemath_categories}/type (100%) rename build/pkgs/{sage_objects => sagemath_objects}/dependencies (100%) rename build/pkgs/{sage_objects => sagemath_objects}/package-version.txt (100%) rename build/pkgs/{sage_objects => sagemath_objects}/spkg-install (100%) rename build/pkgs/{sage_categories => sagemath_objects}/spkg-src (70%) rename build/pkgs/{sage_objects => sagemath_objects}/src/MANIFEST.in (96%) create mode 100644 build/pkgs/sagemath_objects/src/README.rst rename build/pkgs/{sage_objects => sagemath_objects}/src/bin (100%) create mode 100644 build/pkgs/sagemath_objects/src/requirements.txt rename build/pkgs/{sage_objects => sagemath_objects}/src/sage (100%) rename build/pkgs/{sage_objects => sagemath_objects}/src/sage_setup (100%) create mode 100644 build/pkgs/sagemath_objects/src/setup.cfg rename build/pkgs/{sage_objects => sagemath_objects}/src/setup.py (81%) rename build/pkgs/{sage_objects => sagemath_objects}/src/tox.ini (83%) rename build/pkgs/{sage_objects => sagemath_objects}/type (100%) diff --git a/build/pkgs/sage_categories/dependencies b/build/pkgs/sage_categories/dependencies deleted file mode 120000 index f6c91d7b4c5..00000000000 --- a/build/pkgs/sage_categories/dependencies +++ /dev/null @@ -1 +0,0 @@ -../sage_objects/dependencies \ No newline at end of file diff --git a/build/pkgs/sage_categories/spkg-install b/build/pkgs/sage_categories/spkg-install deleted file mode 120000 index 29170ce6e4b..00000000000 --- a/build/pkgs/sage_categories/spkg-install +++ /dev/null @@ -1 +0,0 @@ -../sage_objects/spkg-install \ No newline at end of file diff --git a/build/pkgs/sage_categories/src/README.md b/build/pkgs/sage_categories/src/README.md deleted file mode 100644 index f71edf120f0..00000000000 --- a/build/pkgs/sage_categories/src/README.md +++ /dev/null @@ -1,15 +0,0 @@ -# sage-categories # - -This package, building upon `sage-objects`, provides a subset of the modules of sagelib that make -various categories available without introducing dependencies on additional mathematical libraries. - - -## Documentation ## - -* [Categories](https://doc.sagemath.org/html/en/reference/categories/index.html) - -* [Structure](https://doc.sagemath.org/html/en/reference/structure/index.html) - -* [Coercion](https://doc.sagemath.org/html/en/reference/coercion/index.html) - -* [Classes, Metaclasses](https://doc.sagemath.org/html/en/reference/misc/index.html#special-base-classes-decorators-etc) diff --git a/build/pkgs/sage_categories/src/requirements.txt b/build/pkgs/sage_categories/src/requirements.txt deleted file mode 120000 index 309cb437f48..00000000000 --- a/build/pkgs/sage_categories/src/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -../../sage_objects/src/requirements.txt \ No newline at end of file diff --git a/build/pkgs/sage_categories/src/setup.cfg b/build/pkgs/sage_categories/src/setup.cfg deleted file mode 100644 index 1e89af2c930..00000000000 --- a/build/pkgs/sage_categories/src/setup.cfg +++ /dev/null @@ -1,15 +0,0 @@ -[metadata] -name = sage-categories -description = Sage: Open Source Mathematics Software: Sage categories and basic rings -long_description = file: README.md -license = GNU General Public License (GPL) v2 or later -author = The Sage Developers -author_email = https://groups.google.com/group/sage-support -url = https://www.sagemath.org - -[options] -install_requires = - Cython - pkgconfig - cysignals - gmpy2>=2.1.0b1 diff --git a/build/pkgs/sage_categories/src/setup.py b/build/pkgs/sage_categories/src/setup.py deleted file mode 120000 index 8559f35c6fe..00000000000 --- a/build/pkgs/sage_categories/src/setup.py +++ /dev/null @@ -1 +0,0 @@ -../../sage_objects/src/setup.py \ No newline at end of file diff --git a/build/pkgs/sage_objects/src/README.md b/build/pkgs/sage_objects/src/README.md deleted file mode 100644 index 66211e90866..00000000000 --- a/build/pkgs/sage_objects/src/README.md +++ /dev/null @@ -1,13 +0,0 @@ -# sage-objects # - -This package provides a small, fundamental subset of the modules of sagelib, making Sage objects, the element/parent framework, categories, the coercion system and the related metaclasses available. - -## Documentation ## - -* [Categories](https://doc.sagemath.org/html/en/reference/categories/index.html) - -* [Structure](https://doc.sagemath.org/html/en/reference/structure/index.html) - -* [Coercion](https://doc.sagemath.org/html/en/reference/coercion/index.html) - -* [Classes, Metaclasses](https://doc.sagemath.org/html/en/reference/misc/index.html#special-base-classes-decorators-etc) diff --git a/build/pkgs/sage_objects/src/requirements.txt b/build/pkgs/sage_objects/src/requirements.txt deleted file mode 100644 index f3f832a6a81..00000000000 --- a/build/pkgs/sage_objects/src/requirements.txt +++ /dev/null @@ -1,5 +0,0 @@ -Cython==0.29.17 -pkgconfig # really needed? -cysignals -gmpy2==2.1.0b1 -ipython<6 diff --git a/build/pkgs/sage_objects/src/setup.cfg b/build/pkgs/sage_objects/src/setup.cfg deleted file mode 100644 index 49cc887fe4e..00000000000 --- a/build/pkgs/sage_objects/src/setup.cfg +++ /dev/null @@ -1,15 +0,0 @@ -[metadata] -name = sage-objects -description = Sage: Open Source Mathematics Software: Sage objects, elements, parents, categories, coercion, metaclasses -long_description = file: README.md -license = GNU General Public License (GPL) v2 or later -author = The Sage Developers -author_email = https://groups.google.com/group/sage-support -url = https://www.sagemath.org - -[options] -install_requires = - Cython - pkgconfig - cysignals - gmpy2>=2.1.0b1 diff --git a/build/pkgs/sagemath_categories/dependencies b/build/pkgs/sagemath_categories/dependencies new file mode 120000 index 00000000000..55c209e6418 --- /dev/null +++ b/build/pkgs/sagemath_categories/dependencies @@ -0,0 +1 @@ +../sagemath_objects/dependencies \ No newline at end of file diff --git a/build/pkgs/sage_categories/package-version.txt b/build/pkgs/sagemath_categories/package-version.txt similarity index 100% rename from build/pkgs/sage_categories/package-version.txt rename to build/pkgs/sagemath_categories/package-version.txt diff --git a/build/pkgs/sagemath_categories/spkg-install b/build/pkgs/sagemath_categories/spkg-install new file mode 120000 index 00000000000..e60fac9ffa1 --- /dev/null +++ b/build/pkgs/sagemath_categories/spkg-install @@ -0,0 +1 @@ +../sagemath_objects/spkg-install \ No newline at end of file diff --git a/build/pkgs/sage_objects/spkg-src b/build/pkgs/sagemath_categories/spkg-src similarity index 69% rename from build/pkgs/sage_objects/spkg-src rename to build/pkgs/sagemath_categories/spkg-src index ea8aa3fcad7..a63b6f92a43 100755 --- a/build/pkgs/sage_objects/spkg-src +++ b/build/pkgs/sagemath_categories/spkg-src @@ -1,10 +1,10 @@ #!/usr/bin/env bash # -# Script to prepare an sdist tarball for sage_objects +# Script to prepare an sdist tarball for sagemath-categories # This script is not used during build. # # HOW TO MAKE THE TARBALL: -# 1) ./sage --sh build/pkgs/sage_objects/spkg-src +# ./sage --sh build/pkgs/sagemath_categories/spkg-src if [ -z "$SAGE_ROOT" ] ; then echo >&2 "Error - SAGE_ROOT undefined ... exiting" @@ -15,7 +15,7 @@ fi # Exit on failure set -e -cd build/pkgs/sage_objects +cd build/pkgs/sagemath_categories cd src sage-python23 -u setup.py --no-user-cfg sdist --dist-dir "$SAGE_DISTFILES" diff --git a/build/pkgs/sage_categories/src/MANIFEST.in b/build/pkgs/sagemath_categories/src/MANIFEST.in similarity index 95% rename from build/pkgs/sage_categories/src/MANIFEST.in rename to build/pkgs/sagemath_categories/src/MANIFEST.in index d28ba5ae55f..daa97a319ce 100644 --- a/build/pkgs/sage_categories/src/MANIFEST.in +++ b/build/pkgs/sagemath_categories/src/MANIFEST.in @@ -1,5 +1,8 @@ prune sage graft sage/cpython +graft sage_setup +prune sage_setup/docbuild + include sage/__init__.py # FIXME: Needs to become a namespace package include sage/env.py # FIXME: sage_setup must be changed so it does not depend on it include sage/version.py # FIXME: likewise @@ -7,6 +10,7 @@ include sage/version.py # FIXME: likewise global-include all__sage_objects.py global-include all__sage_categories.py +graft sage/features graft sage/structure graft sage/categories include sage/misc/__init__.py @@ -30,6 +34,7 @@ include sage/misc/bindable_class.* include sage/misc/verbose.* include sage/misc/repr.* +include sage/misc/superseded.* include sage/misc/misc_c.* # prod include sage/misc/flatten.* # dep of sage/categories/coxeter_groups.py @@ -83,3 +88,5 @@ include sage/misc/package.* graft sage/repl graft sage/server + +global-exclude *.py[co] diff --git a/build/pkgs/sagemath_categories/src/README.rst b/build/pkgs/sagemath_categories/src/README.rst new file mode 100644 index 00000000000..cbfab7ea2df --- /dev/null +++ b/build/pkgs/sagemath_categories/src/README.rst @@ -0,0 +1,35 @@ +========================================================================= + Sage: Open Source Mathematics Software: Sage categories and basic rings +========================================================================= + +About SageMath +-------------- + + "Creating a Viable Open Source Alternative to + Magma, Maple, Mathematica, and MATLAB" + + Copyright (C) 2005-2020 The Sage Development Team + + https://www.sagemath.org + +SageMath fully supports all major Linux distributions, recent versions of macOS, and Windows (using Cygwin or Windows Subsystem for Linux). + +The traditional and recommended way to install SageMath is from source via Sage-the-distribution (https://www.sagemath.org/download-source.html). Sage-the-distribution first builds a large number of open source packages from source (unless it finds suitable versions installed in the system) and then installs the Sage Library (sagelib, implemented in Python and Cython). + + +About this experimental pip-installable source distribution +----------------------------------------------------------- + +This pip-installable source distribution `sagemath-categories` is an experimental distribution of a small part of the Sage Library. Use at your own risk. It provides a small subset of the modules of the Sage library ("sagelib", `sagemath-standard`). It is a superset of the `sagemath-objects` (providing Sage objects, the element/parent framework, categories, the coercion system and the related metaclasses), making various additional categories available without introducing dependencies on additional mathematical libraries. + + +Documentation +------------- + +* `Categories `_ + +* `Structure `_ + +* `Coercion `_ + +* `Classes, Metaclasses `_ diff --git a/build/pkgs/sage_categories/src/bin b/build/pkgs/sagemath_categories/src/bin similarity index 100% rename from build/pkgs/sage_categories/src/bin rename to build/pkgs/sagemath_categories/src/bin diff --git a/build/pkgs/sagemath_categories/src/requirements.txt b/build/pkgs/sagemath_categories/src/requirements.txt new file mode 120000 index 00000000000..59a1d498434 --- /dev/null +++ b/build/pkgs/sagemath_categories/src/requirements.txt @@ -0,0 +1 @@ +../../sagemath_objects/src/requirements.txt \ No newline at end of file diff --git a/build/pkgs/sage_categories/src/sage b/build/pkgs/sagemath_categories/src/sage similarity index 100% rename from build/pkgs/sage_categories/src/sage rename to build/pkgs/sagemath_categories/src/sage diff --git a/build/pkgs/sage_categories/src/sage_setup b/build/pkgs/sagemath_categories/src/sage_setup similarity index 100% rename from build/pkgs/sage_categories/src/sage_setup rename to build/pkgs/sagemath_categories/src/sage_setup diff --git a/build/pkgs/sagemath_categories/src/setup.cfg b/build/pkgs/sagemath_categories/src/setup.cfg new file mode 100644 index 00000000000..ff741a328c9 --- /dev/null +++ b/build/pkgs/sagemath_categories/src/setup.cfg @@ -0,0 +1,31 @@ +[metadata] +name = sagemath-categories +description = Sage: Open Source Mathematics Software: Sage categories and basic rings +long_description = file: README.rst +long_description_content_type = text/x-rst +license = GNU General Public License (GPL) v2 or later +author = The Sage Developers +author_email = sage-support@googlegroups.com +url = https://www.sagemath.org + +classifiers = + Development Status :: 6 - Mature + Intended Audience :: Education + Intended Audience :: Science/Research + License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+) + Operating System :: POSIX + Operating System :: MacOS :: MacOS X + Programming Language :: Python :: 3 :: Only + Programming Language :: Python :: 3.6 + Programming Language :: Python :: 3.7 + Programming Language :: Python :: 3.8 + Programming Language :: Python :: 3.9 + Programming Language :: Python :: Implementation :: CPython + Topic :: Scientific/Engineering :: Mathematics + +[options] +install_requires = + Cython + pkgconfig + cysignals + gmpy2 ==2.1.0b5 diff --git a/build/pkgs/sagemath_categories/src/setup.py b/build/pkgs/sagemath_categories/src/setup.py new file mode 120000 index 00000000000..ac1037c769d --- /dev/null +++ b/build/pkgs/sagemath_categories/src/setup.py @@ -0,0 +1 @@ +../../sagemath_objects/src/setup.py \ No newline at end of file diff --git a/build/pkgs/sage_categories/src/tox.ini b/build/pkgs/sagemath_categories/src/tox.ini similarity index 88% rename from build/pkgs/sage_categories/src/tox.ini rename to build/pkgs/sagemath_categories/src/tox.ini index cf2411bbf31..deba25e73a7 100644 --- a/build/pkgs/sage_categories/src/tox.ini +++ b/build/pkgs/sagemath_categories/src/tox.ini @@ -4,11 +4,11 @@ # # To build and test in the tox environment: # -# ./sage -sh -c '(cd build/pkgs/sage_categories/src && tox)' +# ./sage -sh -c '(cd build/pkgs/sagemath_categories/src && tox -v -v -v)' # # To test interactively: # -# build/pkgs/sage_categories/src/.tox/python/bin/python +# build/pkgs/sagemath_categories/src/.tox/python/bin/python # [tox] diff --git a/build/pkgs/sage_categories/type b/build/pkgs/sagemath_categories/type similarity index 100% rename from build/pkgs/sage_categories/type rename to build/pkgs/sagemath_categories/type diff --git a/build/pkgs/sage_objects/dependencies b/build/pkgs/sagemath_objects/dependencies similarity index 100% rename from build/pkgs/sage_objects/dependencies rename to build/pkgs/sagemath_objects/dependencies diff --git a/build/pkgs/sage_objects/package-version.txt b/build/pkgs/sagemath_objects/package-version.txt similarity index 100% rename from build/pkgs/sage_objects/package-version.txt rename to build/pkgs/sagemath_objects/package-version.txt diff --git a/build/pkgs/sage_objects/spkg-install b/build/pkgs/sagemath_objects/spkg-install similarity index 100% rename from build/pkgs/sage_objects/spkg-install rename to build/pkgs/sagemath_objects/spkg-install diff --git a/build/pkgs/sage_categories/spkg-src b/build/pkgs/sagemath_objects/spkg-src similarity index 70% rename from build/pkgs/sage_categories/spkg-src rename to build/pkgs/sagemath_objects/spkg-src index 94a345725d5..71e8a36acb8 100755 --- a/build/pkgs/sage_categories/spkg-src +++ b/build/pkgs/sagemath_objects/spkg-src @@ -1,10 +1,10 @@ #!/usr/bin/env bash # -# Script to prepare an sdist tarball for sage_categories +# Script to prepare an sdist tarball for sagemath-objects # This script is not used during build. # # HOW TO MAKE THE TARBALL: -# ./sage --sh build/pkgs/sage_categories/spkg-src +# 1) ./sage --sh build/pkgs/sagemath_objects/spkg-src if [ -z "$SAGE_ROOT" ] ; then echo >&2 "Error - SAGE_ROOT undefined ... exiting" @@ -15,7 +15,7 @@ fi # Exit on failure set -e -cd build/pkgs/sage_categories +cd build/pkgs/sagemath_objects cd src sage-python23 -u setup.py --no-user-cfg sdist --dist-dir "$SAGE_DISTFILES" diff --git a/build/pkgs/sage_objects/src/MANIFEST.in b/build/pkgs/sagemath_objects/src/MANIFEST.in similarity index 96% rename from build/pkgs/sage_objects/src/MANIFEST.in rename to build/pkgs/sagemath_objects/src/MANIFEST.in index 0d8a79a3b39..62902d9fea4 100644 --- a/build/pkgs/sage_objects/src/MANIFEST.in +++ b/build/pkgs/sagemath_objects/src/MANIFEST.in @@ -1,11 +1,15 @@ prune sage graft sage/cpython +graft sage_setup +prune sage_setup/docbuild + include sage/__init__.py # FIXME: Needs to become a namespace package include sage/env.py # FIXME: sage_setup must be changed so it does not depend on it include sage/version.py # FIXME: likewise global-include all__sage_objects.py +graft sage/features graft sage/structure include sage/categories/__init__.py # FIXME: Needs to become a namespace package include sage/categories/action.* @@ -52,6 +56,7 @@ include sage/misc/bindable_class.* include sage/misc/verbose.* include sage/misc/repr.* +include sage/misc/superseded.* include sage/misc/misc_c.* # prod include sage/misc/flatten.* # dep of sage/categories/coxeter_groups.py @@ -97,3 +102,5 @@ include sage/misc/package.* graft sage/repl graft sage/server + +global-exclude *.py[co] diff --git a/build/pkgs/sagemath_objects/src/README.rst b/build/pkgs/sagemath_objects/src/README.rst new file mode 100644 index 00000000000..8e707fcd489 --- /dev/null +++ b/build/pkgs/sagemath_objects/src/README.rst @@ -0,0 +1,35 @@ +============================================================================================================ + Sage: Open Source Mathematics Software: Sage objects, elements, parents, categories, coercion, metaclasses +============================================================================================================ + +About SageMath +-------------- + + "Creating a Viable Open Source Alternative to + Magma, Maple, Mathematica, and MATLAB" + + Copyright (C) 2005-2020 The Sage Development Team + + https://www.sagemath.org + +SageMath fully supports all major Linux distributions, recent versions of macOS, and Windows (using Cygwin or Windows Subsystem for Linux). + +The traditional and recommended way to install SageMath is from source via Sage-the-distribution (https://www.sagemath.org/download-source.html). Sage-the-distribution first builds a large number of open source packages from source (unless it finds suitable versions installed in the system) and then installs the Sage Library (sagelib, implemented in Python and Cython). + + +About this experimental pip-installable source distribution +----------------------------------------------------------- + +This pip-installable source distribution `sagemath-objects` is an experimental distribution of a small part of the Sage Library. Use at your own risk. It provides a small, fundamental subset of the modules of the Sage library ("sagelib", `sagemath-standard`), making Sage objects, the element/parent framework, categories, the coercion system and the related metaclasses available. + + +Documentation +------------- + +* `Categories `_ + +* `Structure `_ + +* `Coercion `_ + +* `Classes, Metaclasses `_ diff --git a/build/pkgs/sage_objects/src/bin b/build/pkgs/sagemath_objects/src/bin similarity index 100% rename from build/pkgs/sage_objects/src/bin rename to build/pkgs/sagemath_objects/src/bin diff --git a/build/pkgs/sagemath_objects/src/requirements.txt b/build/pkgs/sagemath_objects/src/requirements.txt new file mode 100644 index 00000000000..389a30e9c27 --- /dev/null +++ b/build/pkgs/sagemath_objects/src/requirements.txt @@ -0,0 +1,5 @@ +Cython >=0.29.17 +pkgconfig # really needed? +cysignals +gmpy2 ==2.1.0b5 +ipython >=7 diff --git a/build/pkgs/sage_objects/src/sage b/build/pkgs/sagemath_objects/src/sage similarity index 100% rename from build/pkgs/sage_objects/src/sage rename to build/pkgs/sagemath_objects/src/sage diff --git a/build/pkgs/sage_objects/src/sage_setup b/build/pkgs/sagemath_objects/src/sage_setup similarity index 100% rename from build/pkgs/sage_objects/src/sage_setup rename to build/pkgs/sagemath_objects/src/sage_setup diff --git a/build/pkgs/sagemath_objects/src/setup.cfg b/build/pkgs/sagemath_objects/src/setup.cfg new file mode 100644 index 00000000000..eaced54e55a --- /dev/null +++ b/build/pkgs/sagemath_objects/src/setup.cfg @@ -0,0 +1,31 @@ +[metadata] +name = sagemath-objects +description = Sage: Open Source Mathematics Software: Sage objects, elements, parents, categories, coercion, metaclasses +long_description = file: README.rst +long_description_content_type = text/x-rst +license = GNU General Public License (GPL) v2 or later +author = The Sage Developers +author_email = sage-support@googlegroups.com +url = https://www.sagemath.org + +classifiers = + Development Status :: 6 - Mature + Intended Audience :: Education + Intended Audience :: Science/Research + License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+) + Operating System :: POSIX + Operating System :: MacOS :: MacOS X + Programming Language :: Python :: 3 :: Only + Programming Language :: Python :: 3.6 + Programming Language :: Python :: 3.7 + Programming Language :: Python :: 3.8 + Programming Language :: Python :: 3.9 + Programming Language :: Python :: Implementation :: CPython + Topic :: Scientific/Engineering :: Mathematics + +[options] +install_requires = + Cython + pkgconfig + cysignals + gmpy2 ==2.1.0b5 diff --git a/build/pkgs/sage_objects/src/setup.py b/build/pkgs/sagemath_objects/src/setup.py similarity index 81% rename from build/pkgs/sage_objects/src/setup.py rename to build/pkgs/sagemath_objects/src/setup.py index a85190c180d..2084364f140 100644 --- a/build/pkgs/sage_objects/src/setup.py +++ b/build/pkgs/sagemath_objects/src/setup.py @@ -3,6 +3,13 @@ from distutils import log from setuptools import setup +# Work around a Cython problem in Python 3.8.x on macOS +# https://github.com/cython/cython/issues/3262 +import os +if os.uname().sysname == 'Darwin': + import multiprocessing + multiprocessing.set_start_method('fork', force=True) + from sage_setup.command.sage_build_cython import sage_build_cython from sage_setup.command.sage_build_ext import sage_build_ext diff --git a/build/pkgs/sage_objects/src/tox.ini b/build/pkgs/sagemath_objects/src/tox.ini similarity index 83% rename from build/pkgs/sage_objects/src/tox.ini rename to build/pkgs/sagemath_objects/src/tox.ini index ee2b8484fee..c666007ddea 100644 --- a/build/pkgs/sage_objects/src/tox.ini +++ b/build/pkgs/sagemath_objects/src/tox.ini @@ -4,11 +4,11 @@ # # To build and test in the tox environment: # -# ./sage -sh -c '(cd build/pkgs/sage_objects/src && tox)' +# ./sage -sh -c '(cd build/pkgs/sagemath_objects/src && tox -v -v)' # # To test interactively: # -# build/pkgs/sage_objects/src/.tox/python/bin/python +# build/pkgs/sagemath_objects/src/.tox/python/bin/python # [tox] @@ -23,7 +23,7 @@ whitelist_externals = bash commands = - # Beware of the treacherous non-src layout. "./sage/" shadows the install sage package. + # Beware of the treacherous non-src layout. "./sage/" shadows the installed sage package. python -c 'import sys; "" in sys.path and sys.path.remove(""); import sage.structure.all, sage.categories.sets_cat' python -c 'import sys; "" in sys.path and sys.path.remove(""); from sage.all__sage_objects import *' diff --git a/build/pkgs/sage_objects/type b/build/pkgs/sagemath_objects/type similarity index 100% rename from build/pkgs/sage_objects/type rename to build/pkgs/sagemath_objects/type From 7cc764a4fd3cb8d0024b80be0466f1ef36279b26 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Fri, 25 Jun 2021 14:55:55 -0700 Subject: [PATCH 16/39] Move source trees from build/pkgs/sagemath_*/src to pkgs/sagemath-* --- build/pkgs/sagemath_categories/SPKG.rst | 1 + build/pkgs/sagemath_categories/src | 1 + build/pkgs/sagemath_categories/src/bin | 1 - build/pkgs/sagemath_categories/src/requirements.txt | 1 - build/pkgs/sagemath_categories/src/sage | 1 - build/pkgs/sagemath_categories/src/sage_setup | 1 - build/pkgs/sagemath_categories/src/setup.py | 1 - build/pkgs/sagemath_objects/SPKG.rst | 1 + build/pkgs/sagemath_objects/spkg-src | 2 +- build/pkgs/sagemath_objects/src | 1 + build/pkgs/sagemath_objects/src/bin | 1 - build/pkgs/sagemath_objects/src/sage | 1 - build/pkgs/sagemath_objects/src/sage_setup | 1 - .../src => pkgs/sagemath-categories}/MANIFEST.in | 0 .../src => pkgs/sagemath-categories}/README.rst | 0 pkgs/sagemath-categories/bin | 1 + pkgs/sagemath-categories/requirements.txt | 1 + pkgs/sagemath-categories/sage | 1 + pkgs/sagemath-categories/sage_setup | 1 + .../src => pkgs/sagemath-categories}/setup.cfg | 0 pkgs/sagemath-categories/setup.py | 1 + .../src => pkgs/sagemath-categories}/tox.ini | 8 ++------ .../src => pkgs/sagemath-objects}/MANIFEST.in | 0 .../src => pkgs/sagemath-objects}/README.rst | 0 pkgs/sagemath-objects/bin | 1 + .../src => pkgs/sagemath-objects}/requirements.txt | 0 pkgs/sagemath-objects/sage | 1 + pkgs/sagemath-objects/sage_setup | 1 + .../src => pkgs/sagemath-objects}/setup.cfg | 0 .../src => pkgs/sagemath-objects}/setup.py | 0 .../src => pkgs/sagemath-objects}/tox.ini | 8 ++------ 31 files changed, 17 insertions(+), 21 deletions(-) create mode 120000 build/pkgs/sagemath_categories/SPKG.rst create mode 120000 build/pkgs/sagemath_categories/src delete mode 120000 build/pkgs/sagemath_categories/src/bin delete mode 120000 build/pkgs/sagemath_categories/src/requirements.txt delete mode 120000 build/pkgs/sagemath_categories/src/sage delete mode 120000 build/pkgs/sagemath_categories/src/sage_setup delete mode 120000 build/pkgs/sagemath_categories/src/setup.py create mode 120000 build/pkgs/sagemath_objects/SPKG.rst create mode 120000 build/pkgs/sagemath_objects/src delete mode 120000 build/pkgs/sagemath_objects/src/bin delete mode 120000 build/pkgs/sagemath_objects/src/sage delete mode 120000 build/pkgs/sagemath_objects/src/sage_setup rename {build/pkgs/sagemath_categories/src => pkgs/sagemath-categories}/MANIFEST.in (100%) rename {build/pkgs/sagemath_categories/src => pkgs/sagemath-categories}/README.rst (100%) create mode 120000 pkgs/sagemath-categories/bin create mode 120000 pkgs/sagemath-categories/requirements.txt create mode 120000 pkgs/sagemath-categories/sage create mode 120000 pkgs/sagemath-categories/sage_setup rename {build/pkgs/sagemath_categories/src => pkgs/sagemath-categories}/setup.cfg (100%) create mode 120000 pkgs/sagemath-categories/setup.py rename {build/pkgs/sagemath_categories/src => pkgs/sagemath-categories}/tox.ini (83%) rename {build/pkgs/sagemath_objects/src => pkgs/sagemath-objects}/MANIFEST.in (100%) rename {build/pkgs/sagemath_objects/src => pkgs/sagemath-objects}/README.rst (100%) create mode 120000 pkgs/sagemath-objects/bin rename {build/pkgs/sagemath_objects/src => pkgs/sagemath-objects}/requirements.txt (100%) create mode 120000 pkgs/sagemath-objects/sage create mode 120000 pkgs/sagemath-objects/sage_setup rename {build/pkgs/sagemath_objects/src => pkgs/sagemath-objects}/setup.cfg (100%) rename {build/pkgs/sagemath_objects/src => pkgs/sagemath-objects}/setup.py (100%) rename {build/pkgs/sagemath_objects/src => pkgs/sagemath-objects}/tox.ini (80%) diff --git a/build/pkgs/sagemath_categories/SPKG.rst b/build/pkgs/sagemath_categories/SPKG.rst new file mode 120000 index 00000000000..b4545b4bda6 --- /dev/null +++ b/build/pkgs/sagemath_categories/SPKG.rst @@ -0,0 +1 @@ +src/README.rst \ No newline at end of file diff --git a/build/pkgs/sagemath_categories/src b/build/pkgs/sagemath_categories/src new file mode 120000 index 00000000000..5e64e8c2f9e --- /dev/null +++ b/build/pkgs/sagemath_categories/src @@ -0,0 +1 @@ +../../../pkgs/sagemath-categories \ No newline at end of file diff --git a/build/pkgs/sagemath_categories/src/bin b/build/pkgs/sagemath_categories/src/bin deleted file mode 120000 index 459186de7e0..00000000000 --- a/build/pkgs/sagemath_categories/src/bin +++ /dev/null @@ -1 +0,0 @@ -../../../../src/bin \ No newline at end of file diff --git a/build/pkgs/sagemath_categories/src/requirements.txt b/build/pkgs/sagemath_categories/src/requirements.txt deleted file mode 120000 index 59a1d498434..00000000000 --- a/build/pkgs/sagemath_categories/src/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -../../sagemath_objects/src/requirements.txt \ No newline at end of file diff --git a/build/pkgs/sagemath_categories/src/sage b/build/pkgs/sagemath_categories/src/sage deleted file mode 120000 index c4f2d5df534..00000000000 --- a/build/pkgs/sagemath_categories/src/sage +++ /dev/null @@ -1 +0,0 @@ -../../../../src/sage \ No newline at end of file diff --git a/build/pkgs/sagemath_categories/src/sage_setup b/build/pkgs/sagemath_categories/src/sage_setup deleted file mode 120000 index a2cca6f09f7..00000000000 --- a/build/pkgs/sagemath_categories/src/sage_setup +++ /dev/null @@ -1 +0,0 @@ -../../../../src/sage_setup \ No newline at end of file diff --git a/build/pkgs/sagemath_categories/src/setup.py b/build/pkgs/sagemath_categories/src/setup.py deleted file mode 120000 index ac1037c769d..00000000000 --- a/build/pkgs/sagemath_categories/src/setup.py +++ /dev/null @@ -1 +0,0 @@ -../../sagemath_objects/src/setup.py \ No newline at end of file diff --git a/build/pkgs/sagemath_objects/SPKG.rst b/build/pkgs/sagemath_objects/SPKG.rst new file mode 120000 index 00000000000..b4545b4bda6 --- /dev/null +++ b/build/pkgs/sagemath_objects/SPKG.rst @@ -0,0 +1 @@ +src/README.rst \ No newline at end of file diff --git a/build/pkgs/sagemath_objects/spkg-src b/build/pkgs/sagemath_objects/spkg-src index 71e8a36acb8..68719fae1b6 100755 --- a/build/pkgs/sagemath_objects/spkg-src +++ b/build/pkgs/sagemath_objects/spkg-src @@ -18,4 +18,4 @@ set -e cd build/pkgs/sagemath_objects cd src -sage-python23 -u setup.py --no-user-cfg sdist --dist-dir "$SAGE_DISTFILES" +python3 -u setup.py --no-user-cfg sdist --dist-dir "$SAGE_DISTFILES" diff --git a/build/pkgs/sagemath_objects/src b/build/pkgs/sagemath_objects/src new file mode 120000 index 00000000000..f9cb321d7b4 --- /dev/null +++ b/build/pkgs/sagemath_objects/src @@ -0,0 +1 @@ +../../../pkgs/sagemath-objects \ No newline at end of file diff --git a/build/pkgs/sagemath_objects/src/bin b/build/pkgs/sagemath_objects/src/bin deleted file mode 120000 index 459186de7e0..00000000000 --- a/build/pkgs/sagemath_objects/src/bin +++ /dev/null @@ -1 +0,0 @@ -../../../../src/bin \ No newline at end of file diff --git a/build/pkgs/sagemath_objects/src/sage b/build/pkgs/sagemath_objects/src/sage deleted file mode 120000 index c4f2d5df534..00000000000 --- a/build/pkgs/sagemath_objects/src/sage +++ /dev/null @@ -1 +0,0 @@ -../../../../src/sage \ No newline at end of file diff --git a/build/pkgs/sagemath_objects/src/sage_setup b/build/pkgs/sagemath_objects/src/sage_setup deleted file mode 120000 index a2cca6f09f7..00000000000 --- a/build/pkgs/sagemath_objects/src/sage_setup +++ /dev/null @@ -1 +0,0 @@ -../../../../src/sage_setup \ No newline at end of file diff --git a/build/pkgs/sagemath_categories/src/MANIFEST.in b/pkgs/sagemath-categories/MANIFEST.in similarity index 100% rename from build/pkgs/sagemath_categories/src/MANIFEST.in rename to pkgs/sagemath-categories/MANIFEST.in diff --git a/build/pkgs/sagemath_categories/src/README.rst b/pkgs/sagemath-categories/README.rst similarity index 100% rename from build/pkgs/sagemath_categories/src/README.rst rename to pkgs/sagemath-categories/README.rst diff --git a/pkgs/sagemath-categories/bin b/pkgs/sagemath-categories/bin new file mode 120000 index 00000000000..2f8b9b30ee7 --- /dev/null +++ b/pkgs/sagemath-categories/bin @@ -0,0 +1 @@ +../../src/bin \ No newline at end of file diff --git a/pkgs/sagemath-categories/requirements.txt b/pkgs/sagemath-categories/requirements.txt new file mode 120000 index 00000000000..473d46a8d2c --- /dev/null +++ b/pkgs/sagemath-categories/requirements.txt @@ -0,0 +1 @@ +../sagemath-objects/requirements.txt \ No newline at end of file diff --git a/pkgs/sagemath-categories/sage b/pkgs/sagemath-categories/sage new file mode 120000 index 00000000000..e0da5daa6f2 --- /dev/null +++ b/pkgs/sagemath-categories/sage @@ -0,0 +1 @@ +../../src/sage \ No newline at end of file diff --git a/pkgs/sagemath-categories/sage_setup b/pkgs/sagemath-categories/sage_setup new file mode 120000 index 00000000000..88b8133df49 --- /dev/null +++ b/pkgs/sagemath-categories/sage_setup @@ -0,0 +1 @@ +../../src/sage_setup \ No newline at end of file diff --git a/build/pkgs/sagemath_categories/src/setup.cfg b/pkgs/sagemath-categories/setup.cfg similarity index 100% rename from build/pkgs/sagemath_categories/src/setup.cfg rename to pkgs/sagemath-categories/setup.cfg diff --git a/pkgs/sagemath-categories/setup.py b/pkgs/sagemath-categories/setup.py new file mode 120000 index 00000000000..144436eac59 --- /dev/null +++ b/pkgs/sagemath-categories/setup.py @@ -0,0 +1 @@ +../sagemath-objects/setup.py \ No newline at end of file diff --git a/build/pkgs/sagemath_categories/src/tox.ini b/pkgs/sagemath-categories/tox.ini similarity index 83% rename from build/pkgs/sagemath_categories/src/tox.ini rename to pkgs/sagemath-categories/tox.ini index deba25e73a7..c08af10b123 100644 --- a/build/pkgs/sagemath_categories/src/tox.ini +++ b/pkgs/sagemath-categories/tox.ini @@ -1,14 +1,10 @@ -# First pip-install tox: -# -# ./sage -pip install tox -# # To build and test in the tox environment: # -# ./sage -sh -c '(cd build/pkgs/sagemath_categories/src && tox -v -v -v)' +# ./sage -sh -c '(cd pkgs/sagemath-categories/src && tox -v -v -v)' # # To test interactively: # -# build/pkgs/sagemath_categories/src/.tox/python/bin/python +# pkgs/sagemath-categories/.tox/python/bin/python # [tox] diff --git a/build/pkgs/sagemath_objects/src/MANIFEST.in b/pkgs/sagemath-objects/MANIFEST.in similarity index 100% rename from build/pkgs/sagemath_objects/src/MANIFEST.in rename to pkgs/sagemath-objects/MANIFEST.in diff --git a/build/pkgs/sagemath_objects/src/README.rst b/pkgs/sagemath-objects/README.rst similarity index 100% rename from build/pkgs/sagemath_objects/src/README.rst rename to pkgs/sagemath-objects/README.rst diff --git a/pkgs/sagemath-objects/bin b/pkgs/sagemath-objects/bin new file mode 120000 index 00000000000..2f8b9b30ee7 --- /dev/null +++ b/pkgs/sagemath-objects/bin @@ -0,0 +1 @@ +../../src/bin \ No newline at end of file diff --git a/build/pkgs/sagemath_objects/src/requirements.txt b/pkgs/sagemath-objects/requirements.txt similarity index 100% rename from build/pkgs/sagemath_objects/src/requirements.txt rename to pkgs/sagemath-objects/requirements.txt diff --git a/pkgs/sagemath-objects/sage b/pkgs/sagemath-objects/sage new file mode 120000 index 00000000000..e0da5daa6f2 --- /dev/null +++ b/pkgs/sagemath-objects/sage @@ -0,0 +1 @@ +../../src/sage \ No newline at end of file diff --git a/pkgs/sagemath-objects/sage_setup b/pkgs/sagemath-objects/sage_setup new file mode 120000 index 00000000000..88b8133df49 --- /dev/null +++ b/pkgs/sagemath-objects/sage_setup @@ -0,0 +1 @@ +../../src/sage_setup \ No newline at end of file diff --git a/build/pkgs/sagemath_objects/src/setup.cfg b/pkgs/sagemath-objects/setup.cfg similarity index 100% rename from build/pkgs/sagemath_objects/src/setup.cfg rename to pkgs/sagemath-objects/setup.cfg diff --git a/build/pkgs/sagemath_objects/src/setup.py b/pkgs/sagemath-objects/setup.py similarity index 100% rename from build/pkgs/sagemath_objects/src/setup.py rename to pkgs/sagemath-objects/setup.py diff --git a/build/pkgs/sagemath_objects/src/tox.ini b/pkgs/sagemath-objects/tox.ini similarity index 80% rename from build/pkgs/sagemath_objects/src/tox.ini rename to pkgs/sagemath-objects/tox.ini index c666007ddea..bb76c93c4a6 100644 --- a/build/pkgs/sagemath_objects/src/tox.ini +++ b/pkgs/sagemath-objects/tox.ini @@ -1,14 +1,10 @@ -# First pip-install tox: -# -# ./sage -pip install tox -# # To build and test in the tox environment: # -# ./sage -sh -c '(cd build/pkgs/sagemath_objects/src && tox -v -v)' +# ./sage -sh -c '(cd pkgs/sagemath-objects && tox -v -v)' # # To test interactively: # -# build/pkgs/sagemath_objects/src/.tox/python/bin/python +# pkgs/sagemath-objects/.tox/python/bin/python # [tox] From 44b1e8d88affb78b8c06f478f79d2414b4efa232 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Fri, 25 Jun 2021 17:18:52 -0700 Subject: [PATCH 17/39] Makefile (pypi-sdists): Add dependency on sage_setup --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 6aaf4a0b4e1..0b8db0d585d 100644 --- a/Makefile +++ b/Makefile @@ -79,7 +79,7 @@ download: dist: build/make/Makefile ./sage --sdist -pypi-sdists: +pypi-sdists: sage_setup ./sage --sh build/pkgs/sage_conf/spkg-src ./sage --sh build/pkgs/sage_sws2rst/spkg-src ./sage --sh build/pkgs/sage_docbuild/spkg-src From 1596cb58ab2eb42e62edabc5e94c6bf9e15a46ac Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Mon, 28 Jun 2021 08:48:43 -0700 Subject: [PATCH 18/39] pkgs/sage-conf_pypi/setup.py: Use --enable-download-from-upstream-url --- pkgs/sage-conf_pypi/setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/sage-conf_pypi/setup.py b/pkgs/sage-conf_pypi/setup.py index 2ed29f0d500..4a22b39b694 100644 --- a/pkgs/sage-conf_pypi/setup.py +++ b/pkgs/sage-conf_pypi/setup.py @@ -41,7 +41,7 @@ def run(self): shutil.copytree('sage_root', SAGE_ROOT) # will fail if already exists except Exception: raise DistutilsSetupError(f"the directory SAGE_ROOT={SAGE_ROOT} already exists but it is not configured. Please remove it and try again.") - cmd = f"cd {SAGE_ROOT} && {SETENV} && ./configure --prefix={SAGE_LOCAL} --with-python={sys.executable} --enable-build-as-root --with-system-python3=force --disable-notebook --disable-sagelib" + 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 --disable-notebook --disable-sagelib" print(f"Running {cmd}") if os.system(cmd) != 0: raise DistutilsSetupError("configure failed") From 32999379468f7e0fbaf2e81f7cf1ff163a461ca7 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Thu, 12 Aug 2021 15:00:52 -0700 Subject: [PATCH 19/39] Makefile (pypi-sdists): Build sagemath_objects, sagemath_categories sdists --- Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile b/Makefile index 0b8db0d585d..c6720d9eb45 100644 --- a/Makefile +++ b/Makefile @@ -84,6 +84,8 @@ pypi-sdists: sage_setup ./sage --sh build/pkgs/sage_sws2rst/spkg-src ./sage --sh build/pkgs/sage_docbuild/spkg-src ./sage --sh build/pkgs/sagelib/spkg-src + ./sage --sh build/pkgs/sagemath_objects/spkg-src + ./sage --sh build/pkgs/sagemath_categories/spkg-src @echo "Built sdists are in upstream/" # ssl: build Sage, and also install pyOpenSSL. This is necessary for From bf0938646f1568979012bce472ca37efbc18a279 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Thu, 12 Aug 2021 15:24:08 -0700 Subject: [PATCH 20/39] build/pkgs/sagemath_categories/spkg-src: Replace sage-python23 by python3 --- build/pkgs/sagemath_categories/spkg-src | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/pkgs/sagemath_categories/spkg-src b/build/pkgs/sagemath_categories/spkg-src index a63b6f92a43..327d51651b9 100755 --- a/build/pkgs/sagemath_categories/spkg-src +++ b/build/pkgs/sagemath_categories/spkg-src @@ -18,4 +18,4 @@ set -e cd build/pkgs/sagemath_categories cd src -sage-python23 -u setup.py --no-user-cfg sdist --dist-dir "$SAGE_DISTFILES" +python3 -u setup.py --no-user-cfg sdist --dist-dir "$SAGE_DISTFILES" From 5ab4e7c6243c92b40eef0d1523c43b0886ec0d67 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Thu, 12 Aug 2021 16:19:37 -0700 Subject: [PATCH 21/39] pkgs/sagemath-{objects,categories}: Generate pyproject.toml, setup.cfg with m4; remove requirements.txt --- .gitignore | 5 +++++ build/pkgs/sagelib/bootstrap | 2 +- build/pkgs/sagemath_categories/bootstrap | 1 + build/pkgs/sagemath_objects/bootstrap | 1 + pkgs/sagemath-categories/pyproject.toml.m4 | 1 + pkgs/sagemath-categories/requirements.txt | 1 - .../sagemath-categories/{setup.cfg => setup.cfg.m4} | 13 ++++++++----- pkgs/sagemath-objects/pyproject.toml.m4 | 11 +++++++++++ pkgs/sagemath-objects/requirements.txt | 5 ----- pkgs/sagemath-objects/{setup.cfg => setup.cfg.m4} | 13 ++++++++----- 10 files changed, 36 insertions(+), 17 deletions(-) create mode 120000 build/pkgs/sagemath_categories/bootstrap create mode 120000 build/pkgs/sagemath_objects/bootstrap create mode 120000 pkgs/sagemath-categories/pyproject.toml.m4 delete mode 120000 pkgs/sagemath-categories/requirements.txt rename pkgs/sagemath-categories/{setup.cfg => setup.cfg.m4} (79%) create mode 100644 pkgs/sagemath-objects/pyproject.toml.m4 delete mode 100644 pkgs/sagemath-objects/requirements.txt rename pkgs/sagemath-objects/{setup.cfg => setup.cfg.m4} (80%) diff --git a/.gitignore b/.gitignore index a657e84e517..d0d90a35eb4 100644 --- a/.gitignore +++ b/.gitignore @@ -157,6 +157,11 @@ build/bin/sage-build-env-config /pkgs/*/*.egg-info /pkgs/*/.tox +/pkgs/sagemath-objects/setup.cfg +/pkgs/sagemath-categories/setup.cfg +/pkgs/sagemath-objects/pyproject.toml +/pkgs/sagemath-categories/pyproject.toml + # same for old locations - before Trac #31577 /build/pkgs/*/src/build /build/pkgs/*/src/dist diff --git a/build/pkgs/sagelib/bootstrap b/build/pkgs/sagelib/bootstrap index db4ae487271..08f9002f8f5 100755 --- a/build/pkgs/sagelib/bootstrap +++ b/build/pkgs/sagelib/bootstrap @@ -4,7 +4,7 @@ for infile in src/*.m4; do if [ -f "$infile" ]; then outfile="src/$(basename $infile .m4)" if [ "${BOOTSTRAP_QUIET}" = "no" ]; then - echo "$0: installing build/pkgs/sagelib/$outfile" + echo "$0: installing $(pwd)/$outfile" fi m4 "$infile" > "$outfile" fi diff --git a/build/pkgs/sagemath_categories/bootstrap b/build/pkgs/sagemath_categories/bootstrap new file mode 120000 index 00000000000..40542346a4e --- /dev/null +++ b/build/pkgs/sagemath_categories/bootstrap @@ -0,0 +1 @@ +../sagelib/bootstrap \ No newline at end of file diff --git a/build/pkgs/sagemath_objects/bootstrap b/build/pkgs/sagemath_objects/bootstrap new file mode 120000 index 00000000000..40542346a4e --- /dev/null +++ b/build/pkgs/sagemath_objects/bootstrap @@ -0,0 +1 @@ +../sagelib/bootstrap \ No newline at end of file diff --git a/pkgs/sagemath-categories/pyproject.toml.m4 b/pkgs/sagemath-categories/pyproject.toml.m4 new file mode 120000 index 00000000000..b65c0df8a46 --- /dev/null +++ b/pkgs/sagemath-categories/pyproject.toml.m4 @@ -0,0 +1 @@ +../sagemath-objects/pyproject.toml.m4 \ No newline at end of file diff --git a/pkgs/sagemath-categories/requirements.txt b/pkgs/sagemath-categories/requirements.txt deleted file mode 120000 index 473d46a8d2c..00000000000 --- a/pkgs/sagemath-categories/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -../sagemath-objects/requirements.txt \ No newline at end of file diff --git a/pkgs/sagemath-categories/setup.cfg b/pkgs/sagemath-categories/setup.cfg.m4 similarity index 79% rename from pkgs/sagemath-categories/setup.cfg rename to pkgs/sagemath-categories/setup.cfg.m4 index ff741a328c9..e8e655a233f 100644 --- a/pkgs/sagemath-categories/setup.cfg +++ b/pkgs/sagemath-categories/setup.cfg.m4 @@ -1,3 +1,4 @@ +# -*- conf-unix -*- [metadata] name = sagemath-categories description = Sage: Open Source Mathematics Software: Sage categories and basic rings @@ -16,7 +17,6 @@ classifiers = Operating System :: POSIX Operating System :: MacOS :: MacOS X Programming Language :: Python :: 3 :: Only - Programming Language :: Python :: 3.6 Programming Language :: Python :: 3.7 Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.9 @@ -24,8 +24,11 @@ classifiers = Topic :: Scientific/Engineering :: Mathematics [options] +python_requires = >=3.7, <3.10 install_requires = - Cython - pkgconfig - cysignals - gmpy2 ==2.1.0b5 + esyscmd(`sage-get-system-packages install-requires \ + cython \ + pkgconfig \ + gmpy2 \ + cysignals \ + | sed "2,\$s/^/ /;"')dnl diff --git a/pkgs/sagemath-objects/pyproject.toml.m4 b/pkgs/sagemath-objects/pyproject.toml.m4 new file mode 100644 index 00000000000..f28f32c0fce --- /dev/null +++ b/pkgs/sagemath-objects/pyproject.toml.m4 @@ -0,0 +1,11 @@ +[build-system] +# Minimum requirements for the build system to execute. +requires = [ + 'sage-conf', + esyscmd(`sage-get-system-packages install-requires-toml \ + setuptools \ + wheel \ + sage_setup \ + cython \ + ')] +build-backend = "setuptools.build_meta" diff --git a/pkgs/sagemath-objects/requirements.txt b/pkgs/sagemath-objects/requirements.txt deleted file mode 100644 index 389a30e9c27..00000000000 --- a/pkgs/sagemath-objects/requirements.txt +++ /dev/null @@ -1,5 +0,0 @@ -Cython >=0.29.17 -pkgconfig # really needed? -cysignals -gmpy2 ==2.1.0b5 -ipython >=7 diff --git a/pkgs/sagemath-objects/setup.cfg b/pkgs/sagemath-objects/setup.cfg.m4 similarity index 80% rename from pkgs/sagemath-objects/setup.cfg rename to pkgs/sagemath-objects/setup.cfg.m4 index eaced54e55a..d59d1554927 100644 --- a/pkgs/sagemath-objects/setup.cfg +++ b/pkgs/sagemath-objects/setup.cfg.m4 @@ -1,3 +1,4 @@ +# -*- conf-unix -*- [metadata] name = sagemath-objects description = Sage: Open Source Mathematics Software: Sage objects, elements, parents, categories, coercion, metaclasses @@ -16,7 +17,6 @@ classifiers = Operating System :: POSIX Operating System :: MacOS :: MacOS X Programming Language :: Python :: 3 :: Only - Programming Language :: Python :: 3.6 Programming Language :: Python :: 3.7 Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.9 @@ -24,8 +24,11 @@ classifiers = Topic :: Scientific/Engineering :: Mathematics [options] +python_requires = >=3.7, <3.10 install_requires = - Cython - pkgconfig - cysignals - gmpy2 ==2.1.0b5 + esyscmd(`sage-get-system-packages install-requires \ + cython \ + pkgconfig \ + gmpy2 \ + cysignals \ + | sed "2,\$s/^/ /;"')dnl From e38644a57e2aec25c876a2ef82744e38fa14b396 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Thu, 12 Aug 2021 16:29:04 -0700 Subject: [PATCH 22/39] Makefile (pypi-sdists): Add sage_setup --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index 0b8db0d585d..26e79b800e4 100644 --- a/Makefile +++ b/Makefile @@ -81,6 +81,7 @@ dist: build/make/Makefile pypi-sdists: sage_setup ./sage --sh build/pkgs/sage_conf/spkg-src + ./sage --sh build/pkgs/sage_setup/spkg-src ./sage --sh build/pkgs/sage_sws2rst/spkg-src ./sage --sh build/pkgs/sage_docbuild/spkg-src ./sage --sh build/pkgs/sagelib/spkg-src From 4695948cf4f19c3aa79c36f4f2d672dd15e2616f Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Thu, 12 Aug 2021 16:41:44 -0700 Subject: [PATCH 23/39] pkgs/sagemath-objects/pyproject.toml.m4: Remove sage-conf from build-system requires --- pkgs/sagemath-objects/pyproject.toml.m4 | 1 - 1 file changed, 1 deletion(-) diff --git a/pkgs/sagemath-objects/pyproject.toml.m4 b/pkgs/sagemath-objects/pyproject.toml.m4 index f28f32c0fce..77b7ae99b36 100644 --- a/pkgs/sagemath-objects/pyproject.toml.m4 +++ b/pkgs/sagemath-objects/pyproject.toml.m4 @@ -1,7 +1,6 @@ [build-system] # Minimum requirements for the build system to execute. requires = [ - 'sage-conf', esyscmd(`sage-get-system-packages install-requires-toml \ setuptools \ wheel \ From 7542209dc5df2a3e247a3b107071fa42f0caca87 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Thu, 12 Aug 2021 17:02:54 -0700 Subject: [PATCH 24/39] pkgs/sagemath-{objects,categories}: Get version from VERSION.txt --- pkgs/sagemath-categories/VERSION.txt | 1 + pkgs/sagemath-categories/setup.cfg.m4 | 1 + pkgs/sagemath-objects/VERSION.txt | 1 + pkgs/sagemath-objects/setup.cfg.m4 | 1 + pkgs/sagemath-objects/setup.py | 3 --- 5 files changed, 4 insertions(+), 3 deletions(-) create mode 120000 pkgs/sagemath-categories/VERSION.txt create mode 120000 pkgs/sagemath-objects/VERSION.txt diff --git a/pkgs/sagemath-categories/VERSION.txt b/pkgs/sagemath-categories/VERSION.txt new file mode 120000 index 00000000000..43f4773d7de --- /dev/null +++ b/pkgs/sagemath-categories/VERSION.txt @@ -0,0 +1 @@ +../../src/VERSION.txt \ No newline at end of file diff --git a/pkgs/sagemath-categories/setup.cfg.m4 b/pkgs/sagemath-categories/setup.cfg.m4 index e8e655a233f..70a7f204ef4 100644 --- a/pkgs/sagemath-categories/setup.cfg.m4 +++ b/pkgs/sagemath-categories/setup.cfg.m4 @@ -1,6 +1,7 @@ # -*- conf-unix -*- [metadata] name = sagemath-categories +version = file: VERSION.txt description = Sage: Open Source Mathematics Software: Sage categories and basic rings long_description = file: README.rst long_description_content_type = text/x-rst diff --git a/pkgs/sagemath-objects/VERSION.txt b/pkgs/sagemath-objects/VERSION.txt new file mode 120000 index 00000000000..43f4773d7de --- /dev/null +++ b/pkgs/sagemath-objects/VERSION.txt @@ -0,0 +1 @@ +../../src/VERSION.txt \ No newline at end of file diff --git a/pkgs/sagemath-objects/setup.cfg.m4 b/pkgs/sagemath-objects/setup.cfg.m4 index d59d1554927..ed1d60e1192 100644 --- a/pkgs/sagemath-objects/setup.cfg.m4 +++ b/pkgs/sagemath-objects/setup.cfg.m4 @@ -1,6 +1,7 @@ # -*- conf-unix -*- [metadata] name = sagemath-objects +version = file: VERSION.txt description = Sage: Open Source Mathematics Software: Sage objects, elements, parents, categories, coercion, metaclasses long_description = file: README.rst long_description_content_type = text/x-rst diff --git a/pkgs/sagemath-objects/setup.py b/pkgs/sagemath-objects/setup.py index 2084364f140..eff2e1889e1 100644 --- a/pkgs/sagemath-objects/setup.py +++ b/pkgs/sagemath-objects/setup.py @@ -21,10 +21,7 @@ log.warn('python_modules = {0}'.format(python_modules)) log.warn('cython_modules = {0}'.format(cython_modules)) -from sage.env import SAGE_VERSION - setup( - version = SAGE_VERSION, cmdclass = dict(build_cython=sage_build_cython, build_ext=sage_build_ext), packages = python_packages, From 6777af11ac7c0389c6e96fe3fd967646caf5a50a Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Thu, 12 Aug 2021 17:12:44 -0700 Subject: [PATCH 25/39] pkgs/sagemath-objects/setup.py: Give sage_setup access to sage.env --- pkgs/sagemath-objects/setup.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/sagemath-objects/setup.py b/pkgs/sagemath-objects/setup.py index eff2e1889e1..db56b4e23ad 100644 --- a/pkgs/sagemath-objects/setup.py +++ b/pkgs/sagemath-objects/setup.py @@ -10,6 +10,10 @@ import multiprocessing multiprocessing.set_start_method('fork', force=True) +# PEP 517 builds do not have . in sys.path +import sys +sys.path.insert(0, os.path.dirname(__file__)) + from sage_setup.command.sage_build_cython import sage_build_cython from sage_setup.command.sage_build_ext import sage_build_ext From 037ed2bda3015876bf95c8dc0f8a75a4487dd538 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Thu, 12 Aug 2021 17:13:35 -0700 Subject: [PATCH 26/39] pkgs/sagemath-{objects,categories}/tox.ini: Remove use of requirements.txt --- pkgs/sagemath-categories/tox.ini | 2 +- pkgs/sagemath-objects/tox.ini | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/sagemath-categories/tox.ini b/pkgs/sagemath-categories/tox.ini index c08af10b123..a83d3e53182 100644 --- a/pkgs/sagemath-categories/tox.ini +++ b/pkgs/sagemath-categories/tox.ini @@ -9,7 +9,7 @@ [tox] [testenv] -deps = -rrequirements.txt +deps = setenv = # Sage scripts such as sage-runtests like to use $HOME/.sage diff --git a/pkgs/sagemath-objects/tox.ini b/pkgs/sagemath-objects/tox.ini index bb76c93c4a6..621908594ba 100644 --- a/pkgs/sagemath-objects/tox.ini +++ b/pkgs/sagemath-objects/tox.ini @@ -9,7 +9,7 @@ [tox] [testenv] -deps = -rrequirements.txt +deps = setenv = # Sage scripts such as sage-runtests like to use $HOME/.sage From c66d5fc63f7bc59be9714d2e147d0cb9bb7ed3a1 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Thu, 12 Aug 2021 17:55:15 -0700 Subject: [PATCH 27/39] pkgs/sagemath-{objects,categories}/MANIFEST.in: include VERSION.txt, remove vendoring of sage_setup --- pkgs/sagemath-categories/MANIFEST.in | 3 +-- pkgs/sagemath-categories/sage_setup | 1 - pkgs/sagemath-objects/MANIFEST.in | 3 +-- pkgs/sagemath-objects/sage_setup | 1 - 4 files changed, 2 insertions(+), 6 deletions(-) delete mode 120000 pkgs/sagemath-categories/sage_setup delete mode 120000 pkgs/sagemath-objects/sage_setup diff --git a/pkgs/sagemath-categories/MANIFEST.in b/pkgs/sagemath-categories/MANIFEST.in index daa97a319ce..1d6704c85a2 100644 --- a/pkgs/sagemath-categories/MANIFEST.in +++ b/pkgs/sagemath-categories/MANIFEST.in @@ -1,11 +1,10 @@ prune sage graft sage/cpython -graft sage_setup -prune sage_setup/docbuild include sage/__init__.py # FIXME: Needs to become a namespace package include sage/env.py # FIXME: sage_setup must be changed so it does not depend on it include sage/version.py # FIXME: likewise +include VERSION.txt global-include all__sage_objects.py global-include all__sage_categories.py diff --git a/pkgs/sagemath-categories/sage_setup b/pkgs/sagemath-categories/sage_setup deleted file mode 120000 index 88b8133df49..00000000000 --- a/pkgs/sagemath-categories/sage_setup +++ /dev/null @@ -1 +0,0 @@ -../../src/sage_setup \ No newline at end of file diff --git a/pkgs/sagemath-objects/MANIFEST.in b/pkgs/sagemath-objects/MANIFEST.in index 62902d9fea4..cf87bc8d97f 100644 --- a/pkgs/sagemath-objects/MANIFEST.in +++ b/pkgs/sagemath-objects/MANIFEST.in @@ -1,11 +1,10 @@ prune sage graft sage/cpython -graft sage_setup -prune sage_setup/docbuild include sage/__init__.py # FIXME: Needs to become a namespace package include sage/env.py # FIXME: sage_setup must be changed so it does not depend on it include sage/version.py # FIXME: likewise +include VERSION.txt global-include all__sage_objects.py diff --git a/pkgs/sagemath-objects/sage_setup b/pkgs/sagemath-objects/sage_setup deleted file mode 120000 index 88b8133df49..00000000000 --- a/pkgs/sagemath-objects/sage_setup +++ /dev/null @@ -1 +0,0 @@ -../../src/sage_setup \ No newline at end of file From 20f29be15c76fc47b618ced7b54738acc16e75b7 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Thu, 12 Aug 2021 18:19:50 -0700 Subject: [PATCH 28/39] pkgs/sagemath-{objects,categories}/sage_setup: Restore symlink - needed for the tox sdist phase --- pkgs/sagemath-categories/sage_setup | 1 + pkgs/sagemath-objects/sage_setup | 1 + 2 files changed, 2 insertions(+) create mode 120000 pkgs/sagemath-categories/sage_setup create mode 120000 pkgs/sagemath-objects/sage_setup diff --git a/pkgs/sagemath-categories/sage_setup b/pkgs/sagemath-categories/sage_setup new file mode 120000 index 00000000000..88b8133df49 --- /dev/null +++ b/pkgs/sagemath-categories/sage_setup @@ -0,0 +1 @@ +../../src/sage_setup \ No newline at end of file diff --git a/pkgs/sagemath-objects/sage_setup b/pkgs/sagemath-objects/sage_setup new file mode 120000 index 00000000000..88b8133df49 --- /dev/null +++ b/pkgs/sagemath-objects/sage_setup @@ -0,0 +1 @@ +../../src/sage_setup \ No newline at end of file From 4aff8a4f7110005867fb278ff94eb0c6de5069fb Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Thu, 12 Aug 2021 19:17:08 -0700 Subject: [PATCH 29/39] sage_setup.library_order: Skip libraries that were not detected --- src/sage_setup/library_order.py | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/src/sage_setup/library_order.py b/src/sage_setup/library_order.py index bc04af3fdd9..ef1f47d8d2e 100644 --- a/src/sage_setup/library_order.py +++ b/src/sage_setup/library_order.py @@ -11,23 +11,32 @@ # listed here will be added at the end of the list (without changing # their relative order). from sage.env import cython_aliases -aliases = cython_aliases() -arb_dylib_name = aliases["ARB_LIBRARY"] -library_order_list = aliases["SINGULAR_LIBRARIES"] + [ +modules = ('fflas-ffpack', 'gsl', 'linbox', 'Singular', + 'libpng', 'gdlib', 'm4ri', 'zlib', 'cblas') + +aliases = cython_aliases(required_modules=(), optional_modules=modules) + +if "ARB_LIBRARY" in aliases: + arb_dylib_names = [aliases["ARB_LIBRARY"]] +else: + arb_dylib_names = [] + +library_order_list = aliases.get("SINGULAR_LIBRARIES", []) + [ "giac", "intl", "curl", "ec", "ecm" -] + aliases["LINBOX_LIBRARIES"] + aliases["FFLASFFPACK_LIBRARIES"] + aliases["GSL_LIBRARIES"] + [ +] + aliases.get("LINBOX_LIBRARIES", []) + aliases.get("FFLASFFPACK_LIBRARIES", []) + aliases.get("GSL_LIBRARIES", []) + [ "pari", "flint", "ratpoints", "ecl", "glpk", "ppl", - arb_dylib_name, "mpfi", "mpfr", "mpc", "ntl", "gmp", "gmpxx", +] + arb_dylib_names + [ + "mpfi", "mpfr", "mpc", "ntl", "gmp", "gmpxx", "brial", "brial_groebner", "m4rie", -] + aliases["M4RI_LIBRARIES"] + [ +] + aliases.get("M4RI_LIBRARIES", []) + [ "zn_poly", "gap", -] + aliases["GDLIB_LIBRARIES"] + aliases["LIBPNG_LIBRARIES"] + [ - "m", "readline", "Lfunction" , -] + aliases["CBLAS_LIBRARIES"] + aliases["ZLIB_LIBRARIES"] +] + aliases.get("GDLIB_LIBRARIES", []) + aliases.get("LIBPNG_LIBRARIES", []) + [ + "m", "readline", "Lfunction", +] + aliases.get("CBLAS_LIBRARIES", []) + aliases.get("ZLIB_LIBRARIES", []) # Make a dict with library:order pairs, where the order are negative # integers sorted according to library_order_list. When sorting, From 676111f658dc3def03ad1b76437ec41feec0f729 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Fri, 27 Aug 2021 20:54:11 -0700 Subject: [PATCH 30/39] sage_setup.library_order: Take module list from new variables sage.env.default_{required,optional}_modules --- src/sage/env.py | 25 ++++++++++++++++++++----- src/sage_setup/library_order.py | 5 ++--- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/src/sage/env.py b/src/sage/env.py index 2205c4f6573..c18085d663b 100644 --- a/src/sage/env.py +++ b/src/sage/env.py @@ -397,18 +397,27 @@ def get_cblas_pc_module_name() -> str: cblas_pc_modules = CBLAS_PC_MODULES.split(':') return next((blas_lib for blas_lib in cblas_pc_modules if pkgconfig.exists(blas_lib))) -def cython_aliases(required_modules=('fflas-ffpack', 'givaro', 'gsl', 'linbox', 'Singular', - 'libpng', 'gdlib', 'm4ri', 'zlib', 'cblas'), - optional_modules=('lapack',)): + +default_required_modules = ('fflas-ffpack', 'givaro', 'gsl', 'linbox', 'Singular', + 'libpng', 'gdlib', 'm4ri', 'zlib', 'cblas') + + +default_optional_modules = ('lapack',) + + +def cython_aliases(required_modules=None, + optional_modules=None): """ Return the aliases for compiling Cython code. These aliases are macros which can occur in ``# distutils`` headers. INPUT: - - ``required_modules`` -- iterable of ``str`` values. + - ``required_modules`` -- (default: taken from ``default_required_modules``) + iterable of ``str`` values. - - ``optional_modules`` -- iterable of ``str`` values. + - ``optional_modules`` -- (default: taken from ``default_optional_modules``) + iterable of ``str`` values. EXAMPLES:: @@ -451,6 +460,12 @@ def cython_aliases(required_modules=('fflas-ffpack', 'givaro', 'gsl', 'linbox', import pkgconfig import itertools + if required_modules is None: + required_modules = default_required_modules + + if optional_modules is None: + optional_modules = default_optional_modules + aliases = {} for lib, required in itertools.chain(((lib, True) for lib in required_modules), diff --git a/src/sage_setup/library_order.py b/src/sage_setup/library_order.py index ef1f47d8d2e..8830d44a955 100644 --- a/src/sage_setup/library_order.py +++ b/src/sage_setup/library_order.py @@ -10,10 +10,9 @@ # important in particular for Cygwin. Any libraries which are not # listed here will be added at the end of the list (without changing # their relative order). -from sage.env import cython_aliases +from sage.env import cython_aliases, default_required_modules, default_optional_modules -modules = ('fflas-ffpack', 'gsl', 'linbox', 'Singular', - 'libpng', 'gdlib', 'm4ri', 'zlib', 'cblas') +modules = default_required_modules + default_optional_modules aliases = cython_aliases(required_modules=(), optional_modules=modules) From 4b5cee79c8b1411fce4a1d8a281ff9b8799944b0 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Fri, 27 Aug 2021 21:14:55 -0700 Subject: [PATCH 31/39] Revert "pkgs/sagemath-{objects,categories}/tox.ini: Remove use of requirements.txt" This reverts commit 037ed2bda3015876bf95c8dc0f8a75a4487dd538. --- pkgs/sagemath-categories/tox.ini | 2 +- pkgs/sagemath-objects/tox.ini | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/sagemath-categories/tox.ini b/pkgs/sagemath-categories/tox.ini index a83d3e53182..c08af10b123 100644 --- a/pkgs/sagemath-categories/tox.ini +++ b/pkgs/sagemath-categories/tox.ini @@ -9,7 +9,7 @@ [tox] [testenv] -deps = +deps = -rrequirements.txt setenv = # Sage scripts such as sage-runtests like to use $HOME/.sage diff --git a/pkgs/sagemath-objects/tox.ini b/pkgs/sagemath-objects/tox.ini index 621908594ba..bb76c93c4a6 100644 --- a/pkgs/sagemath-objects/tox.ini +++ b/pkgs/sagemath-objects/tox.ini @@ -9,7 +9,7 @@ [tox] [testenv] -deps = +deps = -rrequirements.txt setenv = # Sage scripts such as sage-runtests like to use $HOME/.sage From 5bff677a62525ca1dae05085bc9e5a6ea8bc2978 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Fri, 27 Aug 2021 21:18:14 -0700 Subject: [PATCH 32/39] pkgs/sagemath-{objects,categories}: Generate requirements.txt from ...m4 (for tox) --- .gitignore | 2 ++ pkgs/sagemath-categories/requirements.txt.m4 | 1 + pkgs/sagemath-objects/requirements.txt.m4 | 4 ++++ 3 files changed, 7 insertions(+) create mode 120000 pkgs/sagemath-categories/requirements.txt.m4 create mode 100644 pkgs/sagemath-objects/requirements.txt.m4 diff --git a/.gitignore b/.gitignore index d0d90a35eb4..a1a1d95cb88 100644 --- a/.gitignore +++ b/.gitignore @@ -161,6 +161,8 @@ build/bin/sage-build-env-config /pkgs/sagemath-categories/setup.cfg /pkgs/sagemath-objects/pyproject.toml /pkgs/sagemath-categories/pyproject.toml +/pkgs/sagemath-objects/requirements.txt +/pkgs/sagemath-categories/requirements.txt # same for old locations - before Trac #31577 /build/pkgs/*/src/build diff --git a/pkgs/sagemath-categories/requirements.txt.m4 b/pkgs/sagemath-categories/requirements.txt.m4 new file mode 120000 index 00000000000..f8fa4ba0e42 --- /dev/null +++ b/pkgs/sagemath-categories/requirements.txt.m4 @@ -0,0 +1 @@ +../sagemath-objects/requirements.txt.m4 \ No newline at end of file diff --git a/pkgs/sagemath-objects/requirements.txt.m4 b/pkgs/sagemath-objects/requirements.txt.m4 new file mode 100644 index 00000000000..562b53896b6 --- /dev/null +++ b/pkgs/sagemath-objects/requirements.txt.m4 @@ -0,0 +1,4 @@ +cysignals==esyscmd(`printf $(sed "s/[.]p.*//;" ../cysignals/package-version.txt)') +Cython==esyscmd(`printf $(sed "s/[.]p.*//;" ../cython/package-version.txt)') +gmpy2==esyscmd(`printf $(sed "s/[.]p.*//;" ../gmpy2/package-version.txt)') +ipython==esyscmd(`printf $(sed "s/[.]p.*//;" ../ipython/package-version.txt)') From 6f512ef5ba2d978d4d487723c32728a97f934607 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Fri, 27 Aug 2021 21:24:47 -0700 Subject: [PATCH 33/39] pkgs/sagemath-objects/setup.py: Do not require any pkgconfig modules --- pkgs/sagemath-objects/setup.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/sagemath-objects/setup.py b/pkgs/sagemath-objects/setup.py index db56b4e23ad..b53284f75b7 100644 --- a/pkgs/sagemath-objects/setup.py +++ b/pkgs/sagemath-objects/setup.py @@ -14,6 +14,9 @@ import sys sys.path.insert(0, os.path.dirname(__file__)) +import sage.env +sage.env.default_required_modules = sage.env.default_optional_modules = () + from sage_setup.command.sage_build_cython import sage_build_cython from sage_setup.command.sage_build_ext import sage_build_ext From 7f84f8260adb5a2615ef067c0a596801db80401f Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Fri, 27 Aug 2021 21:25:08 -0700 Subject: [PATCH 34/39] pkgs/sagemath-objects/pyproject.toml.m4: Add gmpy2, cysignals --- pkgs/sagemath-objects/pyproject.toml.m4 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/sagemath-objects/pyproject.toml.m4 b/pkgs/sagemath-objects/pyproject.toml.m4 index 77b7ae99b36..0a0149b9e45 100644 --- a/pkgs/sagemath-objects/pyproject.toml.m4 +++ b/pkgs/sagemath-objects/pyproject.toml.m4 @@ -6,5 +6,7 @@ requires = [ wheel \ sage_setup \ cython \ + gmpy2 \ + cysignals \ ')] build-backend = "setuptools.build_meta" From e3ec108bd9730445fa30f5b7dd45c6ecd2e9ff6c Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Fri, 27 Aug 2021 21:28:23 -0700 Subject: [PATCH 35/39] sage.misc.misc.cputime: Make import from sage.interfaces.quit local to this function --- src/sage/misc/misc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sage/misc/misc.py b/src/sage/misc/misc.py index d11d0b59963..d50fb70b566 100644 --- a/src/sage/misc/misc.py +++ b/src/sage/misc/misc.py @@ -45,7 +45,6 @@ import warnings from .lazy_string import lazy_string -from sage.interfaces.quit import expect_objects from sage.env import DOT_SAGE, HOSTNAME from sage.misc.lazy_import import lazy_import @@ -341,6 +340,7 @@ def cputime(t=0, subprocesses=False): u, s = resource.getrusage(resource.RUSAGE_SELF)[:2] return u + s - t else: + from sage.interfaces.quit import expect_objects if t == 0: ret = GlobalCputime(cputime()) for s in expect_objects: From d1458837e089c1f934df5bb6425b6319444fdb2c Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Fri, 27 Aug 2021 21:36:42 -0700 Subject: [PATCH 36/39] pkgs/sagemath-objects/tox.ini: Ignore doctest failures --- pkgs/sagemath-objects/tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/sagemath-objects/tox.ini b/pkgs/sagemath-objects/tox.ini index bb76c93c4a6..f0065c12eec 100644 --- a/pkgs/sagemath-objects/tox.ini +++ b/pkgs/sagemath-objects/tox.ini @@ -24,4 +24,4 @@ commands = python -c 'import sys; "" in sys.path and sys.path.remove(""); from sage.all__sage_objects import *' - bash -c 'cd bin && SAGE_SRC=$(python -c "from sage.env import SAGE_SRC; print(SAGE_SRC)") && sage-runtests --environment=sage.all__sage_objects --optional=sage $SAGE_SRC/sage/structure' + bash -c 'cd bin && SAGE_SRC=$(python -c "from sage.env import SAGE_SRC; print(SAGE_SRC)") && sage-runtests --environment=sage.all__sage_objects --optional=sage $SAGE_SRC/sage/structure || echo "(lots of doctest failures are expected)"' From bc767b1c702a1be4ca4c9695224aff9e3973a40d Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Fri, 27 Aug 2021 21:57:42 -0700 Subject: [PATCH 37/39] pkgs/sagemath-categories/MANIFEST.in: Generate from ....m4 --- .gitignore | 1 + pkgs/sagemath-categories/MANIFEST.in | 91 ------------------------- pkgs/sagemath-categories/MANIFEST.in.m4 | 15 ++++ 3 files changed, 16 insertions(+), 91 deletions(-) delete mode 100644 pkgs/sagemath-categories/MANIFEST.in create mode 100644 pkgs/sagemath-categories/MANIFEST.in.m4 diff --git a/.gitignore b/.gitignore index a1a1d95cb88..869e43675cd 100644 --- a/.gitignore +++ b/.gitignore @@ -163,6 +163,7 @@ build/bin/sage-build-env-config /pkgs/sagemath-categories/pyproject.toml /pkgs/sagemath-objects/requirements.txt /pkgs/sagemath-categories/requirements.txt +/pkgs/sagemath-categories/MANIFEST.in # same for old locations - before Trac #31577 /build/pkgs/*/src/build diff --git a/pkgs/sagemath-categories/MANIFEST.in b/pkgs/sagemath-categories/MANIFEST.in deleted file mode 100644 index 1d6704c85a2..00000000000 --- a/pkgs/sagemath-categories/MANIFEST.in +++ /dev/null @@ -1,91 +0,0 @@ -prune sage -graft sage/cpython - -include sage/__init__.py # FIXME: Needs to become a namespace package -include sage/env.py # FIXME: sage_setup must be changed so it does not depend on it -include sage/version.py # FIXME: likewise -include VERSION.txt - -global-include all__sage_objects.py -global-include all__sage_categories.py - -graft sage/features -graft sage/structure -graft sage/categories -include sage/misc/__init__.py -include sage/misc/classcall_metaclass.* -include sage/misc/inherit_comparison*.* -include sage/misc/weak_dict.* -include sage/misc/nested_class*.* -include sage/misc/abstract_method.* -include sage/misc/cachefunc.* -include sage/misc/decorators.* -include sage/misc/c3_controlled.* -include sage/misc/lazy_attribute.* -include sage/misc/function_mangling.* -include sage/misc/lazy_string.* -include sage/misc/lazy_format.* -include sage/misc/unknown.* -include sage/misc/fast_methods.* -include sage/misc/constant_function.* -include sage/misc/call.* -include sage/misc/bindable_class.* - -include sage/misc/verbose.* -include sage/misc/repr.* -include sage/misc/superseded.* -include sage/misc/misc_c.* # prod -include sage/misc/flatten.* # dep of sage/categories/coxeter_groups.py - -include sage/misc/lazy_import*.* -include sage/misc/sageinspect.* # dep of sage/misc/lazy_import -graft sage/docs # dep of sage/misc/lazy_import - -include sage/misc/persist.* -include sage/misc/sage_unittest.* # dep of sage/misc/persist - -include sage/misc/prandom.* # dep of sage/rings/ring - -include sage/ext/__init__.py -include sage/ext/stdsage.pxd -include sage/sets/__init__.py -include sage/sets/pythonclass.* -include sage/arith/__init__.py -include sage/arith/power.* -include sage/arith/numerical_approx.* -# integers... -include sage/arith/long.* -include sage/rings/__init__.py -include sage/rings/integer_fake.* -include sage/libs/__init__.py -graft sage/libs/gmp - -# Extra in sage_categories: -include sage/rings/ideal.* -include sage/rings/ring.* -# include sage/rings/integer*.* # depends on cypari, flint - https://trac.sagemath.org/ticket/30022 -# include sage/rings/rational*.* -# include sage/rings/infinity.* - - -## What we do not want: -# sage/misc/latex -- this should really go to another package - - -## For doctesting -include bin/sage -include bin/sage-env -include bin/sage-env-config -include bin/sage-python -include bin/sage-runtests -graft sage/doctest -include sage/misc/temporary_file.* -include sage/misc/randstate.* -include sage/misc/misc.* # walltime, cputime -# graft sage/features -include sage/misc/package.* - -graft sage/repl -graft sage/server - -global-exclude *.py[co] diff --git a/pkgs/sagemath-categories/MANIFEST.in.m4 b/pkgs/sagemath-categories/MANIFEST.in.m4 new file mode 100644 index 00000000000..6ef93bdaa09 --- /dev/null +++ b/pkgs/sagemath-categories/MANIFEST.in.m4 @@ -0,0 +1,15 @@ +dnl MANIFEST.in is generated from this file by SAGE_ROOT/bootstrap via m4. + +dnl Include all from sagemath-objects (via m4 include) +include(`../sagemath_objects/src/MANIFEST.in') + +# Extra in sagemath-categories: +global-include all__sage_categories.py +graft sage/categories +include sage/misc/prandom.* # dep of sage/rings/ring +include sage/rings/ideal.* +include sage/rings/ring.* +graft sage/typeset # dep of sage.categories.tensor +# include sage/rings/integer*.* # depends on cypari, flint - https://trac.sagemath.org/ticket/30022 +# include sage/rings/rational*.* +# include sage/rings/infinity.* From 4af99dd81fd5d4adc1c33bed8aacbdaef9db6d50 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Fri, 27 Aug 2021 22:00:21 -0700 Subject: [PATCH 38/39] pkgs/sagemath-categories/tox.ini: Ignore doctest failures --- pkgs/sagemath-categories/tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/sagemath-categories/tox.ini b/pkgs/sagemath-categories/tox.ini index c08af10b123..4e2f65921f6 100644 --- a/pkgs/sagemath-categories/tox.ini +++ b/pkgs/sagemath-categories/tox.ini @@ -26,4 +26,4 @@ commands = # Test that importing sage.categories.all initializes categories python -c 'import sys; "" in sys.path and sys.path.remove(""); from sage.categories.all import *; SimplicialComplexes(); FunctionFields()' - bash -c 'cd bin && SAGE_SRC=$(python -c "from sage.env import SAGE_SRC; print(SAGE_SRC)") && sage-runtests --environment=sage.all__sage_categories --optional=sage $SAGE_SRC/sage/structure' + bash -c 'cd bin && SAGE_SRC=$(python -c "from sage.env import SAGE_SRC; print(SAGE_SRC)") && sage-runtests --environment=sage.all__sage_categories --optional=sage $SAGE_SRC/sage/structure || echo "(lots of doctest failures are expected)"' From dda451f2ab192172405c70c09265ddae45515912 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 28 Aug 2021 11:16:09 -0700 Subject: [PATCH 39/39] Rename all__sage_objects.py, all__sage_categories.py to all__sagemath_objects.py, all__sagemath_categories.py --- pkgs/sagemath-categories/MANIFEST.in.m4 | 2 +- pkgs/sagemath-categories/tox.ini | 2 +- pkgs/sagemath-objects/MANIFEST.in | 2 +- pkgs/sagemath-objects/tox.ini | 4 ++-- src/sage/all__sage_categories.py | 5 ----- src/sage/all__sagemath_categories.py | 5 +++++ src/sage/{all__sage_objects.py => all__sagemath_objects.py} | 4 ++-- src/sage/categories/all.py | 2 +- .../{all__sage_objects.py => all__sagemath_objects.py} | 0 src/sage/misc/all.py | 2 +- .../misc/{all__sage_objects.py => all__sagemath_objects.py} | 0 src/sage/rings/all.py | 2 +- .../{all__sage_categories.py => all__sagemath_categories.py} | 0 13 files changed, 15 insertions(+), 15 deletions(-) delete mode 100644 src/sage/all__sage_categories.py create mode 100644 src/sage/all__sagemath_categories.py rename src/sage/{all__sage_objects.py => all__sagemath_objects.py} (67%) rename src/sage/categories/{all__sage_objects.py => all__sagemath_objects.py} (100%) rename src/sage/misc/{all__sage_objects.py => all__sagemath_objects.py} (100%) rename src/sage/rings/{all__sage_categories.py => all__sagemath_categories.py} (100%) diff --git a/pkgs/sagemath-categories/MANIFEST.in.m4 b/pkgs/sagemath-categories/MANIFEST.in.m4 index 6ef93bdaa09..1b5dcf3078c 100644 --- a/pkgs/sagemath-categories/MANIFEST.in.m4 +++ b/pkgs/sagemath-categories/MANIFEST.in.m4 @@ -4,7 +4,7 @@ dnl Include all from sagemath-objects (via m4 include) include(`../sagemath_objects/src/MANIFEST.in') # Extra in sagemath-categories: -global-include all__sage_categories.py +global-include all__sagemath_categories.py graft sage/categories include sage/misc/prandom.* # dep of sage/rings/ring include sage/rings/ideal.* diff --git a/pkgs/sagemath-categories/tox.ini b/pkgs/sagemath-categories/tox.ini index 4e2f65921f6..f05668393cb 100644 --- a/pkgs/sagemath-categories/tox.ini +++ b/pkgs/sagemath-categories/tox.ini @@ -26,4 +26,4 @@ commands = # Test that importing sage.categories.all initializes categories python -c 'import sys; "" in sys.path and sys.path.remove(""); from sage.categories.all import *; SimplicialComplexes(); FunctionFields()' - bash -c 'cd bin && SAGE_SRC=$(python -c "from sage.env import SAGE_SRC; print(SAGE_SRC)") && sage-runtests --environment=sage.all__sage_categories --optional=sage $SAGE_SRC/sage/structure || echo "(lots of doctest failures are expected)"' + bash -c 'cd bin && SAGE_SRC=$(python -c "from sage.env import SAGE_SRC; print(SAGE_SRC)") && sage-runtests --environment=sage.all__sagemath_categories --optional=sage $SAGE_SRC/sage/structure || echo "(lots of doctest failures are expected)"' diff --git a/pkgs/sagemath-objects/MANIFEST.in b/pkgs/sagemath-objects/MANIFEST.in index cf87bc8d97f..1e11d51d901 100644 --- a/pkgs/sagemath-objects/MANIFEST.in +++ b/pkgs/sagemath-objects/MANIFEST.in @@ -6,7 +6,7 @@ include sage/env.py # FIXME: sage_setup must be changed so it does not de include sage/version.py # FIXME: likewise include VERSION.txt -global-include all__sage_objects.py +global-include all__sagemath_objects.py graft sage/features graft sage/structure diff --git a/pkgs/sagemath-objects/tox.ini b/pkgs/sagemath-objects/tox.ini index f0065c12eec..d676cb7d8f5 100644 --- a/pkgs/sagemath-objects/tox.ini +++ b/pkgs/sagemath-objects/tox.ini @@ -22,6 +22,6 @@ commands = # Beware of the treacherous non-src layout. "./sage/" shadows the installed sage package. python -c 'import sys; "" in sys.path and sys.path.remove(""); import sage.structure.all, sage.categories.sets_cat' - python -c 'import sys; "" in sys.path and sys.path.remove(""); from sage.all__sage_objects import *' + python -c 'import sys; "" in sys.path and sys.path.remove(""); from sage.all__sagemath_objects import *' - bash -c 'cd bin && SAGE_SRC=$(python -c "from sage.env import SAGE_SRC; print(SAGE_SRC)") && sage-runtests --environment=sage.all__sage_objects --optional=sage $SAGE_SRC/sage/structure || echo "(lots of doctest failures are expected)"' + bash -c 'cd bin && SAGE_SRC=$(python -c "from sage.env import SAGE_SRC; print(SAGE_SRC)") && sage-runtests --environment=sage.all__sagemath_objects --optional=sage $SAGE_SRC/sage/structure || echo "(lots of doctest failures are expected)"' diff --git a/src/sage/all__sage_categories.py b/src/sage/all__sage_categories.py deleted file mode 100644 index 9aba871b139..00000000000 --- a/src/sage/all__sage_categories.py +++ /dev/null @@ -1,5 +0,0 @@ -from .all__sage_objects import * - -from sage.categories.all import * - -from sage.rings.all__sage_categories import * diff --git a/src/sage/all__sagemath_categories.py b/src/sage/all__sagemath_categories.py new file mode 100644 index 00000000000..4f438a77cbe --- /dev/null +++ b/src/sage/all__sagemath_categories.py @@ -0,0 +1,5 @@ +from .all__sagemath_objects import * + +from sage.categories.all import * + +from sage.rings.all__sagemath_categories import * diff --git a/src/sage/all__sage_objects.py b/src/sage/all__sagemath_objects.py similarity index 67% rename from src/sage/all__sage_objects.py rename to src/sage/all__sagemath_objects.py index 1c9770a1031..9bca14eab0e 100644 --- a/src/sage/all__sage_objects.py +++ b/src/sage/all__sagemath_objects.py @@ -4,6 +4,6 @@ from cysignals.signals import (AlarmInterrupt, SignalError, sig_on_reset as sig_on_count) -from sage.misc.all__sage_objects import * +from sage.misc.all__sagemath_objects import * from sage.structure.all import * -from sage.categories.all__sage_objects import * +from sage.categories.all__sagemath_objects import * diff --git a/src/sage/categories/all.py b/src/sage/categories/all.py index ba59e5d9431..a92fc4e09cd 100644 --- a/src/sage/categories/all.py +++ b/src/sage/categories/all.py @@ -1,6 +1,6 @@ from sage.misc.lazy_import import lazy_import -from .all__sage_objects import * +from .all__sagemath_objects import * from .basic import * diff --git a/src/sage/categories/all__sage_objects.py b/src/sage/categories/all__sagemath_objects.py similarity index 100% rename from src/sage/categories/all__sage_objects.py rename to src/sage/categories/all__sagemath_objects.py diff --git a/src/sage/misc/all.py b/src/sage/misc/all.py index 367a95f37a3..23c5ad827fe 100644 --- a/src/sage/misc/all.py +++ b/src/sage/misc/all.py @@ -1,7 +1,7 @@ from .lazy_attribute import lazy_attribute, lazy_class_attribute from .lazy_import import lazy_import -from .all__sage_objects import * +from .all__sagemath_objects import * from .misc import (BackslashOperator, cputime, diff --git a/src/sage/misc/all__sage_objects.py b/src/sage/misc/all__sagemath_objects.py similarity index 100% rename from src/sage/misc/all__sage_objects.py rename to src/sage/misc/all__sagemath_objects.py diff --git a/src/sage/rings/all.py b/src/sage/rings/all.py index db82d2bee81..38e4e70eec7 100644 --- a/src/sage/rings/all.py +++ b/src/sage/rings/all.py @@ -12,7 +12,7 @@ # **************************************************************************** from sage.misc.lazy_import import lazy_import -from .all__sage_categories import * +from .all__sagemath_categories import * # Ring base classes from .ring import (Ring, Field, CommutativeRing, IntegralDomain, diff --git a/src/sage/rings/all__sage_categories.py b/src/sage/rings/all__sagemath_categories.py similarity index 100% rename from src/sage/rings/all__sage_categories.py rename to src/sage/rings/all__sagemath_categories.py