From 12f6ef88f3567ff07c96ac904f9bfe8807485da4 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sun, 10 Sep 2023 17:41:17 -0700 Subject: [PATCH 1/5] bootstrap: Use 'ENABLE_SYSTEM_SITE_PACKAGES=yes sage-get-system-packages install-requires' --- bootstrap | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bootstrap b/bootstrap index 5156f369c38..aa5755cfc63 100755 --- a/bootstrap +++ b/bootstrap @@ -98,8 +98,8 @@ SAGE_SPKG_CONFIGURE_$(echo ${pkgname} | tr '[a-z]' '[A-Z]')" if test -f "$DIR/requirements.txt" -o -f "$DIR/install-requires.txt"; then # A Python package SPKG_TREE_VAR=SAGE_VENV - echo "define(>>>SPKG_INSTALL_REQUIRES_${pkgname}<<<, >>>$(echo $(sage-get-system-packages install-requires ${pkgname}))<<<)dnl" >> m4/sage_spkg_versions.m4 - echo "define(>>>SPKG_INSTALL_REQUIRES_${pkgname}<<<, >>>$(echo $(sage-get-system-packages install-requires-toml ${pkgname}))<<<)dnl" >> m4/sage_spkg_versions_toml.m4 + echo "define(>>>SPKG_INSTALL_REQUIRES_${pkgname}<<<, >>>$(echo $(ENABLE_SYSTEM_SITE_PACKAGES=yes sage-get-system-packages install-requires ${pkgname}))<<<)dnl" >> m4/sage_spkg_versions.m4 + echo "define(>>>SPKG_INSTALL_REQUIRES_${pkgname}<<<, >>>$(echo $(ENABLE_SYSTEM_SITE_PACKAGES=yes sage-get-system-packages install-requires-toml ${pkgname}))<<<)dnl" >> m4/sage_spkg_versions_toml.m4 fi fi spkg_configures="$spkg_configures From ca94eb498d2af3eecca05296304bf9040054d6b2 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sun, 3 Sep 2023 10:07:17 -0700 Subject: [PATCH 2/5] MPowerSeries.exp: Don't use symbolics to compute exp(0) --- src/sage/rings/multi_power_series_ring_element.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/sage/rings/multi_power_series_ring_element.py b/src/sage/rings/multi_power_series_ring_element.py index 2a5c4261800..427ce4ed96f 100644 --- a/src/sage/rings/multi_power_series_ring_element.py +++ b/src/sage/rings/multi_power_series_ring_element.py @@ -1944,9 +1944,12 @@ def exp(self, prec=infinity): R = self.parent() Rbg = R._bg_power_series_ring - from sage.functions.log import exp c = self.constant_coefficient() - exp_c = exp(c) + if not c: + exp_c = self.base_ring().one() + else: + from sage.functions.log import exp + exp_c = exp(c) x = self._bg_value - c if x.is_zero(): return exp_c From eded0e7d20bc3b90efd53a382ee72041943c0f00 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sun, 3 Sep 2023 10:44:53 -0700 Subject: [PATCH 3/5] MPowerSeries.log: Don't use symbolics to compute log(1) --- src/sage/rings/multi_power_series_ring_element.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/sage/rings/multi_power_series_ring_element.py b/src/sage/rings/multi_power_series_ring_element.py index 427ce4ed96f..e116254dd9a 100644 --- a/src/sage/rings/multi_power_series_ring_element.py +++ b/src/sage/rings/multi_power_series_ring_element.py @@ -1910,7 +1910,7 @@ def exp(self, prec=infinity): are not yet implemented and therefore such cases raise an error:: sage: g = 2 + f - sage: exp(g) + sage: exp(g) # needs sage.symbolic Traceback (most recent call last): ... TypeError: unsupported operand parent(s) for *: 'Symbolic Ring' and @@ -1920,7 +1920,7 @@ def exp(self, prec=infinity): Another workaround for this limitation is to change base ring to one which is closed under exponentiation, such as `\RR` or `\CC`:: - sage: exp(g.change_ring(RDF)) + sage: exp(g.change_ring(RDF)) # needs sage.symbolic 7.38905609... + 7.38905609...*a + 7.38905609...*b + 3.69452804...*a^2 + 14.7781121...*a*b + 3.69452804...*b^2 + O(a, b)^3 @@ -2003,7 +2003,7 @@ def log(self, prec=infinity): are not yet implemented and therefore such cases raise an error:: sage: g = 2 + f - sage: log(g) + sage: log(g) # needs sage.symbolic Traceback (most recent call last): ... TypeError: unsupported operand parent(s) for -: 'Symbolic Ring' and 'Power @@ -2012,7 +2012,7 @@ def log(self, prec=infinity): Another workaround for this limitation is to change base ring to one which is closed under exponentiation, such as `\RR` or `\CC`:: - sage: log(g.change_ring(RDF)) + sage: log(g.change_ring(RDF)) # needs sage.symbolic 1.09861228... + 0.333333333...*a + 0.333333333...*b - 0.0555555555...*a^2 + 0.222222222...*a*b - 0.0555555555...*b^2 + 0.0123456790...*a^3 - 0.0740740740...*a^2*b - 0.0740740740...*a*b^2 + 0.0123456790...*b^3 @@ -2039,11 +2039,14 @@ def log(self, prec=infinity): R = self.parent() Rbg = R._bg_power_series_ring - from sage.functions.log import log c = self.constant_coefficient() if c.is_zero(): raise ValueError('Can only take formal power series for non-zero constant term.') - log_c = log(c) + if c.is_one(): + log_c = self.base_ring().zero() + else: + from sage.functions.log import log + log_c = log(c) x = 1 - self._bg_value/c if x.is_zero(): return log_c From 0785206ee752d10d1e4774d7e5feb04d84624aca Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Wed, 13 Sep 2023 11:56:15 -0700 Subject: [PATCH 4/5] Update pyproject.toml files to use version info from build/pkgs/setuptools_wheel, not the ancient build/pkgs/setuptools --- build/pkgs/setuptools_wheel/install-requires.txt | 2 +- pkgs/sagemath-bliss/pyproject.toml.m4 | 2 +- pkgs/sagemath-categories/pyproject.toml.m4 | 2 +- pkgs/sagemath-coxeter3/pyproject.toml.m4 | 2 +- pkgs/sagemath-environment/pyproject.toml.m4 | 2 +- pkgs/sagemath-mcqd/pyproject.toml.m4 | 2 +- pkgs/sagemath-meataxe/pyproject.toml.m4 | 2 +- pkgs/sagemath-objects/pyproject.toml.m4 | 2 +- pkgs/sagemath-repl/pyproject.toml.m4 | 2 +- pkgs/sagemath-sirocco/pyproject.toml.m4 | 2 +- pkgs/sagemath-tdlib/pyproject.toml.m4 | 2 +- src/pyproject.toml.m4 | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/build/pkgs/setuptools_wheel/install-requires.txt b/build/pkgs/setuptools_wheel/install-requires.txt index d1dc532ceab..d3767a68c8f 100644 --- a/build/pkgs/setuptools_wheel/install-requires.txt +++ b/build/pkgs/setuptools_wheel/install-requires.txt @@ -1 +1 @@ -# We use this file to mark the package as a Python package +setuptools >= 65.6 diff --git a/pkgs/sagemath-bliss/pyproject.toml.m4 b/pkgs/sagemath-bliss/pyproject.toml.m4 index 439482ad26b..1cbcdf7e162 100644 --- a/pkgs/sagemath-bliss/pyproject.toml.m4 +++ b/pkgs/sagemath-bliss/pyproject.toml.m4 @@ -2,7 +2,7 @@ include(`sage_spkg_versions_toml.m4')dnl' -*- conf-toml -*- [build-system] # Minimum requirements for the build system to execute. requires = [ - SPKG_INSTALL_REQUIRES_setuptools + SPKG_INSTALL_REQUIRES_setuptools_wheel SPKG_INSTALL_REQUIRES_sage_conf SPKG_INSTALL_REQUIRES_sage_setup SPKG_INSTALL_REQUIRES_sagemath_environment diff --git a/pkgs/sagemath-categories/pyproject.toml.m4 b/pkgs/sagemath-categories/pyproject.toml.m4 index 6ce29ddcb71..cf4c97f1fd1 100644 --- a/pkgs/sagemath-categories/pyproject.toml.m4 +++ b/pkgs/sagemath-categories/pyproject.toml.m4 @@ -2,7 +2,7 @@ include(`sage_spkg_versions_toml.m4')dnl' -*- conf-toml -*- [build-system] # Minimum requirements for the build system to execute. requires = [ - SPKG_INSTALL_REQUIRES_setuptools + SPKG_INSTALL_REQUIRES_setuptools_wheel SPKG_INSTALL_REQUIRES_wheel SPKG_INSTALL_REQUIRES_sage_setup SPKG_INSTALL_REQUIRES_sagemath_environment diff --git a/pkgs/sagemath-coxeter3/pyproject.toml.m4 b/pkgs/sagemath-coxeter3/pyproject.toml.m4 index e5b939e414d..a7d65382b21 100644 --- a/pkgs/sagemath-coxeter3/pyproject.toml.m4 +++ b/pkgs/sagemath-coxeter3/pyproject.toml.m4 @@ -2,7 +2,7 @@ include(`sage_spkg_versions_toml.m4')dnl' -*- conf-toml -*- [build-system] # Minimum requirements for the build system to execute. requires = [ - SPKG_INSTALL_REQUIRES_setuptools + SPKG_INSTALL_REQUIRES_setuptools_wheel SPKG_INSTALL_REQUIRES_sage_setup SPKG_INSTALL_REQUIRES_sagemath_environment SPKG_INSTALL_REQUIRES_cython diff --git a/pkgs/sagemath-environment/pyproject.toml.m4 b/pkgs/sagemath-environment/pyproject.toml.m4 index 7f62a86cd69..fb2db955ed5 100644 --- a/pkgs/sagemath-environment/pyproject.toml.m4 +++ b/pkgs/sagemath-environment/pyproject.toml.m4 @@ -2,7 +2,7 @@ include(`sage_spkg_versions_toml.m4')dnl' -*- conf-toml -*- [build-system] # Minimum requirements for the build system to execute. requires = [ - SPKG_INSTALL_REQUIRES_setuptools + SPKG_INSTALL_REQUIRES_setuptools_wheel SPKG_INSTALL_REQUIRES_wheel ] build-backend = "setuptools.build_meta" diff --git a/pkgs/sagemath-mcqd/pyproject.toml.m4 b/pkgs/sagemath-mcqd/pyproject.toml.m4 index d28ff179a00..7e651119193 100644 --- a/pkgs/sagemath-mcqd/pyproject.toml.m4 +++ b/pkgs/sagemath-mcqd/pyproject.toml.m4 @@ -2,7 +2,7 @@ include(`sage_spkg_versions_toml.m4')dnl' -*- conf-toml -*- [build-system] # Minimum requirements for the build system to execute. requires = [ - SPKG_INSTALL_REQUIRES_setuptools + SPKG_INSTALL_REQUIRES_setuptools_wheel SPKG_INSTALL_REQUIRES_sage_setup SPKG_INSTALL_REQUIRES_sagemath_environment SPKG_INSTALL_REQUIRES_cython diff --git a/pkgs/sagemath-meataxe/pyproject.toml.m4 b/pkgs/sagemath-meataxe/pyproject.toml.m4 index e5b939e414d..a7d65382b21 100644 --- a/pkgs/sagemath-meataxe/pyproject.toml.m4 +++ b/pkgs/sagemath-meataxe/pyproject.toml.m4 @@ -2,7 +2,7 @@ include(`sage_spkg_versions_toml.m4')dnl' -*- conf-toml -*- [build-system] # Minimum requirements for the build system to execute. requires = [ - SPKG_INSTALL_REQUIRES_setuptools + SPKG_INSTALL_REQUIRES_setuptools_wheel SPKG_INSTALL_REQUIRES_sage_setup SPKG_INSTALL_REQUIRES_sagemath_environment SPKG_INSTALL_REQUIRES_cython diff --git a/pkgs/sagemath-objects/pyproject.toml.m4 b/pkgs/sagemath-objects/pyproject.toml.m4 index 0c5558f3412..d8fda57a8f8 100644 --- a/pkgs/sagemath-objects/pyproject.toml.m4 +++ b/pkgs/sagemath-objects/pyproject.toml.m4 @@ -2,7 +2,7 @@ include(`sage_spkg_versions_toml.m4')dnl' -*- conf-toml -*- [build-system] # Minimum requirements for the build system to execute. requires = [ - SPKG_INSTALL_REQUIRES_setuptools + SPKG_INSTALL_REQUIRES_setuptools_wheel SPKG_INSTALL_REQUIRES_wheel SPKG_INSTALL_REQUIRES_sage_setup SPKG_INSTALL_REQUIRES_sagemath_environment diff --git a/pkgs/sagemath-repl/pyproject.toml.m4 b/pkgs/sagemath-repl/pyproject.toml.m4 index 7f62a86cd69..fb2db955ed5 100644 --- a/pkgs/sagemath-repl/pyproject.toml.m4 +++ b/pkgs/sagemath-repl/pyproject.toml.m4 @@ -2,7 +2,7 @@ include(`sage_spkg_versions_toml.m4')dnl' -*- conf-toml -*- [build-system] # Minimum requirements for the build system to execute. requires = [ - SPKG_INSTALL_REQUIRES_setuptools + SPKG_INSTALL_REQUIRES_setuptools_wheel SPKG_INSTALL_REQUIRES_wheel ] build-backend = "setuptools.build_meta" diff --git a/pkgs/sagemath-sirocco/pyproject.toml.m4 b/pkgs/sagemath-sirocco/pyproject.toml.m4 index 1b000bd5c3b..99894dd5e5e 100644 --- a/pkgs/sagemath-sirocco/pyproject.toml.m4 +++ b/pkgs/sagemath-sirocco/pyproject.toml.m4 @@ -2,7 +2,7 @@ include(`sage_spkg_versions_toml.m4')dnl' -*- conf-toml -*- [build-system] # Minimum requirements for the build system to execute. requires = [ - SPKG_INSTALL_REQUIRES_setuptools + SPKG_INSTALL_REQUIRES_setuptools_wheel SPKG_INSTALL_REQUIRES_sage_setup SPKG_INSTALL_REQUIRES_sagemath_environment SPKG_INSTALL_REQUIRES_cython diff --git a/pkgs/sagemath-tdlib/pyproject.toml.m4 b/pkgs/sagemath-tdlib/pyproject.toml.m4 index e5b939e414d..a7d65382b21 100644 --- a/pkgs/sagemath-tdlib/pyproject.toml.m4 +++ b/pkgs/sagemath-tdlib/pyproject.toml.m4 @@ -2,7 +2,7 @@ include(`sage_spkg_versions_toml.m4')dnl' -*- conf-toml -*- [build-system] # Minimum requirements for the build system to execute. requires = [ - SPKG_INSTALL_REQUIRES_setuptools + SPKG_INSTALL_REQUIRES_setuptools_wheel SPKG_INSTALL_REQUIRES_sage_setup SPKG_INSTALL_REQUIRES_sagemath_environment SPKG_INSTALL_REQUIRES_cython diff --git a/src/pyproject.toml.m4 b/src/pyproject.toml.m4 index 56f1b2b03ab..f707b6f890e 100644 --- a/src/pyproject.toml.m4 +++ b/src/pyproject.toml.m4 @@ -6,7 +6,7 @@ requires = [ # https://github.com/pypa/pip/issues/6144 esyscmd(`sage-get-system-packages install-requires-toml \ sage_conf \ - setuptools \ + setuptools_wheel \ wheel \ sage_setup \ cypari \ From 7dde1297f33336cd4dcbbd632b950aa5474b854c Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Wed, 13 Sep 2023 12:43:59 -0700 Subject: [PATCH 5/5] ./sage -fixdoctests --long --distribution 'sagemath-polyhedra[standard]' --probe sage.symbolic --only-tags src/sage/rings/multi_power_series_ring_element.py --- src/sage/rings/multi_power_series_ring_element.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sage/rings/multi_power_series_ring_element.py b/src/sage/rings/multi_power_series_ring_element.py index e116254dd9a..bd6fbde6247 100644 --- a/src/sage/rings/multi_power_series_ring_element.py +++ b/src/sage/rings/multi_power_series_ring_element.py @@ -1920,7 +1920,7 @@ def exp(self, prec=infinity): Another workaround for this limitation is to change base ring to one which is closed under exponentiation, such as `\RR` or `\CC`:: - sage: exp(g.change_ring(RDF)) # needs sage.symbolic + sage: exp(g.change_ring(RDF)) 7.38905609... + 7.38905609...*a + 7.38905609...*b + 3.69452804...*a^2 + 14.7781121...*a*b + 3.69452804...*b^2 + O(a, b)^3 @@ -2012,7 +2012,7 @@ def log(self, prec=infinity): Another workaround for this limitation is to change base ring to one which is closed under exponentiation, such as `\RR` or `\CC`:: - sage: log(g.change_ring(RDF)) # needs sage.symbolic + sage: log(g.change_ring(RDF)) 1.09861228... + 0.333333333...*a + 0.333333333...*b - 0.0555555555...*a^2 + 0.222222222...*a*b - 0.0555555555...*b^2 + 0.0123456790...*a^3 - 0.0740740740...*a^2*b - 0.0740740740...*a*b^2 + 0.0123456790...*b^3