From 4f94fdd9c00177a744d99e88cbacc11e0b952e70 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sun, 25 Sep 2022 22:52:27 -0700 Subject: [PATCH 01/14] src/sage_setup/command/sage_install.py: Do not attempt to clean the install directory --- src/sage_setup/command/sage_install.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/sage_setup/command/sage_install.py b/src/sage_setup/command/sage_install.py index abfc142eec4..85b880b5dd6 100644 --- a/src/sage_setup/command/sage_install.py +++ b/src/sage_setup/command/sage_install.py @@ -93,9 +93,8 @@ def clean_stale_files(self): nobase_data_files = [(src_dir, [os.path.join(src_dir, filename) for filename in filenames]) for package, src_dir, build_dir, filenames in cmd_build_py.data_files] - # Clean install directory (usually, purelib and platlib are the same) - # and build directory. - output_dirs = [self.install_purelib, self.install_platlib, self.build_lib] + # Clean build directory. + output_dirs = [self.build_lib] from sage_setup.clean import clean_install_dir for output_dir in set(output_dirs): log.info('- cleaning {0}'.format(output_dir)) From a6b92b00d7a830e11cbcf2150202a189942547a5 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sun, 25 Sep 2022 23:15:21 -0700 Subject: [PATCH 02/14] build/pkgs/sagemath_{objects,categories,environment,repl}: Install the wheel, make standard --- build/pkgs/sagemath_categories/type | 2 +- build/pkgs/sagemath_environment/type | 2 +- build/pkgs/sagemath_objects/spkg-install | 3 +-- build/pkgs/sagemath_objects/type | 2 +- build/pkgs/sagemath_repl/type | 2 +- 5 files changed, 5 insertions(+), 6 deletions(-) diff --git a/build/pkgs/sagemath_categories/type b/build/pkgs/sagemath_categories/type index 9839eb20815..a6a7b9cd726 100644 --- a/build/pkgs/sagemath_categories/type +++ b/build/pkgs/sagemath_categories/type @@ -1 +1 @@ -experimental +standard diff --git a/build/pkgs/sagemath_environment/type b/build/pkgs/sagemath_environment/type index 9839eb20815..a6a7b9cd726 100644 --- a/build/pkgs/sagemath_environment/type +++ b/build/pkgs/sagemath_environment/type @@ -1 +1 @@ -experimental +standard diff --git a/build/pkgs/sagemath_objects/spkg-install b/build/pkgs/sagemath_objects/spkg-install index 6cc85e07e55..7cfe21e3ea4 100755 --- a/build/pkgs/sagemath_objects/spkg-install +++ b/build/pkgs/sagemath_objects/spkg-install @@ -17,11 +17,10 @@ export PIP_FIND_LINKS="file://$SAGE_SPKG_WHEELS" # First build the sdist, then build the wheel from the sdist. # https://pypa-build.readthedocs.io/en/latest/#python--m-build # (Important because sagemath-objects uses MANIFEST.in for filtering.) -# Do not install the wheel. DIST_DIR="$(mktemp -d)" python3 -m build --outdir "$DIST_DIR"/dist . || sdh_die "Failure building sdist and wheel" -wheel=$(cd "$DIST_DIR" && sdh_store_wheel . && echo $wheel) +wheel=$(cd "$DIST_DIR" && sdh_store_and_pip_install_wheel . && echo $wheel) ls -l "$wheel" if [ "$SAGE_CHECK" != no ]; then diff --git a/build/pkgs/sagemath_objects/type b/build/pkgs/sagemath_objects/type index 9839eb20815..a6a7b9cd726 100644 --- a/build/pkgs/sagemath_objects/type +++ b/build/pkgs/sagemath_objects/type @@ -1 +1 @@ -experimental +standard diff --git a/build/pkgs/sagemath_repl/type b/build/pkgs/sagemath_repl/type index 9839eb20815..a6a7b9cd726 100644 --- a/build/pkgs/sagemath_repl/type +++ b/build/pkgs/sagemath_repl/type @@ -1 +1 @@ -experimental +standard From 7a0f88f6a248e9bb8866262874654dfbed9b2cd1 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sun, 25 Sep 2022 23:45:54 -0700 Subject: [PATCH 03/14] build/pkgs/sagelib, pkgs/sagemath-standard: Factor through sagemath-{categories,environment,repl} --- build/pkgs/sagelib/dependencies | 2 +- src/MANIFEST.in | 24 ++++++++++++++++++++++++ src/pyproject.toml.m4 | 3 +++ src/setup.cfg.m4 | 4 ++++ 4 files changed, 32 insertions(+), 1 deletion(-) diff --git a/build/pkgs/sagelib/dependencies b/build/pkgs/sagelib/dependencies index 810713712ed..f2b46853bce 100644 --- a/build/pkgs/sagelib/dependencies +++ b/build/pkgs/sagelib/dependencies @@ -1,4 +1,4 @@ -FORCE $(SCRIPTS) arb boost_cropped $(BLAS) brial cliquer cypari cysignals cython ecl eclib ecm flint libgd gap giac givaro glpk gmpy2 gsl iml jinja2 jupyter_core lcalc lrcalc_python libbraiding libhomfly libpng linbox m4ri m4rie memory_allocator mpc mpfi mpfr $(MP_LIBRARY) ntl numpy pari pip pkgconfig planarity ppl pplpy primesieve primecount primecountpy pycygwin $(PYTHON) requests rw sage_conf singular symmetrica zn_poly $(PCFILES) | $(PYTHON_TOOLCHAIN) sage_setup +FORCE $(SCRIPTS) arb boost_cropped $(BLAS) brial cliquer cypari cysignals cython ecl eclib ecm flint libgd gap giac givaro glpk gmpy2 gsl iml jinja2 jupyter_core lcalc lrcalc_python libbraiding libhomfly libpng linbox m4ri m4rie memory_allocator mpc mpfi mpfr $(MP_LIBRARY) ntl numpy pari pip pkgconfig planarity ppl pplpy primesieve primecount primecountpy pycygwin $(PYTHON) requests rw sage_conf sagemath_objects sagemath_categories sagemath_environment sagemath_repl singular symmetrica zn_poly $(PCFILES) | $(PYTHON_TOOLCHAIN) sage_setup ---------- All lines of this file are ignored except the first. diff --git a/src/MANIFEST.in b/src/MANIFEST.in index 60967aac88b..69f45d68600 100644 --- a/src/MANIFEST.in +++ b/src/MANIFEST.in @@ -32,6 +32,30 @@ include sage/stats/distributions/dgs_gauss_dp.c include sage/stats/distributions/dgs_gauss_mp.c include sage/symbolic/ginac/*.cpp +# Exclude what is already shipped in sagemath-objects, sagemath-categories, sagemath-environment, sagemath-repl +global-exclude all__*.py +prune sage/misc +# Exclude what is shipped in sagemath-objects +prune sage/cpython +prune sage/structure +prune sage/libs/gmp +# Exclude what is shipped in sagemath-categories +prune sage/categories +exclude sage/rings/ideal.* +exclude sage/rings/ring.* +prune sage/typeset +# Exclude what is shipped in sagemath-environment +exclude sage/env.py +exclude sage/version.py +prune sage/features +# Exclude what is shipped in sagemath-repl +prune sage/doctest +prune sage/repl +exclude sage/misc/banner.py +exclude sage/misc/sagedoc.py +exclude sage/misc/sage_input.py +exclude sage/misc/sage_eval.py + global-exclude __pycache__ global-exclude *.py[co] global-exclude *.bak diff --git a/src/pyproject.toml.m4 b/src/pyproject.toml.m4 index 56f1b2b03ab..20ca06a034a 100644 --- a/src/pyproject.toml.m4 +++ b/src/pyproject.toml.m4 @@ -5,6 +5,9 @@ requires = [ # Note that PEP517/518 have no notion of optional sage_spkg dependencies: # https://github.com/pypa/pip/issues/6144 esyscmd(`sage-get-system-packages install-requires-toml \ + sagemath_environment \ + sagemath_objects \ + sagemath_categories \ sage_conf \ setuptools \ wheel \ diff --git a/src/setup.cfg.m4 b/src/setup.cfg.m4 index a69b69924c5..3d1fd41ae05 100644 --- a/src/setup.cfg.m4 +++ b/src/setup.cfg.m4 @@ -29,6 +29,10 @@ classifiers = python_requires = >=3.8, <3.11 install_requires = esyscmd(`sage-get-system-packages install-requires \ + sagemath_objects \ + sagemath_categories \ + sagemath_environment \ + sagemath_repl \ sage_conf \ six \ | sed "2,\$s/^/ /;"')dnl' From 40fc2f6d98f929438d2c38a200c87c24c9b5ad34 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Mon, 26 Sep 2022 18:10:48 -0700 Subject: [PATCH 04/14] build/pkgs/sagelib: Use python-build --- build/pkgs/sagelib/dependencies | 2 +- build/pkgs/sagelib/spkg-install | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/build/pkgs/sagelib/dependencies b/build/pkgs/sagelib/dependencies index f2b46853bce..c61faaa3d45 100644 --- a/build/pkgs/sagelib/dependencies +++ b/build/pkgs/sagelib/dependencies @@ -1,4 +1,4 @@ -FORCE $(SCRIPTS) arb boost_cropped $(BLAS) brial cliquer cypari cysignals cython ecl eclib ecm flint libgd gap giac givaro glpk gmpy2 gsl iml jinja2 jupyter_core lcalc lrcalc_python libbraiding libhomfly libpng linbox m4ri m4rie memory_allocator mpc mpfi mpfr $(MP_LIBRARY) ntl numpy pari pip pkgconfig planarity ppl pplpy primesieve primecount primecountpy pycygwin $(PYTHON) requests rw sage_conf sagemath_objects sagemath_categories sagemath_environment sagemath_repl singular symmetrica zn_poly $(PCFILES) | $(PYTHON_TOOLCHAIN) sage_setup +FORCE $(SCRIPTS) arb boost_cropped $(BLAS) brial cliquer cypari cysignals cython ecl eclib ecm flint libgd gap giac givaro glpk gmpy2 gsl iml jinja2 jupyter_core lcalc lrcalc_python libbraiding libhomfly libpng linbox m4ri m4rie memory_allocator mpc mpfi mpfr $(MP_LIBRARY) ntl numpy pari pip pkgconfig planarity ppl pplpy primesieve primecount primecountpy pycygwin $(PYTHON) requests rw sage_conf sagemath_objects sagemath_categories sagemath_environment sagemath_repl singular symmetrica zn_poly $(PCFILES) | $(PYTHON_TOOLCHAIN) python_build sage_setup ---------- All lines of this file are ignored except the first. diff --git a/build/pkgs/sagelib/spkg-install b/build/pkgs/sagelib/spkg-install index ad8b2ed43fc..fc7b58a4424 100755 --- a/build/pkgs/sagelib/spkg-install +++ b/build/pkgs/sagelib/spkg-install @@ -75,9 +75,14 @@ else (cd "$SITEPACKAGESDIR" && rm -f sagemath-standard.egg-link) if [ "$SAGE_WHEELS" = yes ]; then + # First build the sdist, then build the wheel from the sdist. + # https://pypa-build.readthedocs.io/en/latest/#python--m-build + # (Important because sagemath-objects uses MANIFEST.in for filtering.) + DIST_DIR="$(mktemp -d)" # Use --no-build-isolation to avoid rebuilds because of dependencies: # Compiling sage/interfaces/sagespawn.pyx because it depends on /private/var/folders/38/wnh4gf1552g_crsjnv2vmmww0000gp/T/pip-build-env-609n5985/overlay/lib/python3.10/site-packages/Cython/Includes/posix/unistd.pxd - time sdh_pip_install --no-build-isolation . + python3 -m build --no-isolation --outdir "$DIST_DIR"/dist . || sdh_die "Failure building sdist and wheel" + wheel=$(cd "$DIST_DIR" && sdh_store_and_pip_install_wheel . && echo $wheel) else time python3 -u setup.py --no-user-cfg build install || exit 1 fi From 0de8dc39de5c6018b5735b3a172d9e377efd4d16 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Wed, 28 Sep 2022 22:02:48 -0700 Subject: [PATCH 05/14] src/sage/cpython/python_debug.pxd: Fix path of "python_debug.h" --- src/sage/cpython/python_debug.pxd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sage/cpython/python_debug.pxd b/src/sage/cpython/python_debug.pxd index 57057a3ff9f..a7a2f112d00 100644 --- a/src/sage/cpython/python_debug.pxd +++ b/src/sage/cpython/python_debug.pxd @@ -9,7 +9,7 @@ from cpython.ref cimport PyObject, PyTypeObject -cdef extern from "sage/cpython/python_debug.h": +cdef extern from "python_debug.h": # This is what is generally meant by "a debug build" of Python. # Implies Py_REF_DEBUG, Py_TRACE_REFS, and PYMALLOC_DEBUG (if From 6ffd02e187275bb0b988252b70405a2bfb9fef4e Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Thu, 29 Sep 2022 00:07:20 -0700 Subject: [PATCH 06/14] src/MANIFEST.in: Add missing files in sage.misc --- src/MANIFEST.in | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/MANIFEST.in b/src/MANIFEST.in index 69f45d68600..25cdfe771fc 100644 --- a/src/MANIFEST.in +++ b/src/MANIFEST.in @@ -35,6 +35,13 @@ include sage/symbolic/ginac/*.cpp # Exclude what is already shipped in sagemath-objects, sagemath-categories, sagemath-environment, sagemath-repl global-exclude all__*.py prune sage/misc +include sage/misc/all.py +include sage/misc/allocator.pxd +include sage/misc/allocator.pyx +include sage/misc/binary_tree.pxd +include sage/misc/binary_tree.pyx +include sage/misc/search.pxd +include sage/misc/search.pyx # Exclude what is shipped in sagemath-objects prune sage/cpython prune sage/structure From ae4241a12f918969b1ce5f88e6e01e0966ad0a1a Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sun, 2 Oct 2022 22:39:01 -0700 Subject: [PATCH 07/14] build/pkgs/sagelib/spkg-install: Add TODO --- build/pkgs/sagelib/spkg-install | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build/pkgs/sagelib/spkg-install b/build/pkgs/sagelib/spkg-install index fc7b58a4424..dbe5d4f5e78 100755 --- a/build/pkgs/sagelib/spkg-install +++ b/build/pkgs/sagelib/spkg-install @@ -84,6 +84,8 @@ else python3 -m build --no-isolation --outdir "$DIST_DIR"/dist . || sdh_die "Failure building sdist and wheel" wheel=$(cd "$DIST_DIR" && sdh_store_and_pip_install_wheel . && echo $wheel) else + # TODO: Deprecate this installation mode. + # Note this no longer does any cleaning! time python3 -u setup.py --no-user-cfg build install || exit 1 fi fi From c8f5d5caf27be563fd949ff9bdd329351083f953 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Wed, 15 Feb 2023 13:51:24 -0800 Subject: [PATCH 08/14] build/pkgs/sagemath_objects/spkg-install: Fix determining wheel file location --- build/pkgs/sagemath_objects/spkg-install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/pkgs/sagemath_objects/spkg-install b/build/pkgs/sagemath_objects/spkg-install index 7cfe21e3ea4..39424d2cf1c 100755 --- a/build/pkgs/sagemath_objects/spkg-install +++ b/build/pkgs/sagemath_objects/spkg-install @@ -20,7 +20,7 @@ export PIP_FIND_LINKS="file://$SAGE_SPKG_WHEELS" DIST_DIR="$(mktemp -d)" python3 -m build --outdir "$DIST_DIR"/dist . || sdh_die "Failure building sdist and wheel" -wheel=$(cd "$DIST_DIR" && sdh_store_and_pip_install_wheel . && echo $wheel) +wheel=$(cd "$DIST_DIR" && sdh_store_and_pip_install_wheel . 1>&2 && echo $wheel) ls -l "$wheel" if [ "$SAGE_CHECK" != no ]; then From ff1895e8883e7f5260c8c9344f73dd6c882ed85d Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Fri, 24 Feb 2023 20:02:03 -0800 Subject: [PATCH 09/14] pkgs/sagemath-standard/setup.cfg.m4: Separate copy of src/setup.cfg.m4 --- .gitignore | 1 + .../{setup.cfg => setup-monolithic.cfg} | 0 .../sagemath-standard/setup-monolithic.cfg.m4 | 1 + pkgs/sagemath-standard/setup.cfg.m4 | 172 +++++++++++++++++- src/setup.cfg.m4 | 4 - 5 files changed, 173 insertions(+), 5 deletions(-) rename pkgs/sagemath-standard/{setup.cfg => setup-monolithic.cfg} (100%) create mode 120000 pkgs/sagemath-standard/setup-monolithic.cfg.m4 mode change 120000 => 100644 pkgs/sagemath-standard/setup.cfg.m4 diff --git a/.gitignore b/.gitignore index 2faf325a44c..e3824d19c59 100644 --- a/.gitignore +++ b/.gitignore @@ -176,6 +176,7 @@ build/bin/sage-build-env-config /pkgs/sagemath-objects/setup.cfg /pkgs/sagemath-categories/setup.cfg /pkgs/sagemath-environment/setup.cfg +/pkgs/sagemath-standard/setup.cfg /pkgs/sagemath-repl/setup.cfg /pkgs/sagemath-objects/pyproject.toml /pkgs/sagemath-categories/pyproject.toml diff --git a/pkgs/sagemath-standard/setup.cfg b/pkgs/sagemath-standard/setup-monolithic.cfg similarity index 100% rename from pkgs/sagemath-standard/setup.cfg rename to pkgs/sagemath-standard/setup-monolithic.cfg diff --git a/pkgs/sagemath-standard/setup-monolithic.cfg.m4 b/pkgs/sagemath-standard/setup-monolithic.cfg.m4 new file mode 120000 index 00000000000..8934d7b5955 --- /dev/null +++ b/pkgs/sagemath-standard/setup-monolithic.cfg.m4 @@ -0,0 +1 @@ +../../src/setup.cfg.m4 \ No newline at end of file diff --git a/pkgs/sagemath-standard/setup.cfg.m4 b/pkgs/sagemath-standard/setup.cfg.m4 deleted file mode 120000 index 8934d7b5955..00000000000 --- a/pkgs/sagemath-standard/setup.cfg.m4 +++ /dev/null @@ -1 +0,0 @@ -../../src/setup.cfg.m4 \ No newline at end of file diff --git a/pkgs/sagemath-standard/setup.cfg.m4 b/pkgs/sagemath-standard/setup.cfg.m4 new file mode 100644 index 00000000000..b66c0a51932 --- /dev/null +++ b/pkgs/sagemath-standard/setup.cfg.m4 @@ -0,0 +1,171 @@ +# -*- conf-unix -*- +[metadata] +name = sagemath-standard +version = file: VERSION.txt +description = Sage: Open Source Mathematics Software: Standard Python Library +long_description = file: README.rst +long_description_content_type = text/x-rst +license = GNU General Public License (GPL) v2 or later +license_files = LICENSE.txt +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.8 + Programming Language :: Python :: 3.9 + Programming Language :: Python :: 3.10 + Programming Language :: Python :: 3.11 + Programming Language :: Python :: Implementation :: CPython + Topic :: Scientific/Engineering :: Mathematics + +[options] +python_requires = >=3.8, <3.12 +install_requires = + esyscmd(`sage-get-system-packages install-requires \ + sagemath_objects \ + sagemath_categories \ + sagemath_environment \ + sagemath_repl \ + sage_conf \ + six \ + | sed "2,\$s/^/ /;"')dnl' +dnl From build/pkgs/sagelib/dependencies + esyscmd(`sage-get-system-packages install-requires \ + cypari \ + cysignals \ + cython \ + gmpy2 \ + jinja2 \ + jupyter_core \ + lrcalc_python \ + memory_allocator \ + numpy \ + pkgconfig \ + pplpy \ + primecountpy \ + requests \ + | sed "2,\$s/^/ /;"')dnl' +dnl From Makefile.in: SAGERUNTIME + esyscmd(`sage-get-system-packages install-requires \ + ipython \ + pexpect \ + | sed "2,\$s/^/ /;"')dnl' +dnl From Makefile.in: DOC_DEPENDENCIES + esyscmd(`sage-get-system-packages install-requires \ + sphinx \ + networkx \ + scipy \ + sympy \ + matplotlib \ + pillow \ + mpmath \ + ipykernel \ + jupyter_client \ + ipywidgets \ + | sed "2,\$s/^/ /;"')dnl' +dnl Other Python packages that are standard spkg, used in doctests + esyscmd(`sage-get-system-packages install-requires \ + fpylll \ + | sed "2,\$s/^/ /;"')dnl' +dnl pycryptosat # Sage distribution installs it as part of cryptominisat. According to its README on https://pypi.org/project/pycryptosat/: "The pycryptosat python package compiles while compiling CryptoMiniSat. It cannot be compiled on its own, it must be compiled at the same time as CryptoMiniSat." +dnl Packages with important upper version bounds + esyscmd(`sage-get-system-packages install-requires \ + ptyprocess \ + | sed "2,\$s/^/ /;"')dnl' + +scripts = + # The sage script + bin/sage + # Other scripts that should be in the path also for OS packaging of sage: + bin/sage-eval + # Included because it is useful for doctesting/coverage testing user scripts too: + bin/sage-runtests + bin/sage-fixdoctests + bin/sage-coverage + # The following is deprecated but might still be used in user package install scripts + bin/sage-cython + # Helper scripts invoked by sage script + # (they would actually belong to something like libexec) + bin/sage-cachegrind + bin/sage-callgrind + bin/sage-massif + bin/sage-omega + bin/sage-valgrind + bin/sage-venv-config + bin/sage-version.sh + bin/sage-cleaner + # Only makes sense in sage-the-distribution. TODO: Move to another installation script. + bin/sage-list-packages + # Uncategorized scripts in alphabetical order + bin/math-readline + bin/sage-env + # sage-env-config -- installed by sage_conf + # sage-env-config.in -- not to be installed + bin/sage-grep + bin/sage-grepdoc + bin/sage-inline-fortran + bin/sage-ipynb2rst + bin/sage-ipython + bin/sage-notebook + bin/sage-num-threads.py + bin/sage-preparse + bin/sage-python + bin/sage-rebase.bat + bin/sage-rebase.sh + bin/sage-rebaseall.bat + bin/sage-rebaseall.sh + bin/sage-run + bin/sage-run-cython + bin/sage-startuptime.py + bin/sage-update-version + +[options.package_data] + +sage.libs.gap = + sage.gaprc + +sage.interfaces = + sage-maxima.lisp + +sage.doctest = + tests/* + +sage.repl.rich_output = + example* + +sage = + ext_data/* + ext_data/kenzo/* + ext_data/singular/* + ext_data/singular/function_field/* + ext_data/images/* + ext_data/doctest/* + ext_data/doctest/invalid/* + ext_data/gap/* + ext_data/gap/joyner/* + ext_data/mwrank/* + ext_data/notebook-ipython/* + ext_data/nbconvert/* + ext_data/graphs/* + ext_data/pari/* + ext_data/pari/dokchitser/* + ext_data/pari/buzzard/* + ext_data/pari/simon/* + ext_data/magma/* + ext_data/magma/latex/* + ext_data/magma/sage/* + ext_data/valgrind/* + ext_data/threejs/* + +[options.extras_require] +R = esyscmd(`sage-get-system-packages install-requires \ + rpy2 \ + | sed "2,\$s/^/ /;"')dnl' diff --git a/src/setup.cfg.m4 b/src/setup.cfg.m4 index b66c0a51932..9f69af385e9 100644 --- a/src/setup.cfg.m4 +++ b/src/setup.cfg.m4 @@ -30,10 +30,6 @@ classifiers = python_requires = >=3.8, <3.12 install_requires = esyscmd(`sage-get-system-packages install-requires \ - sagemath_objects \ - sagemath_categories \ - sagemath_environment \ - sagemath_repl \ sage_conf \ six \ | sed "2,\$s/^/ /;"')dnl' From af97d23dcd83b8bed6c6411b4e7496979f1c774c Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Fri, 24 Feb 2023 23:32:17 -0800 Subject: [PATCH 10/14] build/pkgs/sagelib/dependencies: Conditionalize dependency on modularized distros --- build/pkgs/sagelib/dependencies | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/pkgs/sagelib/dependencies b/build/pkgs/sagelib/dependencies index b51b651f4bf..835a0ccc236 100644 --- a/build/pkgs/sagelib/dependencies +++ b/build/pkgs/sagelib/dependencies @@ -1,4 +1,4 @@ -FORCE $(SCRIPTS) arb boost_cropped $(BLAS) brial cliquer cypari cysignals cython ecl eclib ecm flint libgd gap giac givaro glpk gmpy2 gsl iml jinja2 jupyter_core lcalc lrcalc_python libbraiding libhomfly libpng linbox m4ri m4rie memory_allocator mpc mpfi mpfr $(MP_LIBRARY) ntl numpy pari pip pkgconfig planarity ppl pplpy primesieve primecount primecountpy pycygwin $(PYTHON) requests rw sage_conf sagemath_objects sagemath_categories sagemath_environment sagemath_repl singular symmetrica $(PCFILES) | $(PYTHON_TOOLCHAIN) python_build sage_setup +FORCE $(SCRIPTS) arb boost_cropped $(BLAS) brial cliquer cypari cysignals cython ecl eclib ecm flint libgd gap giac givaro glpk gmpy2 gsl iml jinja2 jupyter_core lcalc lrcalc_python libbraiding libhomfly libpng linbox m4ri m4rie memory_allocator mpc mpfi mpfr $(MP_LIBRARY) ntl numpy pari pip pkgconfig planarity ppl pplpy primesieve primecount primecountpy pycygwin $(PYTHON) requests rw sage_conf $(and $(or $(findstring yes,$(SAGE_WHEELS)),$(findstring no,$(SAGE_EDITABLE))), sagemath_objects sagemath_categories sagemath_environment sagemath_repl) singular symmetrica $(PCFILES) | $(PYTHON_TOOLCHAIN) python_build sage_setup ---------- All lines of this file are ignored except the first. From ddc37722fce79fa7665ff24f879a5d212e8c2038 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 25 Feb 2023 00:19:34 -0800 Subject: [PATCH 11/14] pkgs/sagemath-standard/setup.cfg.m4: Do not install scripts installed by modularized distributions --- pkgs/sagemath-standard/setup.cfg.m4 | 48 ++++++++++++++--------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/pkgs/sagemath-standard/setup.cfg.m4 b/pkgs/sagemath-standard/setup.cfg.m4 index b66c0a51932..868ac5174d2 100644 --- a/pkgs/sagemath-standard/setup.cfg.m4 +++ b/pkgs/sagemath-standard/setup.cfg.m4 @@ -83,48 +83,48 @@ dnl Packages with important upper version bounds scripts = # The sage script - bin/sage + # bin/sage -- installed by sagemath-environment # Other scripts that should be in the path also for OS packaging of sage: - bin/sage-eval + # bin/sage-eval -- installed by sagemath-repl # Included because it is useful for doctesting/coverage testing user scripts too: - bin/sage-runtests - bin/sage-fixdoctests - bin/sage-coverage + # bin/sage-runtests -- installed by sagemath-repl + # bin/sage-fixdoctests -- installed by sagemath-repl + # bin/sage-coverage -- installed by sagemath-repl # The following is deprecated but might still be used in user package install scripts bin/sage-cython # Helper scripts invoked by sage script # (they would actually belong to something like libexec) - bin/sage-cachegrind - bin/sage-callgrind - bin/sage-massif - bin/sage-omega - bin/sage-valgrind - bin/sage-venv-config - bin/sage-version.sh - bin/sage-cleaner + # bin/sage-cachegrind -- installed by sagemath-repl + # bin/sage-callgrind -- installed by sagemath-repl + # bin/sage-massif -- installed by sagemath-repl + # bin/sage-omega -- installed by sagemath-repl + # bin/sage-valgrind -- installed by sagemath-repl + # bin/sage-venv-config -- installed by sagemath-environment + # bin/sage-version.sh -- installed by sagemath-environment + # bin/sage-cleaner -- installed by sagemath-repl # Only makes sense in sage-the-distribution. TODO: Move to another installation script. bin/sage-list-packages # Uncategorized scripts in alphabetical order bin/math-readline - bin/sage-env + # bin/sage-env -- installed by sagemath-environment # sage-env-config -- installed by sage_conf # sage-env-config.in -- not to be installed bin/sage-grep bin/sage-grepdoc - bin/sage-inline-fortran - bin/sage-ipynb2rst - bin/sage-ipython - bin/sage-notebook - bin/sage-num-threads.py - bin/sage-preparse - bin/sage-python + # bin/sage-inline-fortran -- installed by sagemath-repl + # bin/sage-ipynb2rst -- installed by sagemath-repl + # bin/sage-ipython -- installed by sagemath-repl + # bin/sage-notebook -- installed by sagemath-repl + # bin/sage-num-threads.py -- installed by sagemath-environment + # bin/sage-preparse -- installed by sagemath-repl + # bin/sage-python -- installed by sagemath-environment bin/sage-rebase.bat bin/sage-rebase.sh bin/sage-rebaseall.bat bin/sage-rebaseall.sh - bin/sage-run - bin/sage-run-cython - bin/sage-startuptime.py + # bin/sage-run -- installed by sagemath-repl + # bin/sage-run-cython -- installed by sagemath-repl + # bin/sage-startuptime.py -- installed by sagemath-repl bin/sage-update-version [options.package_data] From f6dd5c6f14f72aada544f55778f9183fc133cc20 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 25 Feb 2023 00:23:08 -0800 Subject: [PATCH 12/14] pkgs/sagemath-standard/setup.cfg.m4: Do not install package data installed by modularized distributions --- pkgs/sagemath-standard/setup.cfg.m4 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/sagemath-standard/setup.cfg.m4 b/pkgs/sagemath-standard/setup.cfg.m4 index 868ac5174d2..452414c6e1e 100644 --- a/pkgs/sagemath-standard/setup.cfg.m4 +++ b/pkgs/sagemath-standard/setup.cfg.m4 @@ -135,11 +135,11 @@ sage.libs.gap = sage.interfaces = sage-maxima.lisp -sage.doctest = - tests/* +# sage.doctest = -- installed by sagemath-repl +# tests/* -sage.repl.rich_output = - example* +# sage.repl.rich_output = -- installed by sagemath-repl +# example* sage = ext_data/* From c0147556b6cc5c5bbc0627ebbe8c1de314239065 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 25 Feb 2023 00:31:38 -0800 Subject: [PATCH 13/14] pkgs/sagemath-standard/MANIFEST.in: Separate copy of src/MANIFEST.in --- pkgs/sagemath-standard/MANIFEST.in | 86 +++++++++++++++++++++++++++++- src/MANIFEST.in | 31 ----------- 2 files changed, 85 insertions(+), 32 deletions(-) mode change 120000 => 100644 pkgs/sagemath-standard/MANIFEST.in diff --git a/pkgs/sagemath-standard/MANIFEST.in b/pkgs/sagemath-standard/MANIFEST.in deleted file mode 120000 index 00f2f3dd9e9..00000000000 --- a/pkgs/sagemath-standard/MANIFEST.in +++ /dev/null @@ -1 +0,0 @@ -../../src/MANIFEST.in \ No newline at end of file diff --git a/pkgs/sagemath-standard/MANIFEST.in b/pkgs/sagemath-standard/MANIFEST.in new file mode 100644 index 00000000000..bae1935ed27 --- /dev/null +++ b/pkgs/sagemath-standard/MANIFEST.in @@ -0,0 +1,85 @@ +include VERSION.txt + +global-include *.pxi *.pxd *.h *.hpp + +prune sage/ext/interpreters # In particular, __init__.py must not be present in the distribution; or sage_setup.autogen.interpreters.rebuild will not generate the code +prune sage_setup +prune sage_docbuild +prune doc + +# +# Most C and C++ files are generated by Cython and should not +# be included in the sdist. +# +global-exclude *.c +global-exclude *.cpp + +# +# List of C and C++ files that are actual source files, +# NOT generated by Cython. The same list appears in SAGE_ROOT/.gitignore +# +include sage/cpython/debugimpl.c +include sage/graphs/base/boost_interface.cpp +include sage/graphs/cliquer/cl.c +include sage/graphs/graph_decompositions/sage_tdlib.cpp +include sage/libs/eclib/wrap.cpp +include sage/libs/linkages/padics/relaxed/flint_helper.c +include sage/misc/inherit_comparison_impl.c +include sage/modular/arithgroup/farey.cpp +include sage/modular/arithgroup/sl2z.cpp +include sage/rings/bernmm/bern_modp.cpp +include sage/rings/bernmm/bern_modp_util.cpp +include sage/rings/bernmm/bern_rat.cpp +include sage/rings/bernmm/bernmm-test.cpp +include sage/rings/padics/transcendantal.c +include sage/rings/polynomial/weil/power_sums.c +include sage/schemes/hyperelliptic_curves/hypellfrob/hypellfrob.cpp +include sage/schemes/hyperelliptic_curves/hypellfrob/recurrences_ntl.cpp +include sage/stats/distributions/dgs_bern.c +include sage/stats/distributions/dgs_gauss_dp.c +include sage/stats/distributions/dgs_gauss_mp.c +include sage/symbolic/ginac/*.cpp +# Also actual C++ source files. +include sage/geometry/triangulation/triangulations.cc +include sage/geometry/triangulation/data.cc +include sage/geometry/triangulation/functions.cc + +# Exclude what is already shipped in sagemath-objects, sagemath-categories, sagemath-environment, sagemath-repl +global-exclude all__*.py +prune sage/misc +include sage/misc/all.py +include sage/misc/allocator.pxd +include sage/misc/allocator.pyx +include sage/misc/binary_tree.pxd +include sage/misc/binary_tree.pyx +include sage/misc/search.pxd +include sage/misc/search.pyx +# Exclude what is shipped in sagemath-objects +prune sage/cpython +prune sage/structure +prune sage/libs/gmp +# Exclude what is shipped in sagemath-categories +prune sage/categories +exclude sage/rings/ideal.* +exclude sage/rings/ring.* +prune sage/typeset +# Exclude what is shipped in sagemath-environment +exclude sage/env.py +exclude sage/version.py +prune sage/features +# Exclude what is shipped in sagemath-repl +prune sage/doctest +prune sage/repl +exclude sage/misc/banner.py +exclude sage/misc/sagedoc.py +exclude sage/misc/sage_input.py +exclude sage/misc/sage_eval.py + +global-exclude __pycache__ +global-exclude *.py[co] +global-exclude *.bak +global-exclude *.so +global-exclude *~ +prune .tox +prune build +prune dist diff --git a/src/MANIFEST.in b/src/MANIFEST.in index bae1935ed27..1e7df6e529b 100644 --- a/src/MANIFEST.in +++ b/src/MANIFEST.in @@ -44,37 +44,6 @@ include sage/geometry/triangulation/triangulations.cc include sage/geometry/triangulation/data.cc include sage/geometry/triangulation/functions.cc -# Exclude what is already shipped in sagemath-objects, sagemath-categories, sagemath-environment, sagemath-repl -global-exclude all__*.py -prune sage/misc -include sage/misc/all.py -include sage/misc/allocator.pxd -include sage/misc/allocator.pyx -include sage/misc/binary_tree.pxd -include sage/misc/binary_tree.pyx -include sage/misc/search.pxd -include sage/misc/search.pyx -# Exclude what is shipped in sagemath-objects -prune sage/cpython -prune sage/structure -prune sage/libs/gmp -# Exclude what is shipped in sagemath-categories -prune sage/categories -exclude sage/rings/ideal.* -exclude sage/rings/ring.* -prune sage/typeset -# Exclude what is shipped in sagemath-environment -exclude sage/env.py -exclude sage/version.py -prune sage/features -# Exclude what is shipped in sagemath-repl -prune sage/doctest -prune sage/repl -exclude sage/misc/banner.py -exclude sage/misc/sagedoc.py -exclude sage/misc/sage_input.py -exclude sage/misc/sage_eval.py - global-exclude __pycache__ global-exclude *.py[co] global-exclude *.bak From 09bfd32bac21b55aa8e800660cfc275c170e1501 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 25 Feb 2023 00:58:03 -0800 Subject: [PATCH 14/14] build/pkgs/sagelib/spkg-install [SAGE_EDITABLE=yes, SAGE_WHEEL=yes]: Use 'build' to build the wheel --- build/pkgs/sagelib/spkg-install | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/build/pkgs/sagelib/spkg-install b/build/pkgs/sagelib/spkg-install index 385caaba695..328f2399dd5 100755 --- a/build/pkgs/sagelib/spkg-install +++ b/build/pkgs/sagelib/spkg-install @@ -65,7 +65,10 @@ if [ "$SAGE_EDITABLE" = yes ]; then if [ "$SAGE_WHEELS" = yes ]; then # Additionally build a wheel (for use in other venvs) - cd $SAGE_PKGS/sagelib/src && time sdh_setup_bdist_wheel && sdh_store_wheel . + cd $SAGE_PKGS/sagelib/src + DIST_DIR="$(mktemp -d)" + python3 -m build --no-isolation --outdir "$DIST_DIR"/dist . || sdh_die "Failure building sdist and wheel" + wheel=$(cd "$DIST_DIR" && sdh_store_and_pip_install_wheel . && echo $wheel) fi else # Make sure that an installed old version of sagelib in which sage is an ordinary package