From a6459cb69f705101f66ee8adb7ca1b543c6fc291 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Thu, 24 Sep 2020 13:57:34 -0700 Subject: [PATCH 001/145] build/bin/sage-spkg: For script packages, do not poison the proxy variables --- build/bin/sage-spkg | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/build/bin/sage-spkg b/build/bin/sage-spkg index b540c8e866f..e40e5434872 100755 --- a/build/bin/sage-spkg +++ b/build/bin/sage-spkg @@ -578,11 +578,14 @@ echo "****************************************************" ################################################################## # Poison the proxy variable to forbid downloads in spkg-install +# for normal packages ################################################################## -export http_proxy=http://192.0.2.0:5187/ -export https_proxy=$http_proxy -export ftp_proxy=$http_proxy -export rsync_proxy=$http_proxy +if [ -f checksums.ini ]; then + export http_proxy=http://192.0.2.0:5187/ + export https_proxy=$http_proxy + export ftp_proxy=$http_proxy + export rsync_proxy=$http_proxy +fi ################################################################## # We need to run sage-rebase.sh for each package installed, but it From c207a876f2904708d5a56bd35ef5e32300c84d81 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Thu, 24 Sep 2020 15:30:56 -0700 Subject: [PATCH 002/145] build/bin/sage-spkg: Exit with error for some old-style script invocations --- build/bin/sage-spkg | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/build/bin/sage-spkg b/build/bin/sage-spkg index e40e5434872..dbc27e5d5c9 100755 --- a/build/bin/sage-spkg +++ b/build/bin/sage-spkg @@ -302,6 +302,10 @@ export SAGE_SPKG_WHEELS="$SAGE_INST_LOCAL/var/lib/sage/wheels" # in upstream. PKG_VER="${PKG_NAME#${PKG_BASE}}" PKG_VER="${PKG_VER#-}" +if [ -n "$PKG_VER" ]; then + echo >&2 "Error: Selecting a different version of a package is no longer supported" + exit 1 +fi PKG_SCRIPTS="$SAGE_ROOT/build/pkgs/$PKG_BASE" LOCAL_PKG_VER=`cat $PKG_SCRIPTS/package-version.txt 2>/dev/null` PKG_VER="$LOCAL_PKG_VER" @@ -349,25 +353,19 @@ if [ $INFO -ne 0 ]; then exec sage-spkg-info $PKG_BASE fi -# If we haven't found the package yet, we must download it -if [ ! -f "$PKG_SRC" ]; then - if [ -n "$PKG_NAME_UPSTREAM" ]; then - # This is the new-style package way of downloading the tarball - if ! sage-download-file $SAGE_DOWNLOAD_FILE_OPTIONS "$PKG_NAME_UPSTREAM"; then - error_msg "Error downloading $PKG_NAME_UPSTREAM" - exit 1 - fi - PKG_SRC="$SAGE_DISTFILES/$PKG_NAME_UPSTREAM" - else - echo >&2 "Error: Installing old-style SPKGs is no longer supported" +if [ -n "$PKG_NAME_UPSTREAM" ]; then + # Normal package + if ! sage-download-file $SAGE_DOWNLOAD_FILE_OPTIONS "$PKG_NAME_UPSTREAM"; then + error_msg "Error downloading $PKG_NAME_UPSTREAM" exit 1 fi fi +PKG_SRC="$SAGE_DISTFILES/$PKG_NAME_UPSTREAM" # Do a final check that PKG_SRC is a file with an absolute path cd / -if [ ! -f "$PKG_SRC" ]; then - echo >&2 "Error: spkg file '$PKG_SRC' not found." +if [ ! -d "$PKG_SRC" ]; then + echo >&2 "Error: spkg directory '$PKG_SRC' not found." echo >&2 "This shouldn't happen, it is a bug in the sage-spkg script." exit 1 fi From d9475906561f0ad9d8c3d96f029763a3887917e8 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Thu, 24 Sep 2020 15:32:09 -0700 Subject: [PATCH 003/145] build/bin/sage-spkg: Remove error message when checksums.ini does not exist (script package) --- build/bin/sage-spkg | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/build/bin/sage-spkg b/build/bin/sage-spkg index dbc27e5d5c9..813a0d4b11d 100755 --- a/build/bin/sage-spkg +++ b/build/bin/sage-spkg @@ -315,7 +315,10 @@ else PKG_NAME="${PKG_BASE}-${PKG_VER}" fi PKG_BASE_VER=`echo $PKG_VER | sed 's/\.p[0-9][0-9]*$//'` -PKG_NAME_UPSTREAM=`lookup_param tarball "$PKG_SCRIPTS/checksums.ini" | sed "s/VERSION/$PKG_BASE_VER/"` +if [ -f "$PKG_SCRIPTS/checksums.ini" ]; then + # Normal package + PKG_NAME_UPSTREAM=`lookup_param tarball "$PKG_SCRIPTS/checksums.ini" | sed "s/VERSION/$PKG_BASE_VER/"` +fi # Warning for experimental packages if [ x`cat "$PKG_SCRIPTS/type"` = x"experimental" -a $INFO = 0 ]; then From 699c23acb25918d3017f240a1da9286f0136ee04 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Tue, 21 Nov 2023 20:01:51 -0800 Subject: [PATCH 004/145] build/bin/sage-spkg: Fix up for normal and script packages --- build/bin/sage-spkg | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/build/bin/sage-spkg b/build/bin/sage-spkg index 813a0d4b11d..04621d61dc1 100755 --- a/build/bin/sage-spkg +++ b/build/bin/sage-spkg @@ -302,13 +302,13 @@ export SAGE_SPKG_WHEELS="$SAGE_INST_LOCAL/var/lib/sage/wheels" # in upstream. PKG_VER="${PKG_NAME#${PKG_BASE}}" PKG_VER="${PKG_VER#-}" -if [ -n "$PKG_VER" ]; then - echo >&2 "Error: Selecting a different version of a package is no longer supported" - exit 1 -fi PKG_SCRIPTS="$SAGE_ROOT/build/pkgs/$PKG_BASE" LOCAL_PKG_VER=`cat $PKG_SCRIPTS/package-version.txt 2>/dev/null` PKG_VER="$LOCAL_PKG_VER" +if [ -n "$PKG_VER" -a "$PKG_VER" != "$LOCAL_PKG_VER" ]; then + echo >&2 "Error: Selecting a different version of a package is no longer supported" + exit 1 +fi if [ -z "$PKG_VER" ]; then PKG_NAME="${PKG_BASE}" else @@ -362,15 +362,15 @@ if [ -n "$PKG_NAME_UPSTREAM" ]; then error_msg "Error downloading $PKG_NAME_UPSTREAM" exit 1 fi -fi -PKG_SRC="$SAGE_DISTFILES/$PKG_NAME_UPSTREAM" + PKG_SRC="$SAGE_DISTFILES/$PKG_NAME_UPSTREAM" -# Do a final check that PKG_SRC is a file with an absolute path -cd / -if [ ! -d "$PKG_SRC" ]; then - echo >&2 "Error: spkg directory '$PKG_SRC' not found." - echo >&2 "This shouldn't happen, it is a bug in the sage-spkg script." - exit 1 + # Do a final check that PKG_SRC is a file with an absolute path + cd / + if [ ! -f "$PKG_SRC" ]; then + echo >&2 "Error: spkg file '$PKG_SRC' not found." + echo >&2 "This shouldn't happen, it is a bug in the sage-spkg script." + exit 1 + fi fi # Go back to SAGE_ROOT where we have less chance of completely messing @@ -453,6 +453,9 @@ cp -RLp "$PKG_SCRIPTS" "$PKG_NAME" cd "$PKG_NAME" || exit $? case "$PKG_SRC" in + "") + # Not a normal or wheel package + ;; *.whl) # (Platform-independent) wheel # Do not extract, do not create a src directory, @@ -581,7 +584,8 @@ echo "****************************************************" # Poison the proxy variable to forbid downloads in spkg-install # for normal packages ################################################################## -if [ -f checksums.ini ]; then +if [ -n "$PKG_NAME_UPSTREAM" ]; then + # Normal package export http_proxy=http://192.0.2.0:5187/ export https_proxy=$http_proxy export ftp_proxy=$http_proxy From 6be9ba045dd2654cb32c82c836425fce3b0f9af8 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Thu, 24 Sep 2020 16:17:08 -0700 Subject: [PATCH 005/145] build/bin/sage-spkg: Handle script packages without package-version.txt --- build/bin/sage-spkg | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/build/bin/sage-spkg b/build/bin/sage-spkg index 04621d61dc1..081a500d63b 100755 --- a/build/bin/sage-spkg +++ b/build/bin/sage-spkg @@ -297,13 +297,11 @@ export SAGE_SPKG_SCRIPTS="$SAGE_INST_LOCAL/var/lib/sage/scripts" export SAGE_SPKG_WHEELS="$SAGE_INST_LOCAL/var/lib/sage/wheels" # PKG_SRC should look like "package-VERSION" or just "package". -# If VERSION matches the version in build/pkgs or there is no version -# specified, use the local scripts; otherwise we try to find a package -# in upstream. +# VERSION, if provided, must match the version in build/pkgs. PKG_VER="${PKG_NAME#${PKG_BASE}}" PKG_VER="${PKG_VER#-}" PKG_SCRIPTS="$SAGE_ROOT/build/pkgs/$PKG_BASE" -LOCAL_PKG_VER=`cat $PKG_SCRIPTS/package-version.txt 2>/dev/null` +LOCAL_PKG_VER=`cat $PKG_SCRIPTS/package-version.txt 2>/dev/null || echo none` PKG_VER="$LOCAL_PKG_VER" if [ -n "$PKG_VER" -a "$PKG_VER" != "$LOCAL_PKG_VER" ]; then echo >&2 "Error: Selecting a different version of a package is no longer supported" From c69a62bf9978fedd6ba950e1d805a261a7df48de Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Tue, 21 Nov 2023 20:54:13 -0800 Subject: [PATCH 006/145] m4/sage_spkg_collect.m4: Update documentation on package source types --- m4/sage_spkg_collect.m4 | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/m4/sage_spkg_collect.m4 b/m4/sage_spkg_collect.m4 index d52dc6205ee..0ceb34a76eb 100644 --- a/m4/sage_spkg_collect.m4 +++ b/m4/sage_spkg_collect.m4 @@ -38,18 +38,15 @@ # of which is the names of the dependencies of as read # from the build//dependencies file. # -# - SAGE_NORMAL_PACKAGES - lists the names of packages that are installed -# by the "normal" method (using the sage-spkg program to download and -# extract the source tarball, and run the relevant scripts from -# build//spkg-*. +# - SAGE_NORMAL_PACKAGES - lists the names of packages that are of source type +# "normal" or "wheel". # -# - SAGE_PIP_PACKAGES - lists the names of packages with the "pip" type +# - SAGE_PIP_PACKAGES - lists the names of packages with the "pip" source type, # which are installed by directly invoking the pip command. # # - SAGE_SCRIPT_PACKAGES - lists the names of packages with the "script" -# type which are installed by running a custom script, which may -# download additional source files. -# +# source type, which are installed by running a custom script, which may +# download additional source files, and the "dummy" source type. dnl ========================================================================== dnl define PKG_CHECK_VAR for old pkg-config < 0.28; see Trac #29001 From 1c2ba1fdf9a98f6b088fdabec3a6e2442e0d95ba Mon Sep 17 00:00:00 2001 From: Enrique Artal Date: Wed, 22 Nov 2023 12:52:05 +0100 Subject: [PATCH 007/145] allow choices of name of the primitive elment for union of algebraic fields in QQbar --- src/sage/rings/qqbar.py | 44 +++++++++++++++++++++++++---------------- 1 file changed, 27 insertions(+), 17 deletions(-) diff --git a/src/sage/rings/qqbar.py b/src/sage/rings/qqbar.py index 3be8051935c..1965936c695 100644 --- a/src/sage/rings/qqbar.py +++ b/src/sage/rings/qqbar.py @@ -2488,7 +2488,8 @@ def conjugate_shrink(v): return v.real() return v -def number_field_elements_from_algebraics(numbers, minimal=False, same_field=False, embedded=False, prec=53): + +def number_field_elements_from_algebraics(numbers, minimal=False, same_field=False, embedded=False, name='a', prec=53): r""" Given a sequence of elements of either ``AA`` or ``QQbar`` (or a mixture), computes a number field containing all of these @@ -2508,6 +2509,8 @@ def number_field_elements_from_algebraics(numbers, minimal=False, same_field=Fal - ``embedded`` -- Boolean (default: ``False``). Whether to make the NumberField embedded. + - ``name`` -- string (default: ``a``). Name of the primitive element. + - ``prec`` -- integer (default: ``53``). The number of bit of precision to guarantee finding real roots. @@ -2543,12 +2546,12 @@ def number_field_elements_from_algebraics(numbers, minimal=False, same_field=Fal sage: x = polygen(QQ) sage: p = x^3 + x^2 + x + 17 sage: rts = p.roots(ring=QQbar, multiplicities=False) - sage: splitting = number_field_elements_from_algebraics(rts)[0]; splitting - Number Field in a with defining polynomial y^6 - 40*y^4 - 22*y^3 + 873*y^2 + 1386*y + 594 + sage: splitting = number_field_elements_from_algebraics(rts, name='b')[0]; splitting + Number Field in b with defining polynomial y^6 - 40*y^4 - 22*y^3 + 873*y^2 + 1386*y + 594 sage: p.roots(ring=splitting) - [(361/29286*a^5 - 19/3254*a^4 - 14359/29286*a^3 + 401/29286*a^2 + 18183/1627*a + 15930/1627, 1), - (49/117144*a^5 - 179/39048*a^4 - 3247/117144*a^3 + 22553/117144*a^2 + 1744/4881*a - 17195/6508, 1), - (-1493/117144*a^5 + 407/39048*a^4 + 60683/117144*a^3 - 24157/117144*a^2 - 56293/4881*a - 53033/6508, 1)] + [(361/29286*b^5 - 19/3254*b^4 - 14359/29286*b^3 + 401/29286*b^2 + 18183/1627*b + 15930/1627, 1), + (49/117144*b^5 - 179/39048*b^4 - 3247/117144*b^3 + 22553/117144*b^2 + 1744/4881*b - 17195/6508, 1), + (-1493/117144*b^5 + 407/39048*b^4 + 60683/117144*b^3 - 24157/117144*b^2 - 56293/4881*b - 53033/6508, 1)] sage: # needs sage.symbolic sage: rt2 = AA(sqrt(2)); rt2 @@ -2824,7 +2827,7 @@ def mk_algebraic(x): # the number comes from a complex algebraic number field embedded_rt = v.interval_fast(RealIntervalField(prec)) root = ANRoot(v.minpoly(), embedded_rt) - real_nf = NumberField(v.minpoly(),'a') + real_nf = NumberField(v.minpoly(), 'a') new_ef = AlgebraicGenerator(real_nf, root) real_numbers += [new_ef.root_as_algebraic()] else: @@ -2835,7 +2838,7 @@ def mk_algebraic(x): for v in numbers: if minimal: v.simplify() - gen = gen.union(v._exact_field()) + gen = gen.union(v._exact_field(), name=name) fld = gen._field nums = [gen(v._exact_value()) for v in numbers] @@ -2845,7 +2848,7 @@ def mk_algebraic(x): if fld is not QQ and embedded: # creates the embedded field - embedded_field = NumberField(fld.defining_polynomial(),fld.variable_name(),embedding=exact_generator) + embedded_field = NumberField(fld.defining_polynomial(), fld.variable_name(), embedding=exact_generator) # embeds the numbers inter_hom = fld.hom([embedded_field.gen(0)]) @@ -3129,7 +3132,7 @@ def _repr_(self): if self._trivial: return 'Trivial generator' else: - return '%s with a in %s' % (self._field, + return '%s with %s in %s' % (self._field, self._field.gen(), self._root._interval_fast(53)) def root_as_algebraic(self): @@ -3249,11 +3252,18 @@ def _interval_fast(self, prec): """ return self._root._interval_fast(prec) - def union(self, other): - r""" Given generators ``alpha`` and ``beta``, - ``alpha.union(beta)`` gives a generator for the number field + def union(self, other, name='a'): + r""" + Given generators ``self`` (`\alpha`) and ``other``(`\beta`), + ``self.union(other)`` gives a generator for the number field `\QQ[\alpha][\beta]`. + INPUT: + + - ``other`` - an algebraic number. + + - ``name`` - string (default: 'a'). A name for the primitive element. + EXAMPLES:: sage: from sage.rings.qqbar import ANRoot, AlgebraicGenerator, qq_generator @@ -3273,8 +3283,8 @@ def union(self, other): True sage: qq_generator.union(gen3) is gen3 True - sage: gen2.union(gen3) - Number Field in a with defining polynomial y^4 - 4*y^2 + 1 with a in -1.931851652578137? + sage: gen2.union(gen3, name='b') + Number Field in b with defining polynomial y^4 - 4*y^2 + 1 with b in -1.931851652578137? """ if self._trivial: return other @@ -3324,7 +3334,7 @@ def find_fn(p, prec): red_back_x = QQx(red_back) - new_nf = NumberField(red_pol, name='a', check=False) + new_nf = NumberField(red_pol, name=name, check=False) self_pol_sage = QQx(self_pol.lift()) @@ -8765,7 +8775,7 @@ def _init_qqbar(): EXAMPLES:: sage: sage.rings.qqbar.QQbar_I_generator # indirect doctest - Number Field in I with defining polynomial x^2 + 1 with I = 1*I with a in 1*I + Number Field in I with defining polynomial x^2 + 1 with I = 1*I with I in 1*I """ global ZZX_x, AA_0, QQbar_I, AA_hash_offset, QQbar_hash_offset, QQbar_I_generator, QQbar_I_nf global QQ_0, QQ_1, QQ_1_2, QQ_1_4, RR_1_10 From c634a7d6caee41d0867743b4d11d488ca2d7eea0 Mon Sep 17 00:00:00 2001 From: Enrique Artal Date: Wed, 22 Nov 2023 12:56:04 +0100 Subject: [PATCH 008/145] typo --- src/sage/rings/qqbar.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sage/rings/qqbar.py b/src/sage/rings/qqbar.py index 1965936c695..c310064c085 100644 --- a/src/sage/rings/qqbar.py +++ b/src/sage/rings/qqbar.py @@ -3133,7 +3133,7 @@ def _repr_(self): return 'Trivial generator' else: return '%s with %s in %s' % (self._field, self._field.gen(), - self._root._interval_fast(53)) + self._root._interval_fast(53)) def root_as_algebraic(self): r""" From e833622b61bacc8b3f1703f520338bb17b2f199a Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Tue, 21 Nov 2023 22:22:46 -0800 Subject: [PATCH 009/145] build/bin/sage-spkg: More WIP for script packages --- build/bin/sage-spkg | 38 ++++++++++++++++++++++++++------------ 1 file changed, 26 insertions(+), 12 deletions(-) diff --git a/build/bin/sage-spkg b/build/bin/sage-spkg index 081a500d63b..121efa4f057 100755 --- a/build/bin/sage-spkg +++ b/build/bin/sage-spkg @@ -314,7 +314,7 @@ else fi PKG_BASE_VER=`echo $PKG_VER | sed 's/\.p[0-9][0-9]*$//'` if [ -f "$PKG_SCRIPTS/checksums.ini" ]; then - # Normal package + # Normal/wheel package PKG_NAME_UPSTREAM=`lookup_param tarball "$PKG_SCRIPTS/checksums.ini" | sed "s/VERSION/$PKG_BASE_VER/"` fi @@ -355,7 +355,7 @@ if [ $INFO -ne 0 ]; then fi if [ -n "$PKG_NAME_UPSTREAM" ]; then - # Normal package + # Normal or wheel package if ! sage-download-file $SAGE_DOWNLOAD_FILE_OPTIONS "$PKG_NAME_UPSTREAM"; then error_msg "Error downloading $PKG_NAME_UPSTREAM" exit 1 @@ -377,7 +377,7 @@ cd "$SAGE_ROOT" || exit $? # If SAGE_SPKG_COPY_UPSTREAM is set, it should be the name of a directory # to which all upstream files are copied. This is used in sage-sdist. -if [ -n "$SAGE_SPKG_COPY_UPSTREAM" ]; then +if [ -n "$SAGE_SPKG_COPY_UPSTREAM" -a -n "$PKG_NAME_UPSTREAM" ]; then mkdir -p "$SAGE_SPKG_COPY_UPSTREAM" && cp -p "$PKG_SRC" "$SAGE_SPKG_COPY_UPSTREAM" if [ $? -ne 0 ]; then error_msg "Error copying upstream tarball to directory '$SAGE_SPKG_COPY_UPSTREAM'" @@ -447,13 +447,26 @@ fi ################################################################## echo "Setting up build directory for $PKG_NAME" -cp -RLp "$PKG_SCRIPTS" "$PKG_NAME" -cd "$PKG_NAME" || exit $? - -case "$PKG_SRC" in - "") - # Not a normal or wheel package - ;; +if [ -z "$PKG_NAME_UPSTREAM" ]; then + # Not a normal or wheel package. + # Transplant the 'src' symlink, copy scripts. + mkdir -p "$PKG_NAME" + if [ -d "$PKG_SCRIPTS"/src ]; then + ln -s $(cd "$PKG_SCRIPTS"/src && pwd -P) "$PKG_NAME"/src + fi + for a in build install check preinst postinst; do # replace by use of $WRAPPED_SCRIPTS later + if [ -r "$PKG_SCRIPTS"/spkg-$a.in ]; then + cp "$PKG_SCRIPTS"/spkg-$a.in "$PKG_NAME"/ + elif [ -x "$PKG_SCRIPTS"/spkg-$a ]; then + cp "$PKG_SCRIPTS"/spkg-$a "$PKG_NAME"/ + fi + done + cd "$PKG_NAME" || exit $? +else + # Normal or wheel package, copy whole directory, resolving symlinks + cp -RLp "$PKG_SCRIPTS" "$PKG_NAME" + cd "$PKG_NAME" || exit $? + case "$PKG_SRC" in *.whl) # (Platform-independent) wheel # Do not extract, do not create a src directory, @@ -477,7 +490,8 @@ case "$PKG_SRC" in fi cd .. ;; -esac + esac +fi ################################################################## # The package has been extracted, prepare for installation @@ -583,7 +597,7 @@ echo "****************************************************" # for normal packages ################################################################## if [ -n "$PKG_NAME_UPSTREAM" ]; then - # Normal package + # Normal/wheel package export http_proxy=http://192.0.2.0:5187/ export https_proxy=$http_proxy export ftp_proxy=$http_proxy From 836e31ed11263f455959cb7cc9bf79532e12fcf7 Mon Sep 17 00:00:00 2001 From: Enrique Artal Date: Thu, 23 Nov 2023 00:26:12 +0100 Subject: [PATCH 010/145] typo --- src/sage/rings/qqbar.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sage/rings/qqbar.py b/src/sage/rings/qqbar.py index c310064c085..1570d503d10 100644 --- a/src/sage/rings/qqbar.py +++ b/src/sage/rings/qqbar.py @@ -3254,7 +3254,7 @@ def _interval_fast(self, prec): def union(self, other, name='a'): r""" - Given generators ``self`` (`\alpha`) and ``other``(`\beta`), + Given generators ``self``, `\alpha`, and ``other``, `\beta`, ``self.union(other)`` gives a generator for the number field `\QQ[\alpha][\beta]`. From 89b2012e7ab8ddbca16e12a408bd72323b4044b3 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Tue, 21 Nov 2023 22:40:03 -0800 Subject: [PATCH 011/145] build/pkgs/sage*: Use spkg-install.in instead of spkg-install --- build/pkgs/sage_conf/spkg-install | 20 ------------- build/pkgs/sage_conf/spkg-install.in | 9 ++++++ build/pkgs/sage_docbuild/spkg-install | 20 ------------- build/pkgs/sage_docbuild/spkg-install.in | 9 ++++++ build/pkgs/sage_setup/spkg-install | 20 ------------- build/pkgs/sage_setup/spkg-install.in | 9 ++++++ build/pkgs/sage_sws2rst/spkg-install | 20 ------------- build/pkgs/sage_sws2rst/spkg-install.in | 9 ++++++ .../sagelib/{spkg-install => spkg-install.in} | 12 -------- .../{spkg-install => spkg-install.in} | 11 ------- build/pkgs/sagemath_categories/spkg-install | 1 - .../pkgs/sagemath_categories/spkg-install.in | 1 + .../spkg-install.in} | 11 ------- build/pkgs/sagemath_environment/spkg-install | 1 - .../pkgs/sagemath_environment/spkg-install.in | 1 + .../spkg-install.in} | 11 ------- .../spkg-install.in} | 11 ------- .../{spkg-install => spkg-install.in} | 11 ------- build/pkgs/sagemath_repl/spkg-install | 1 - build/pkgs/sagemath_repl/spkg-install.in | 1 + build/pkgs/sagemath_sirocco/spkg-install | 29 ------------------- build/pkgs/sagemath_sirocco/spkg-install.in | 18 ++++++++++++ build/pkgs/sagemath_tdlib/spkg-install | 29 ------------------- build/pkgs/sagemath_tdlib/spkg-install.in | 18 ++++++++++++ 24 files changed, 75 insertions(+), 208 deletions(-) delete mode 100755 build/pkgs/sage_conf/spkg-install create mode 100644 build/pkgs/sage_conf/spkg-install.in delete mode 100755 build/pkgs/sage_docbuild/spkg-install create mode 100644 build/pkgs/sage_docbuild/spkg-install.in delete mode 100755 build/pkgs/sage_setup/spkg-install create mode 100644 build/pkgs/sage_setup/spkg-install.in delete mode 100755 build/pkgs/sage_sws2rst/spkg-install create mode 100644 build/pkgs/sage_sws2rst/spkg-install.in rename build/pkgs/sagelib/{spkg-install => spkg-install.in} (91%) mode change 100755 => 100644 rename build/pkgs/sagemath_bliss/{spkg-install => spkg-install.in} (59%) mode change 100755 => 100644 delete mode 120000 build/pkgs/sagemath_categories/spkg-install create mode 120000 build/pkgs/sagemath_categories/spkg-install.in rename build/pkgs/{sagemath_mcqd/spkg-install => sagemath_coxeter3/spkg-install.in} (59%) mode change 100755 => 100644 delete mode 120000 build/pkgs/sagemath_environment/spkg-install create mode 120000 build/pkgs/sagemath_environment/spkg-install.in rename build/pkgs/{sagemath_meataxe/spkg-install => sagemath_mcqd/spkg-install.in} (59%) mode change 100755 => 100644 rename build/pkgs/{sagemath_coxeter3/spkg-install => sagemath_meataxe/spkg-install.in} (59%) mode change 100755 => 100644 rename build/pkgs/sagemath_objects/{spkg-install => spkg-install.in} (59%) mode change 100755 => 100644 delete mode 120000 build/pkgs/sagemath_repl/spkg-install create mode 120000 build/pkgs/sagemath_repl/spkg-install.in delete mode 100755 build/pkgs/sagemath_sirocco/spkg-install create mode 100644 build/pkgs/sagemath_sirocco/spkg-install.in delete mode 100755 build/pkgs/sagemath_tdlib/spkg-install create mode 100644 build/pkgs/sagemath_tdlib/spkg-install.in diff --git a/build/pkgs/sage_conf/spkg-install b/build/pkgs/sage_conf/spkg-install deleted file mode 100755 index a180fb36542..00000000000 --- a/build/pkgs/sage_conf/spkg-install +++ /dev/null @@ -1,20 +0,0 @@ -#! /usr/bin/env bash -# From sage-spkg. -# For type=script packages, the build rule in build/make/Makefile sources -# sage-env but not sage-dist-helpers. -lib="$SAGE_ROOT/build/bin/sage-dist-helpers" -source "$lib" -if [ $? -ne 0 ]; then - echo >&2 "Error: failed to source $lib" - echo >&2 "Is $SAGE_ROOT the correct SAGE_ROOT?" - exit 1 -fi -cd src -if [ "$SAGE_EDITABLE" = yes ]; then - sdh_pip_editable_install . - if [ "$SAGE_WHEELS" = yes ]; then - sdh_setup_bdist_wheel && sdh_store_wheel . - fi -else - sdh_pip_install . -fi diff --git a/build/pkgs/sage_conf/spkg-install.in b/build/pkgs/sage_conf/spkg-install.in new file mode 100644 index 00000000000..4479c541b1c --- /dev/null +++ b/build/pkgs/sage_conf/spkg-install.in @@ -0,0 +1,9 @@ +cd src +if [ "$SAGE_EDITABLE" = yes ]; then + sdh_pip_editable_install . + if [ "$SAGE_WHEELS" = yes ]; then + sdh_setup_bdist_wheel && sdh_store_wheel . + fi +else + sdh_pip_install . +fi diff --git a/build/pkgs/sage_docbuild/spkg-install b/build/pkgs/sage_docbuild/spkg-install deleted file mode 100755 index cce58b40e22..00000000000 --- a/build/pkgs/sage_docbuild/spkg-install +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env bash -# From sage-spkg. -# For type=script packages, the build rule in build/make/Makefile sources -# sage-env but not sage-dist-helpers. -lib="$SAGE_ROOT/build/bin/sage-dist-helpers" -source "$lib" -if [ $? -ne 0 ]; then - echo >&2 "Error: failed to source $lib" - echo >&2 "Is $SAGE_ROOT the correct SAGE_ROOT?" - exit 1 -fi -cd src -if [ "$SAGE_EDITABLE" = yes ]; then - sdh_pip_editable_install . - if [ "$SAGE_WHEELS" = yes ]; then - sdh_setup_bdist_wheel && sdh_store_wheel . - fi -else - sdh_pip_install . -fi diff --git a/build/pkgs/sage_docbuild/spkg-install.in b/build/pkgs/sage_docbuild/spkg-install.in new file mode 100644 index 00000000000..4479c541b1c --- /dev/null +++ b/build/pkgs/sage_docbuild/spkg-install.in @@ -0,0 +1,9 @@ +cd src +if [ "$SAGE_EDITABLE" = yes ]; then + sdh_pip_editable_install . + if [ "$SAGE_WHEELS" = yes ]; then + sdh_setup_bdist_wheel && sdh_store_wheel . + fi +else + sdh_pip_install . +fi diff --git a/build/pkgs/sage_setup/spkg-install b/build/pkgs/sage_setup/spkg-install deleted file mode 100755 index cce58b40e22..00000000000 --- a/build/pkgs/sage_setup/spkg-install +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env bash -# From sage-spkg. -# For type=script packages, the build rule in build/make/Makefile sources -# sage-env but not sage-dist-helpers. -lib="$SAGE_ROOT/build/bin/sage-dist-helpers" -source "$lib" -if [ $? -ne 0 ]; then - echo >&2 "Error: failed to source $lib" - echo >&2 "Is $SAGE_ROOT the correct SAGE_ROOT?" - exit 1 -fi -cd src -if [ "$SAGE_EDITABLE" = yes ]; then - sdh_pip_editable_install . - if [ "$SAGE_WHEELS" = yes ]; then - sdh_setup_bdist_wheel && sdh_store_wheel . - fi -else - sdh_pip_install . -fi diff --git a/build/pkgs/sage_setup/spkg-install.in b/build/pkgs/sage_setup/spkg-install.in new file mode 100644 index 00000000000..4479c541b1c --- /dev/null +++ b/build/pkgs/sage_setup/spkg-install.in @@ -0,0 +1,9 @@ +cd src +if [ "$SAGE_EDITABLE" = yes ]; then + sdh_pip_editable_install . + if [ "$SAGE_WHEELS" = yes ]; then + sdh_setup_bdist_wheel && sdh_store_wheel . + fi +else + sdh_pip_install . +fi diff --git a/build/pkgs/sage_sws2rst/spkg-install b/build/pkgs/sage_sws2rst/spkg-install deleted file mode 100755 index a180fb36542..00000000000 --- a/build/pkgs/sage_sws2rst/spkg-install +++ /dev/null @@ -1,20 +0,0 @@ -#! /usr/bin/env bash -# From sage-spkg. -# For type=script packages, the build rule in build/make/Makefile sources -# sage-env but not sage-dist-helpers. -lib="$SAGE_ROOT/build/bin/sage-dist-helpers" -source "$lib" -if [ $? -ne 0 ]; then - echo >&2 "Error: failed to source $lib" - echo >&2 "Is $SAGE_ROOT the correct SAGE_ROOT?" - exit 1 -fi -cd src -if [ "$SAGE_EDITABLE" = yes ]; then - sdh_pip_editable_install . - if [ "$SAGE_WHEELS" = yes ]; then - sdh_setup_bdist_wheel && sdh_store_wheel . - fi -else - sdh_pip_install . -fi diff --git a/build/pkgs/sage_sws2rst/spkg-install.in b/build/pkgs/sage_sws2rst/spkg-install.in new file mode 100644 index 00000000000..4479c541b1c --- /dev/null +++ b/build/pkgs/sage_sws2rst/spkg-install.in @@ -0,0 +1,9 @@ +cd src +if [ "$SAGE_EDITABLE" = yes ]; then + sdh_pip_editable_install . + if [ "$SAGE_WHEELS" = yes ]; then + sdh_setup_bdist_wheel && sdh_store_wheel . + fi +else + sdh_pip_install . +fi diff --git a/build/pkgs/sagelib/spkg-install b/build/pkgs/sagelib/spkg-install.in old mode 100755 new mode 100644 similarity index 91% rename from build/pkgs/sagelib/spkg-install rename to build/pkgs/sagelib/spkg-install.in index 730829b3101..7ddfda29b05 --- a/build/pkgs/sagelib/spkg-install +++ b/build/pkgs/sagelib/spkg-install.in @@ -1,15 +1,3 @@ -#!/usr/bin/env bash -# From sage-spkg. -# For type=script packages, the build rule in build/make/Makefile sources -# sage-env but not sage-dist-helpers. -lib="$SAGE_ROOT/build/bin/sage-dist-helpers" -source "$lib" -if [ $? -ne 0 ]; then - echo >&2 "Error: failed to source $lib" - echo >&2 "Is $SAGE_ROOT the correct SAGE_ROOT?" - exit 1 -fi - if [ "$SAGE_EDITABLE" = yes ]; then cd "$SAGE_SRC" else diff --git a/build/pkgs/sagemath_bliss/spkg-install b/build/pkgs/sagemath_bliss/spkg-install.in old mode 100755 new mode 100644 similarity index 59% rename from build/pkgs/sagemath_bliss/spkg-install rename to build/pkgs/sagemath_bliss/spkg-install.in index 7ce202f09ae..ccd53947ab0 --- a/build/pkgs/sagemath_bliss/spkg-install +++ b/build/pkgs/sagemath_bliss/spkg-install.in @@ -1,14 +1,3 @@ -#!/usr/bin/env bash -# From sage-spkg. -# For type=script packages, the build rule in build/make/Makefile sources -# sage-env but not sage-dist-helpers. -lib="$SAGE_ROOT/build/bin/sage-dist-helpers" -source "$lib" -if [ $? -ne 0 ]; then - echo >&2 "Error: failed to source $lib" - echo >&2 "Is $SAGE_ROOT the correct SAGE_ROOT?" - exit 1 -fi cd src export PIP_NO_INDEX=true diff --git a/build/pkgs/sagemath_categories/spkg-install b/build/pkgs/sagemath_categories/spkg-install deleted file mode 120000 index e60fac9ffa1..00000000000 --- a/build/pkgs/sagemath_categories/spkg-install +++ /dev/null @@ -1 +0,0 @@ -../sagemath_objects/spkg-install \ No newline at end of file diff --git a/build/pkgs/sagemath_categories/spkg-install.in b/build/pkgs/sagemath_categories/spkg-install.in new file mode 120000 index 00000000000..d83cc631c9a --- /dev/null +++ b/build/pkgs/sagemath_categories/spkg-install.in @@ -0,0 +1 @@ +../sagemath_objects/spkg-install.in \ No newline at end of file diff --git a/build/pkgs/sagemath_mcqd/spkg-install b/build/pkgs/sagemath_coxeter3/spkg-install.in old mode 100755 new mode 100644 similarity index 59% rename from build/pkgs/sagemath_mcqd/spkg-install rename to build/pkgs/sagemath_coxeter3/spkg-install.in index 7ce202f09ae..ccd53947ab0 --- a/build/pkgs/sagemath_mcqd/spkg-install +++ b/build/pkgs/sagemath_coxeter3/spkg-install.in @@ -1,14 +1,3 @@ -#!/usr/bin/env bash -# From sage-spkg. -# For type=script packages, the build rule in build/make/Makefile sources -# sage-env but not sage-dist-helpers. -lib="$SAGE_ROOT/build/bin/sage-dist-helpers" -source "$lib" -if [ $? -ne 0 ]; then - echo >&2 "Error: failed to source $lib" - echo >&2 "Is $SAGE_ROOT the correct SAGE_ROOT?" - exit 1 -fi cd src export PIP_NO_INDEX=true diff --git a/build/pkgs/sagemath_environment/spkg-install b/build/pkgs/sagemath_environment/spkg-install deleted file mode 120000 index e60fac9ffa1..00000000000 --- a/build/pkgs/sagemath_environment/spkg-install +++ /dev/null @@ -1 +0,0 @@ -../sagemath_objects/spkg-install \ No newline at end of file diff --git a/build/pkgs/sagemath_environment/spkg-install.in b/build/pkgs/sagemath_environment/spkg-install.in new file mode 120000 index 00000000000..d83cc631c9a --- /dev/null +++ b/build/pkgs/sagemath_environment/spkg-install.in @@ -0,0 +1 @@ +../sagemath_objects/spkg-install.in \ No newline at end of file diff --git a/build/pkgs/sagemath_meataxe/spkg-install b/build/pkgs/sagemath_mcqd/spkg-install.in old mode 100755 new mode 100644 similarity index 59% rename from build/pkgs/sagemath_meataxe/spkg-install rename to build/pkgs/sagemath_mcqd/spkg-install.in index 7ce202f09ae..ccd53947ab0 --- a/build/pkgs/sagemath_meataxe/spkg-install +++ b/build/pkgs/sagemath_mcqd/spkg-install.in @@ -1,14 +1,3 @@ -#!/usr/bin/env bash -# From sage-spkg. -# For type=script packages, the build rule in build/make/Makefile sources -# sage-env but not sage-dist-helpers. -lib="$SAGE_ROOT/build/bin/sage-dist-helpers" -source "$lib" -if [ $? -ne 0 ]; then - echo >&2 "Error: failed to source $lib" - echo >&2 "Is $SAGE_ROOT the correct SAGE_ROOT?" - exit 1 -fi cd src export PIP_NO_INDEX=true diff --git a/build/pkgs/sagemath_coxeter3/spkg-install b/build/pkgs/sagemath_meataxe/spkg-install.in old mode 100755 new mode 100644 similarity index 59% rename from build/pkgs/sagemath_coxeter3/spkg-install rename to build/pkgs/sagemath_meataxe/spkg-install.in index 7ce202f09ae..ccd53947ab0 --- a/build/pkgs/sagemath_coxeter3/spkg-install +++ b/build/pkgs/sagemath_meataxe/spkg-install.in @@ -1,14 +1,3 @@ -#!/usr/bin/env bash -# From sage-spkg. -# For type=script packages, the build rule in build/make/Makefile sources -# sage-env but not sage-dist-helpers. -lib="$SAGE_ROOT/build/bin/sage-dist-helpers" -source "$lib" -if [ $? -ne 0 ]; then - echo >&2 "Error: failed to source $lib" - echo >&2 "Is $SAGE_ROOT the correct SAGE_ROOT?" - exit 1 -fi cd src export PIP_NO_INDEX=true diff --git a/build/pkgs/sagemath_objects/spkg-install b/build/pkgs/sagemath_objects/spkg-install.in old mode 100755 new mode 100644 similarity index 59% rename from build/pkgs/sagemath_objects/spkg-install rename to build/pkgs/sagemath_objects/spkg-install.in index 18ceb18724d..62cb1b73b22 --- a/build/pkgs/sagemath_objects/spkg-install +++ b/build/pkgs/sagemath_objects/spkg-install.in @@ -1,14 +1,3 @@ -#!/usr/bin/env bash -# From sage-spkg. -# For type=script packages, the build rule in build/make/Makefile sources -# sage-env but not sage-dist-helpers. -lib="$SAGE_ROOT/build/bin/sage-dist-helpers" -source "$lib" -if [ $? -ne 0 ]; then - echo >&2 "Error: failed to source $lib" - echo >&2 "Is $SAGE_ROOT the correct SAGE_ROOT?" - exit 1 -fi cd src export PIP_NO_INDEX=true diff --git a/build/pkgs/sagemath_repl/spkg-install b/build/pkgs/sagemath_repl/spkg-install deleted file mode 120000 index e60fac9ffa1..00000000000 --- a/build/pkgs/sagemath_repl/spkg-install +++ /dev/null @@ -1 +0,0 @@ -../sagemath_objects/spkg-install \ No newline at end of file diff --git a/build/pkgs/sagemath_repl/spkg-install.in b/build/pkgs/sagemath_repl/spkg-install.in new file mode 120000 index 00000000000..d83cc631c9a --- /dev/null +++ b/build/pkgs/sagemath_repl/spkg-install.in @@ -0,0 +1 @@ +../sagemath_objects/spkg-install.in \ No newline at end of file diff --git a/build/pkgs/sagemath_sirocco/spkg-install b/build/pkgs/sagemath_sirocco/spkg-install deleted file mode 100755 index 7ce202f09ae..00000000000 --- a/build/pkgs/sagemath_sirocco/spkg-install +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env bash -# From sage-spkg. -# For type=script packages, the build rule in build/make/Makefile sources -# sage-env but not sage-dist-helpers. -lib="$SAGE_ROOT/build/bin/sage-dist-helpers" -source "$lib" -if [ $? -ne 0 ]; then - echo >&2 "Error: failed to source $lib" - echo >&2 "Is $SAGE_ROOT the correct SAGE_ROOT?" - exit 1 -fi -cd src - -export PIP_NO_INDEX=true -export PIP_FIND_LINKS="file://$SAGE_SPKG_WHEELS" - -if [ "$SAGE_EDITABLE" = yes ]; then - # SAGE_ROOT/src/setup.py installs everything, nothing to do... - if [ "$SAGE_WHEELS" = yes ]; then - # ... except we build the wheel if requested - sdh_setup_bdist_wheel && sdh_store_wheel . - fi -else - if [ "$SAGE_WHEELS" = yes ]; then - # Modularized install via wheels - sdh_pip_install . - # else nothing to do in legacy direct installation. - fi -fi diff --git a/build/pkgs/sagemath_sirocco/spkg-install.in b/build/pkgs/sagemath_sirocco/spkg-install.in new file mode 100644 index 00000000000..ccd53947ab0 --- /dev/null +++ b/build/pkgs/sagemath_sirocco/spkg-install.in @@ -0,0 +1,18 @@ +cd src + +export PIP_NO_INDEX=true +export PIP_FIND_LINKS="file://$SAGE_SPKG_WHEELS" + +if [ "$SAGE_EDITABLE" = yes ]; then + # SAGE_ROOT/src/setup.py installs everything, nothing to do... + if [ "$SAGE_WHEELS" = yes ]; then + # ... except we build the wheel if requested + sdh_setup_bdist_wheel && sdh_store_wheel . + fi +else + if [ "$SAGE_WHEELS" = yes ]; then + # Modularized install via wheels + sdh_pip_install . + # else nothing to do in legacy direct installation. + fi +fi diff --git a/build/pkgs/sagemath_tdlib/spkg-install b/build/pkgs/sagemath_tdlib/spkg-install deleted file mode 100755 index 7ce202f09ae..00000000000 --- a/build/pkgs/sagemath_tdlib/spkg-install +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env bash -# From sage-spkg. -# For type=script packages, the build rule in build/make/Makefile sources -# sage-env but not sage-dist-helpers. -lib="$SAGE_ROOT/build/bin/sage-dist-helpers" -source "$lib" -if [ $? -ne 0 ]; then - echo >&2 "Error: failed to source $lib" - echo >&2 "Is $SAGE_ROOT the correct SAGE_ROOT?" - exit 1 -fi -cd src - -export PIP_NO_INDEX=true -export PIP_FIND_LINKS="file://$SAGE_SPKG_WHEELS" - -if [ "$SAGE_EDITABLE" = yes ]; then - # SAGE_ROOT/src/setup.py installs everything, nothing to do... - if [ "$SAGE_WHEELS" = yes ]; then - # ... except we build the wheel if requested - sdh_setup_bdist_wheel && sdh_store_wheel . - fi -else - if [ "$SAGE_WHEELS" = yes ]; then - # Modularized install via wheels - sdh_pip_install . - # else nothing to do in legacy direct installation. - fi -fi diff --git a/build/pkgs/sagemath_tdlib/spkg-install.in b/build/pkgs/sagemath_tdlib/spkg-install.in new file mode 100644 index 00000000000..ccd53947ab0 --- /dev/null +++ b/build/pkgs/sagemath_tdlib/spkg-install.in @@ -0,0 +1,18 @@ +cd src + +export PIP_NO_INDEX=true +export PIP_FIND_LINKS="file://$SAGE_SPKG_WHEELS" + +if [ "$SAGE_EDITABLE" = yes ]; then + # SAGE_ROOT/src/setup.py installs everything, nothing to do... + if [ "$SAGE_WHEELS" = yes ]; then + # ... except we build the wheel if requested + sdh_setup_bdist_wheel && sdh_store_wheel . + fi +else + if [ "$SAGE_WHEELS" = yes ]; then + # Modularized install via wheels + sdh_pip_install . + # else nothing to do in legacy direct installation. + fi +fi From 737247bde85c1b4ea35ce2c83d032040361477f7 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Tue, 21 Nov 2023 22:55:43 -0800 Subject: [PATCH 012/145] build/bin/sage-spkg: No warnings for experimental script packages --- build/bin/sage-spkg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/bin/sage-spkg b/build/bin/sage-spkg index 121efa4f057..f384bdebbd9 100755 --- a/build/bin/sage-spkg +++ b/build/bin/sage-spkg @@ -320,7 +320,7 @@ fi # Warning for experimental packages if [ x`cat "$PKG_SCRIPTS/type"` = x"experimental" -a $INFO = 0 ]; then - if [ $YES != 1 ]; then + if [ $YES != 1 -a -n "$PKG_NAME_UPSTREAM" ]; then # We use /dev/tty here because our output may be redirected # to a logfile, or line-buffered. write_to_tty < Date: Tue, 21 Nov 2023 22:58:29 -0800 Subject: [PATCH 013/145] bootstrap: Script packages can now have spkg-install.in too --- bootstrap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bootstrap b/bootstrap index 6e408265d84..5070b5df44a 100755 --- a/bootstrap +++ b/bootstrap @@ -92,7 +92,7 @@ EOF if test -f "$DIR/requirements.txt"; then SPKG_SOURCE=pip elif test ! -f "$DIR/checksums.ini"; then - if test -f "$DIR/spkg-install"; then + if test -f "$DIR/spkg-install" -o -f "$DIR/spkg-install.in"; then SPKG_SOURCE=script else # a dummy package From b380fc8d8b9c04816c694e1a6f699cbb254b3a55 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Tue, 21 Nov 2023 23:07:30 -0800 Subject: [PATCH 014/145] src/doc/en/developer: Update on spkg-install scripts of script packages --- src/doc/en/developer/packaging.rst | 17 +++++++---------- src/doc/en/installation/source.rst | 2 +- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/src/doc/en/developer/packaging.rst b/src/doc/en/developer/packaging.rst index 9f8bd2528ef..0fd58782264 100644 --- a/src/doc/en/developer/packaging.rst +++ b/src/doc/en/developer/packaging.rst @@ -117,8 +117,8 @@ the following source types: - the file ``package-version.txt`` is optional; - - installing the package runs the installation script ``spkg-install`` - (see :ref:`section-spkg-install`); + - installing the package runs the installation script ``spkg-install`` or + ``spkg-install.in`` (see :ref:`section-spkg-install`); - Sage records the version number of the package installed using a file in ``$SAGE_LOCAL/var/lib/sage/installed/`` and will rerun the installation @@ -134,8 +134,8 @@ the following source types: To summarize: the package source type is determined as follows: if there is a file ``requirements.txt``, it is a ``pip`` package. If not, then if there is a ``checksums.ini`` file, it is ``normal`` or ``wheel``. -Otherwise, if it has an ``spkg-install`` script, it is a ``script`` package, -and if it does not, then it is a ``dummy`` package. +Otherwise, if it has an ``spkg-install`` or ``spkg-install.in`` script, +it is a ``script`` package, and if it does not, then it is a ``dummy`` package. .. _section-directory-structure: @@ -358,13 +358,10 @@ at build time, which should to the appropriate system-specific Install scripts of script packages ---------------------------------- -A script package has a single install script named ``spkg-install``. +For script packages, it is also possible to use an install script named ``spkg-install``. It needs to be an executable shell script; it is not subject to the templating -described in the previous section. - -Sage runs ``spkg-install`` from the directory ``$SAGE_ROOT/build/pkgs/`` -in the environment obtained by sourcing the files ``src/bin/sage-env``, -``build/bin/sage-build-env-config``, and ``build/bin/sage-build-env``. +described in the previous section and will be executed directly from +the build directory. .. _section-sdh-helpers: diff --git a/src/doc/en/installation/source.rst b/src/doc/en/installation/source.rst index b16fd8e7295..6afae82731e 100644 --- a/src/doc/en/installation/source.rst +++ b/src/doc/en/installation/source.rst @@ -1016,7 +1016,7 @@ Environment variables dealing with specific Sage packages: - :envvar:`PARI_CONFIGURE` - use this to pass extra parameters to PARI's ``Configure`` script, for example to specify graphics support (which is disabled by default). See the file - :file:`build/pkgs/pari/spkg-install` for more information. + :file:`build/pkgs/pari/spkg-install.in` for more information. - :envvar:`SAGE_TUNE_PARI` - if yes, enable PARI self-tuning. Note that this can be time-consuming. If you set this variable to "yes", you From e6b3a00a7b1372a5100ab5cfa7242cf86d606f93 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Wed, 22 Nov 2023 14:03:00 -0800 Subject: [PATCH 015/145] build/make/Makefile.in: Install and uninstall script packages like normal packages --- build/make/Makefile.in | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/build/make/Makefile.in b/build/make/Makefile.in index 6031ae7fa2a..10a45a8e453 100644 --- a/build/make/Makefile.in +++ b/build/make/Makefile.in @@ -725,7 +725,7 @@ $(1)-$(4)-no-deps: echo "Error: The installation tree $(4) has been disabled" 2>&1; \ echo "$$($(4)_DISABLED_MESSAGE)" 2>&1; \ exit 1; \ - elif [ -x '$$(SAGE_ROOT)/build/pkgs/$(1)/spkg-install' ]; then \ + elif [ -x '$$(SAGE_ROOT)/build/pkgs/$(1)/spkg-install' -o -r '$$(SAGE_ROOT)/build/pkgs/$(1)/spkg-install.in' ]; then \ rm -rf '$$($(4))/var/lib/sage/scripts/$(1)'; \ cd '$$(SAGE_ROOT)/build/pkgs/$(1)' && \ . '$$(SAGE_ROOT)/src/bin/sage-src-env-config' && \ @@ -740,9 +740,9 @@ $(1)-$(4)-no-deps: SAGE_SPKG_SCRIPTS=$$($(4))/var/lib/sage/scripts \ SAGE_INST_LOCAL=$$($(4)) \ SAGE_CHECK=$$(SAGE_CHECK_$(1)) \ - sage-logger -p '$$(SAGE_ROOT)/build/pkgs/$(1)/spkg-install && if [ $$$$SAGE_CHECK != no -a -x $$(SAGE_ROOT)/build/pkgs/$(1)/spkg-check ]; then $$(SAGE_ROOT)/build/pkgs/$(1)/spkg-check; fi' '$$(SAGE_LOGS)/$(1)-$(2).log' && \ - rm -f "$$($(4))/$(SPKG_INST_RELDIR)/$(1)"-* && \ - touch "$$($(4))/$(SPKG_INST_RELDIR)/$(1)-$(2)"; \ + sage-logger -p 'SAGE_CHECK=$$(SAGE_CHECK_$(1)) PATH=$$(SAGE_SRC)/bin:$$($(4))/bin:$$$$PATH $$(SAGE_SPKG) $$(SAGE_SPKG_OPTIONS) \ + $(if $(filter $(1),$(TOOLCHAIN_DEPS)),--keep-existing) \ + $(1)-$(2) $$($(4))' '$$(SAGE_LOGS)/$(1)-$(2).log'; \ else ( \ echo; \ echo "Note: $(1) is a dummy package that the Sage distribution uses"; \ @@ -781,14 +781,10 @@ $(1)-$(4)-check: $(1)-check: $(1)-$(4)-check $(1)-$(4)-uninstall: - -$(AM_V_at)cd '$$(SAGE_ROOT)/build/pkgs/$(1)' && \ - . '$$(SAGE_ROOT)/src/bin/sage-src-env-config' && \ - . '$$(SAGE_ROOT)/src/bin/sage-env-config' && \ - . '$$(SAGE_ROOT)/src/bin/sage-env' && \ - . '$$(SAGE_ROOT)/build/bin/sage-build-env-config' && \ - . '$$(SAGE_ROOT)/build/bin/sage-build-env' && \ - '$$(SAGE_ROOT)/build/pkgs/$(1)/spkg-uninstall' - -rm -f "$$($(4))/$(SPKG_INST_RELDIR)/$(1)"-* + if [ -d '$$($(4))' ]; then \ + sage-spkg-uninstall $(if $(filter $(1),$(TOOLCHAIN_DEPS)),--keep-files) \ + $(1) '$$($(4))'; \ + fi $(1)-uninstall: $(1)-$(4)-uninstall From c008841787a4c8f92cd58d59a1eef08c4f4c1ffc Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Wed, 22 Nov 2023 14:03:33 -0800 Subject: [PATCH 016/145] build/pkgs/r/spkg-uninstall: Outdated, remove --- build/pkgs/r/spkg-uninstall | 7 ------- 1 file changed, 7 deletions(-) delete mode 100755 build/pkgs/r/spkg-uninstall diff --git a/build/pkgs/r/spkg-uninstall b/build/pkgs/r/spkg-uninstall deleted file mode 100755 index 32892b79a91..00000000000 --- a/build/pkgs/r/spkg-uninstall +++ /dev/null @@ -1,7 +0,0 @@ -#! /usr/bin/env bash -# Remove old install -rm -rf "$SAGE_LOCAL"/lib/r -rm -rf "$SAGE_LOCAL"/lib/R -rm -rf "$SAGE_LOCAL"/lib/R.old -rm -rf "$SAGE_LOCAL"/lib/libRblas.* "$SAGE_LOCAL"/lib/libRlapack.* "$SAGE_LOCAL"/lib/libR.* -rm -f "$SAGE_LOCAL"/bin/R* From 0c50c82f585a2021a7b78522566544df51ba7913 Mon Sep 17 00:00:00 2001 From: Tobias Diez Date: Thu, 23 Nov 2023 06:25:07 +0000 Subject: [PATCH 017/145] Relativize more header imports --- src/sage/cpython/debug.pyx | 4 ++-- src/sage/cpython/python_debug.pxd | 2 +- src/sage/graphs/cliquer.pyx | 2 +- src/sage/modular/arithgroup/farey.cpp | 2 +- src/sage/rings/padics/pow_computer_ext.pyx | 2 +- src/sage/structure/coerce_dict.pyx | 2 +- src/sage_setup/autogen/interpreters/generator.py | 2 +- src/sage_setup/autogen/interpreters/specs/cc.py | 4 ++-- src/sage_setup/autogen/interpreters/specs/cdf.py | 2 +- src/sage_setup/autogen/interpreters/specs/element.py | 2 +- src/sage_setup/autogen/interpreters/specs/rr.py | 4 ++-- 11 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/sage/cpython/debug.pyx b/src/sage/cpython/debug.pyx index cdaca3a4854..09680986673 100644 --- a/src/sage/cpython/debug.pyx +++ b/src/sage/cpython/debug.pyx @@ -18,10 +18,10 @@ cdef extern from "Python.h": # Helper to get a pointer to an object's __dict__ slot, if any PyObject** _PyObject_GetDictPtr(obj) -cdef extern from "sage/cpython/debugimpl.c": +cdef extern from "debugimpl.c": void _type_debug(PyTypeObject*) -from .getattr cimport AttributeErrorMessage +from sage.cpython.getattr cimport AttributeErrorMessage # Determine subtype_traverse, subtype_clear, subtype_dealloc functions 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 diff --git a/src/sage/graphs/cliquer.pyx b/src/sage/graphs/cliquer.pyx index 6f232d97e16..2800efa5d37 100644 --- a/src/sage/graphs/cliquer.pyx +++ b/src/sage/graphs/cliquer.pyx @@ -35,7 +35,7 @@ from cysignals.memory cimport sig_free from cysignals.signals cimport sig_on, sig_off -cdef extern from "sage/graphs/cliquer/cl.c": +cdef extern from "cliquer/cl.c": cdef int sage_clique_max(graph_t *g, int ** list_of_vertices) cdef int sage_all_clique_max(graph_t *g, int ** list_of_vertices) cdef int sage_clique_number(graph_t *g) diff --git a/src/sage/modular/arithgroup/farey.cpp b/src/sage/modular/arithgroup/farey.cpp index 209391676de..5c912b46ca9 100644 --- a/src/sage/modular/arithgroup/farey.cpp +++ b/src/sage/modular/arithgroup/farey.cpp @@ -29,7 +29,7 @@ #include #include "farey.hpp" -#include "sage/modular/arithgroup/farey_symbol.h" +#include "farey_symbol.h" using namespace std; diff --git a/src/sage/rings/padics/pow_computer_ext.pyx b/src/sage/rings/padics/pow_computer_ext.pyx index 82140353d10..babfec6bb70 100644 --- a/src/sage/rings/padics/pow_computer_ext.pyx +++ b/src/sage/rings/padics/pow_computer_ext.pyx @@ -69,7 +69,7 @@ from sage.libs.ntl.ntl_ZZ cimport ntl_ZZ from sage.libs.ntl.ntl_ZZ_pX cimport ntl_ZZ_pX, ntl_ZZ_pX_Modulus from sage.rings.integer cimport Integer -cdef extern from "sage/ext/ccobject.h": +cdef extern from "ccobject.h": ZZ_c* Allocate_ZZ_array "Allocate_array"(size_t n) void Delete_ZZ_array "Delete_array"(ZZ_c* v) ZZ_pX_c* Allocate_ZZ_pX_array "Allocate_array"(size_t n) diff --git a/src/sage/structure/coerce_dict.pyx b/src/sage/structure/coerce_dict.pyx index 269f1be5fd5..8bfb1f9f030 100644 --- a/src/sage/structure/coerce_dict.pyx +++ b/src/sage/structure/coerce_dict.pyx @@ -73,7 +73,7 @@ from cysignals.memory cimport check_calloc, sig_free cdef extern from "Python.h": void PyTuple_SET_ITEM(object tuple, Py_ssize_t index, PyObject* item) -cdef extern from "sage/cpython/pyx_visit.h": +cdef extern from "pyx_visit.h": void Py_VISIT3(PyObject*, visitproc, void*) cdef type KeyedRef, ref diff --git a/src/sage_setup/autogen/interpreters/generator.py b/src/sage_setup/autogen/interpreters/generator.py index bec7cae2b47..33877422a8c 100644 --- a/src/sage_setup/autogen/interpreters/generator.py +++ b/src/sage_setup/autogen/interpreters/generator.py @@ -374,7 +374,7 @@ def write_wrapper(self, write): from sage.ext.fast_callable cimport Wrapper - cdef extern from "sage/ext/interpreters/interp_{{ s.name }}.c": + cdef extern from "interp_{{ s.name }}.c": {{ myself.func_header(cython=true) -}} {% if s.err_return != 'NULL' %} diff --git a/src/sage_setup/autogen/interpreters/specs/cc.py b/src/sage_setup/autogen/interpreters/specs/cc.py index ea5e8708647..e16252b0b79 100644 --- a/src/sage_setup/autogen/interpreters/specs/cc.py +++ b/src/sage_setup/autogen/interpreters/specs/cc.py @@ -149,7 +149,7 @@ def __init__(self): sage: print(interp.c_header) #include - #include "sage/ext/interpreters/wrapper_cc.h" + #include "wrapper_cc.h" So instructions where you need to interact with Python can @@ -171,7 +171,7 @@ def __init__(self): self.c_header = ri(0, ''' #include - #include "sage/ext/interpreters/wrapper_cc.h" + #include "wrapper_cc.h" ''') self.pxd_header = ri(0, diff --git a/src/sage_setup/autogen/interpreters/specs/cdf.py b/src/sage_setup/autogen/interpreters/specs/cdf.py index 137487e1de2..e85a9fbe802 100644 --- a/src/sage_setup/autogen/interpreters/specs/cdf.py +++ b/src/sage_setup/autogen/interpreters/specs/cdf.py @@ -85,7 +85,7 @@ def __init__(self): self.c_header = ri(0,""" #include #include - #include "sage/ext/interpreters/wrapper_cdf.h" + #include "wrapper_cdf.h" /* On Solaris, we need to define _Imaginary_I when compiling with GCC, * otherwise the constant I doesn't work. The definition below is based diff --git a/src/sage_setup/autogen/interpreters/specs/element.py b/src/sage_setup/autogen/interpreters/specs/element.py index bbb9c21ae57..2f280f703f1 100644 --- a/src/sage_setup/autogen/interpreters/specs/element.py +++ b/src/sage_setup/autogen/interpreters/specs/element.py @@ -105,7 +105,7 @@ def __init__(self): self.chunks = [self.mc_args, self.mc_constants, self.mc_stack, self.mc_domain_info, self.mc_code] self.c_header = ri(0, """ - #include "sage/ext/interpreters/wrapper_el.h" + #include "wrapper_el.h" #define CHECK(x) do_check(&(x), domain) diff --git a/src/sage_setup/autogen/interpreters/specs/rr.py b/src/sage_setup/autogen/interpreters/specs/rr.py index 264b694dfab..06452e24047 100644 --- a/src/sage_setup/autogen/interpreters/specs/rr.py +++ b/src/sage_setup/autogen/interpreters/specs/rr.py @@ -148,7 +148,7 @@ def __init__(self): sage: print(interp.c_header) #include - #include "sage/ext/interpreters/wrapper_rr.h" + #include "wrapper_rr.h" The function ``rr_py_call_helper`` is implemented in Cython:: @@ -188,7 +188,7 @@ def __init__(self): self.c_header = ri(0, ''' #include - #include "sage/ext/interpreters/wrapper_rr.h" + #include "wrapper_rr.h" ''') self.pxd_header = ri(0, From 30d706731e3bb51c6d0ae2ccbadb87c56c07e40d Mon Sep 17 00:00:00 2001 From: Kwankyu Lee Date: Thu, 23 Nov 2023 15:59:23 +0900 Subject: [PATCH 018/145] Decapitalize headlines in number fields --- src/doc/en/reference/number_fields/index.rst | 21 +++-- src/sage/rings/number_field/S_unit_solver.py | 37 ++++---- src/sage/rings/number_field/class_group.py | 2 +- src/sage/rings/number_field/galois_group.py | 19 ++-- src/sage/rings/number_field/number_field.py | 91 ++++++++----------- .../number_field/number_field_element.pyx | 5 - .../number_field_element_quadratic.pyx | 4 +- .../rings/number_field/number_field_ideal.py | 24 ++--- .../number_field/number_field_ideal_rel.py | 17 ++-- .../rings/number_field/number_field_rel.py | 35 +++---- src/sage/rings/number_field/order.py | 10 +- .../small_primes_of_degree_one.py | 12 +-- src/sage/rings/number_field/totallyreal.pyx | 31 +++---- .../rings/number_field/totallyreal_data.pyx | 15 ++- .../rings/number_field/totallyreal_phc.py | 4 +- .../rings/number_field/totallyreal_rel.py | 2 +- src/sage/rings/number_field/unit_group.py | 2 +- src/sage/rings/qqbar.py | 15 +-- 18 files changed, 159 insertions(+), 187 deletions(-) diff --git a/src/doc/en/reference/number_fields/index.rst b/src/doc/en/reference/number_fields/index.rst index 1440398be09..8610cef9ba2 100644 --- a/src/doc/en/reference/number_fields/index.rst +++ b/src/doc/en/reference/number_fields/index.rst @@ -1,20 +1,27 @@ Algebraic Numbers and Number Fields =================================== -Algebraic Number Fields ------------------------ +Number Fields +------------- .. toctree:: :maxdepth: 1 - sage/rings/number_field/number_field sage/rings/number_field/number_field_base + sage/rings/number_field/number_field sage/rings/number_field/number_field_rel - sage/rings/number_field/number_field_element - sage/rings/number_field/number_field_element_quadratic sage/rings/number_field/splitting_field sage/rings/number_field/galois_group + +Elements +-------- + +.. toctree:: + :maxdepth: 1 + + sage/rings/number_field/number_field_element + sage/rings/number_field/number_field_element_quadratic sage/rings/number_field/bdd_height Morphisms @@ -29,8 +36,8 @@ Morphisms sage/rings/number_field/maps sage/rings/number_field/structure -Orders, Ideals, Ideal Classes ------------------------------ +Orders, Ideals and Ideal Classes +-------------------------------- .. toctree:: :maxdepth: 1 diff --git a/src/sage/rings/number_field/S_unit_solver.py b/src/sage/rings/number_field/S_unit_solver.py index b7e40d9893d..9d1d3d39a4a 100644 --- a/src/sage/rings/number_field/S_unit_solver.py +++ b/src/sage/rings/number_field/S_unit_solver.py @@ -1,24 +1,10 @@ # sage.doctest: needs sage.rings.number_field sage.rings.padics r""" -Solve S-unit equation x + y = 1 +Solve `S`-unit equation `x + y = 1` -Inspired by work of Tzanakis--de Weger, Baker--Wustholz and Smart, we use the LLL methods in Sage to implement an algorithm that returns all `S`-unit solutions to the equation `x + y = 1`. - -REFERENCES: - -- [MR2016]_ - -- [Sma1995]_ - -- [Sma1998]_ - -- [Yu2007]_ - -- [AKMRVW]_ - -AUTHORS: - -- Alejandra Alvarado, Angelos Koutsianas, Beth Malmskog, Christopher Rasmussen, David Roe, Christelle Vincent, Mckenzie West (2018-04-25 to 2018-11-09): original version +Inspired by work of Tzanakis--de Weger, Baker--Wustholz and Smart, we use the +LLL methods in Sage to implement an algorithm that returns all `S`-unit +solutions to the equation `x + y = 1`. EXAMPLES:: @@ -37,6 +23,21 @@ .. TODO:: - Use Cython to improve timings on the sieve + +REFERENCES: + +- [MR2016]_ +- [Sma1995]_ +- [Sma1998]_ +- [Yu2007]_ +- [AKMRVW]_ + +AUTHORS: + +- Alejandra Alvarado, Angelos Koutsianas, Beth Malmskog, Christopher Rasmussen, + David Roe, Christelle Vincent, Mckenzie West (2018-04-25 to 2018-11-09): + original version + """ diff --git a/src/sage/rings/number_field/class_group.py b/src/sage/rings/number_field/class_group.py index 93f22993eb3..d532123c16a 100644 --- a/src/sage/rings/number_field/class_group.py +++ b/src/sage/rings/number_field/class_group.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- r""" -Class Groups of Number Fields +Class groups of number fields An element of a class group is stored as a pair consisting of both an explicit ideal in that ideal class, and a list of exponents giving that ideal class in diff --git a/src/sage/rings/number_field/galois_group.py b/src/sage/rings/number_field/galois_group.py index 6e159f9e3fa..7071fd9a59a 100644 --- a/src/sage/rings/number_field/galois_group.py +++ b/src/sage/rings/number_field/galois_group.py @@ -1,21 +1,12 @@ # sage.doctest: needs sage.groups sage.rings.number_field """ -Galois Groups of Number Fields +Galois groups of number fields AUTHORS: - William Stein (2004, 2005): initial version - David Loeffler (2009): rewrite to give explicit homomorphism groups -TESTS: - -Standard test of pickleability:: - - sage: x = polygen(ZZ, 'x') - sage: G = NumberField(x^3 + 2, 'alpha').galois_group(names='beta'); G - Galois group 3T2 (S3) with order 6 of x^3 + 2 - sage: G == loads(dumps(G)) - True """ from sage.structure.sage_object import SageObject @@ -76,6 +67,14 @@ def __init__(self, group, number_field): See https://github.com/sagemath/sage/issues/28782 for details. Galois group PARI group [4, 1, 2, "E(4) = 2[x]2"] of degree 4 of the Number Field in a0 with defining polynomial x^2 + 1 over its base field + + TESTS:: + + sage: x = polygen(ZZ, 'x') + sage: G = NumberField(x^3 + 2, 'alpha').galois_group(names='beta'); G + Galois group 3T2 (S3) with order 6 of x^3 + 2 + sage: G == loads(dumps(G)) + True """ deprecation(28782, "GaloisGroup_v1 is deprecated; please use GaloisGroup_v2") self.__group = group diff --git a/src/sage/rings/number_field/number_field.py b/src/sage/rings/number_field/number_field.py index f4c3948e9e5..742f504eb41 100644 --- a/src/sage/rings/number_field/number_field.py +++ b/src/sage/rings/number_field/number_field.py @@ -1,51 +1,8 @@ # sage.doctest: needs sage.libs.linbox r""" -Number Fields - -AUTHORS: - -- William Stein (2004, 2005): initial version - -- Steven Sivek (2006-05-12): added support for relative extensions - -- William Stein (2007-09-04): major rewrite and documentation - -- Robert Bradshaw (2008-10): specified embeddings into ambient fields - -- Simon King (2010-05): Improve coercion from GAP - -- Jeroen Demeyer (2010-07, 2011-04): Upgrade PARI (:trac:`9343`, :trac:`10430`, :trac:`11130`) - -- Robert Harron (2012-08): added is_CM(), complex_conjugation(), and - maximal_totally_real_subfield() - -- Christian Stump (2012-11): added conversion to universal cyclotomic field - -- Julian Rueth (2014-04-03): absolute number fields are unique parents - -- Vincent Delecroix (2015-02): comparisons/floor/ceil using embeddings - -- Kiran Kedlaya (2016-05): relative number fields hash based on relative polynomials - -- Peter Bruin (2016-06): make number fields fully satisfy unique representation - -- John Jones (2017-07): improve check for is_galois(), add is_abelian(), building on work in patch by Chris Wuthrich - -- Anna Haensch (2018-03): added :meth:`quadratic_defect` - -- Michael Daub, Chris Wuthrich (2020-09-01): adding Dirichlet characters for abelian fields +Number fields - -.. note:: - - Unlike in PARI/GP, class group computations *in Sage* do *not* by default - assume the Generalized Riemann Hypothesis. To do class groups computations - not provably correctly you must often pass the flag ``proof=False`` to - functions or call the function ``proof.number_field(False)``. It can easily - take 1000's of times longer to do computations with ``proof=True`` (the - default). - -This example follows one in the Magma reference manual:: +We define a quartic number field and its quadratic extension:: sage: x = polygen(ZZ, 'x') sage: K. = NumberField(x^4 - 420*x^2 + 40000) @@ -82,19 +39,32 @@ sage: a.parent() Number Field in sqrt2 with defining polynomial x^2 - 2 over its base field -TESTS: - -Check that :trac:`23459` is fixed:: - - sage: QuadraticField(4**1000+1) - Number Field ... - -.. warning:: +.. WARNING:: Doing arithmetic in towers of relative fields that depends on canonical coercions is currently VERY SLOW. It is much better to explicitly coerce all elements into a common field, then do arithmetic with them there (which is quite fast). + +AUTHORS: + +- William Stein (2004, 2005): initial version +- Steven Sivek (2006-05-12): added support for relative extensions +- William Stein (2007-09-04): major rewrite and documentation +- Robert Bradshaw (2008-10): specified embeddings into ambient fields +- Simon King (2010-05): Improve coercion from GAP +- Jeroen Demeyer (2010-07, 2011-04): Upgrade PARI (:trac:`9343`, :trac:`10430`, :trac:`11130`) +- Robert Harron (2012-08): added is_CM(), complex_conjugation(), and + maximal_totally_real_subfield() +- Christian Stump (2012-11): added conversion to universal cyclotomic field +- Julian Rueth (2014-04-03): absolute number fields are unique parents +- Vincent Delecroix (2015-02): comparisons/floor/ceil using embeddings +- Kiran Kedlaya (2016-05): relative number fields hash based on relative polynomials +- Peter Bruin (2016-06): make number fields fully satisfy unique representation +- John Jones (2017-07): improve check for is_galois(), add is_abelian(), building on work in patch by Chris Wuthrich +- Anna Haensch (2018-03): added :meth:`quadratic_defect` +- Michael Daub, Chris Wuthrich (2020-09-01): adding Dirichlet characters for abelian fields + """ # **************************************************************************** # Copyright (C) 2004-2007 William Stein @@ -994,6 +964,11 @@ def QuadraticField(D, name='a', check=True, embedding=True, latex_name='sqrt', * sage: QuadraticField(-11, 'a') is QuadraticField(-11, 'a', latex_name=None) False + Check that :trac:`23459` is fixed:: + + sage: QuadraticField(4**1000+1) + Number Field ... + Check quadratic fields without embedding (:trac:`28932`):: sage: QuadraticField(3, embedding=False) @@ -4638,6 +4613,16 @@ def class_group(self, proof=None, names='c'): (x - 3) * (x^3 + 4*x^2 + 3*x - 1) * (x^4 - 3*x^3 - x^2 + 6*x - 1) sage: [NumberField(g,'a').class_group().order() for g,_ in f.factor()] [1, 1, 1] + + .. NOTE:: + + Unlike in PARI/GP, class group computations *in Sage* do *not* by + default assume the Generalized Riemann Hypothesis. To do class + groups computations not provably correctly you must often pass the + flag ``proof=False`` to functions or call the function + ``proof.number_field(False)``. It can easily take 1000's of times + longer to do computations with ``proof=True`` (the default). + """ proof = proof_flag(proof) try: diff --git a/src/sage/rings/number_field/number_field_element.pyx b/src/sage/rings/number_field/number_field_element.pyx index a0553fc31d9..82558498e37 100644 --- a/src/sage/rings/number_field/number_field_element.pyx +++ b/src/sage/rings/number_field/number_field_element.pyx @@ -11,17 +11,12 @@ Number field elements (implementation using NTL) AUTHORS: - William Stein: version before it got Cython'd - - Joel B. Mohler (2007-03-09): First reimplementation in Cython - - William Stein (2007-09-04): add doctests - - Robert Bradshaw (2007-09-15): specialized classes for relative and absolute elements - - John Cremona (2009-05-15): added support for local and global logarithmic heights. - - Robert Harron (2012-08): conjugate() now works for all fields contained in CM fields diff --git a/src/sage/rings/number_field/number_field_element_quadratic.pyx b/src/sage/rings/number_field/number_field_element_quadratic.pyx index 3cdaabb3140..1be1770d651 100644 --- a/src/sage/rings/number_field/number_field_element_quadratic.pyx +++ b/src/sage/rings/number_field/number_field_element_quadratic.pyx @@ -6,9 +6,9 @@ # distutils: language = c++ # sage.doctest: needs sage.rings.number_field r""" -Optimized Quadratic Number Field Elements +Optimized quadratic number field elements -This file defines a Cython class :class:`NumberFieldElement_quadratic` to speed up +This module defines a Cython class :class:`NumberFieldElement_quadratic` to speed up computations in quadratic extensions of `\QQ`. AUTHORS: diff --git a/src/sage/rings/number_field/number_field_ideal.py b/src/sage/rings/number_field/number_field_ideal.py index de95aa69369..707ee6ea781 100644 --- a/src/sage/rings/number_field/number_field_ideal.py +++ b/src/sage/rings/number_field/number_field_ideal.py @@ -1,28 +1,16 @@ # sage.doctest: needs sage.libs.pari sage.rings.number_field """ -Number Field Ideals +Ideals of number fields AUTHORS: -- Steven Sivek (2005-05-16) - +- Steven Sivek (2005-05-16): initial version - William Stein (2007-09-06): vastly improved the doctesting - - William Stein and John Cremona (2007-01-28): new class NumberFieldFractionalIdeal now used for all except the 0 ideal - - Radoslav Kirov and Alyson Deines (2010-06-22): prime_to_S_part, is_S_unit, is_S_integral -TESTS: - -We test that pickling works:: - - sage: x = polygen(ZZ) - sage: K. = NumberField(x^2 - 5) - sage: I = K.ideal(2/(5+a)) - sage: I == loads(dumps(I)) - True """ # **************************************************************************** @@ -100,6 +88,14 @@ def __init__(self, field, gens, coerce=True): TESTS: + We test that pickling works:: + + sage: x = polygen(ZZ) + sage: K. = NumberField(x^2 - 5) + sage: I = K.ideal(2/(5+a)) + sage: I == loads(dumps(I)) + True + Check that ``_pari_prime`` is set when initializing from a PARI prime ideal:: diff --git a/src/sage/rings/number_field/number_field_ideal_rel.py b/src/sage/rings/number_field/number_field_ideal_rel.py index 5ef403e7e23..c9a03fd06e7 100644 --- a/src/sage/rings/number_field/number_field_ideal_rel.py +++ b/src/sage/rings/number_field/number_field_ideal_rel.py @@ -1,13 +1,5 @@ r""" -Relative Number Field Ideals - -AUTHORS: - -- Steven Sivek (2005-05-16) - -- William Stein (2007-09-06) - -- Nick Alexander (2009-01) +Ideals of relative number fields EXAMPLES:: @@ -22,6 +14,13 @@ Fractional ideal ((1/2*b + 2)*a - 1/2*b + 2) sage: K.fractional_ideal(G).absolute_norm().factor() 7^2 + +AUTHORS: + +- Steven Sivek (2005-05-16) +- William Stein (2007-09-06) +- Nick Alexander (2009-01) + """ #***************************************************************************** diff --git a/src/sage/rings/number_field/number_field_rel.py b/src/sage/rings/number_field/number_field_rel.py index 9e1e22dccd4..e6fbb906deb 100644 --- a/src/sage/rings/number_field/number_field_rel.py +++ b/src/sage/rings/number_field/number_field_rel.py @@ -1,17 +1,7 @@ r""" -Relative Number Fields +Relative number fields -AUTHORS: - -- William Stein (2004, 2005): initial version -- Steven Sivek (2006-05-12): added support for relative extensions -- William Stein (2007-09-04): major rewrite and documentation -- Robert Bradshaw (2008-10): specified embeddings into ambient fields -- Nick Alexander (2009-01): modernize coercion implementation -- Robert Harron (2012-08): added is_CM_extension -- Julian Rüth (2014-04): absolute number fields are unique parents - -This example follows one in the Magma reference manual:: +This example constructs a quadratic extension of a quartic number field:: sage: x = polygen(ZZ, 'x') sage: K. = NumberField(x^4 - 420*x^2 + 40000) @@ -48,10 +38,12 @@ sage: a.parent() Number Field in sqrt2 with defining polynomial x^2 - 2 over its base field -WARNING: Doing arithmetic in towers of relative fields that depends on -canonical coercions is currently VERY SLOW. It is much better to -explicitly coerce all elements into a common field, then do arithmetic -with them there (which is quite fast). +.. WARNING: + + Doing arithmetic in towers of relative fields that depends on canonical + coercions is currently VERY SLOW. It is much better to explicitly coerce + all elements into a common field, then do arithmetic with them there (which + is quite fast). TESTS:: @@ -60,6 +52,17 @@ 27*beta0 sage: beta^10 27*beta0 + +AUTHORS: + +- William Stein (2004, 2005): initial version +- Steven Sivek (2006-05-12): added support for relative extensions +- William Stein (2007-09-04): major rewrite and documentation +- Robert Bradshaw (2008-10): specified embeddings into ambient fields +- Nick Alexander (2009-01): modernize coercion implementation +- Robert Harron (2012-08): added is_CM_extension +- Julian Rüth (2014-04): absolute number fields are unique parents + """ # **************************************************************************** # Copyright (C) 2004-2009 William Stein diff --git a/src/sage/rings/number_field/order.py b/src/sage/rings/number_field/order.py index 896132b4e56..cf2d9f07822 100644 --- a/src/sage/rings/number_field/order.py +++ b/src/sage/rings/number_field/order.py @@ -1,10 +1,6 @@ # sage.doctest: needs sage.libs.linbox """ -Orders in Number Fields - -AUTHORS: - -- William Stein and Robert Bradshaw (2007-09): initial version +Orders in number fields EXAMPLES: @@ -39,6 +35,10 @@ sage: factor(m) 17^45 +AUTHORS: + +- William Stein and Robert Bradshaw (2007-09): initial version + """ # **************************************************************************** # Copyright (C) 2007 Robert Bradshaw diff --git a/src/sage/rings/number_field/small_primes_of_degree_one.py b/src/sage/rings/number_field/small_primes_of_degree_one.py index b5cb57bb2df..ce5d3ecd660 100644 --- a/src/sage/rings/number_field/small_primes_of_degree_one.py +++ b/src/sage/rings/number_field/small_primes_of_degree_one.py @@ -4,9 +4,7 @@ Iterator for finding several primes of absolute degree one of a number field of *small* prime norm. ------- - -**Algorithm**: +.. ALGORITHM:: Let `P` denote the product of some set of prime numbers. (In practice, we use the product of the first 10000 primes, because Pari computes this many by @@ -24,22 +22,18 @@ for example Theorem 4.8.13, p199 of [Coh1993]_), the ideal generated by `(p, \alpha - n)` is prime and of degree one. -.. warning:: +.. WARNING:: It is possible that there are no primes of `K` of absolute degree one of small prime norm, and it is possible that this algorithm will not find any primes of small norm. ------- - -**To do**: +.. TODO:: There are situations when this will fail. There are questions of finding primes of relative degree one. There are questions of finding primes of exact degree larger than one. In short, if you can contribute, please do! --------- - EXAMPLES:: sage: x = ZZ['x'].gen() diff --git a/src/sage/rings/number_field/totallyreal.pyx b/src/sage/rings/number_field/totallyreal.pyx index 505bf92c35f..d542259b6f9 100644 --- a/src/sage/rings/number_field/totallyreal.pyx +++ b/src/sage/rings/number_field/totallyreal.pyx @@ -1,5 +1,5 @@ r""" -Enumeration of Primitive Totally Real Fields +Enumeration of primitive totally real fields This module contains functions for enumerating all primitive totally real number fields of given degree and small discriminant. @@ -9,26 +9,22 @@ subfields except `\QQ`. See also :mod:`sage.rings.number_field.totallyreal_rel`, which handles the non-primitive case using relative extensions. -Algorithm ---------- +.. ALGORITHM:: -We use Hunter's algorithm ([Coh2000]_, Section 9.3) with modifications -due to Takeuchi [Tak1999]_ and the author [Voi2008]_. + We use Hunter's algorithm ([Coh2000]_, Section 9.3) with modifications + due to Takeuchi [Tak1999]_ and the author [Voi2008]_. -We enumerate polynomials `f(x) = x^n + a_{n-1} x^{n-1} + \dots + a_0`. -Hunter's theorem gives bounds on `a_{n-1}` and `a_{n-2}`; then given -`a_{n-1}` and `a_{n-2}`, one can recursively compute bounds on `a_{n-3}, -\dots, a_0`, using the fact that the polynomial is totally real by -looking at the zeros of successive derivatives and applying -Rolle's theorem. See [Tak1999]_ for more details. + We enumerate polynomials `f(x) = x^n + a_{n-1} x^{n-1} + \dots + a_0`. + Hunter's theorem gives bounds on `a_{n-1}` and `a_{n-2}`; then given + `a_{n-1}` and `a_{n-2}`, one can recursively compute bounds on `a_{n-3}, + \dots, a_0`, using the fact that the polynomial is totally real by + looking at the zeros of successive derivatives and applying + Rolle's theorem. See [Tak1999]_ for more details. -Examples --------- +EXAMPLES: In this first simple example, we compute the totally real quadratic -fields of discriminant `\le 50`. - -:: +fields of discriminant `\le 50`. :: sage: enumerate_totallyreal_fields_prim(2,50) [[5, x^2 - x - 1], @@ -68,8 +64,7 @@ We see that there are 9 such fields (up to isomorphism!). See also [Mar1980]_. -Authors -------- +AUTHORS: - John Voight (2007-09-01): Initial version. - John Voight (2007-09-19): Various optimization tweaks. diff --git a/src/sage/rings/number_field/totallyreal_data.pyx b/src/sage/rings/number_field/totallyreal_data.pyx index e504fb6b45f..fd40e9bdf59 100644 --- a/src/sage/rings/number_field/totallyreal_data.pyx +++ b/src/sage/rings/number_field/totallyreal_data.pyx @@ -1,17 +1,14 @@ # distutils: libraries = gmp """ -Enumeration of Totally Real Fields +Enumeration of totally real fields AUTHORS: -- Craig Citro and John Voight (2007-11-04): - Type checking and other polishing. -- John Voight (2007-10-09): - Improvements: Smyth bound, Lagrange multipliers for b. -- John Voight (2007-09-19): - Various optimization tweaks. -- John Voight (2007-09-01): - Initial version. +- John Voight (2007-09-01): Initial version. +- John Voight (2007-09-19): Various optimization tweaks. +- John Voight (2007-10-09): Improvements: Smyth bound, Lagrange multipliers for b. +- Craig Citro and John Voight (2007-11-04): Type checking and other polishing. + """ #***************************************************************************** diff --git a/src/sage/rings/number_field/totallyreal_phc.py b/src/sage/rings/number_field/totallyreal_phc.py index 4143feb67b3..3441a2fc6c3 100644 --- a/src/sage/rings/number_field/totallyreal_phc.py +++ b/src/sage/rings/number_field/totallyreal_phc.py @@ -1,9 +1,9 @@ """ -Enumeration of Totally Real Fields: PHC interface +Enumeration of totally real fields: PHC interface AUTHORS: -- John Voight (2007-10-10): Zeroth attempt. +- John Voight (2007-10-10): zeroth attempt. """ # **************************************************************************** diff --git a/src/sage/rings/number_field/totallyreal_rel.py b/src/sage/rings/number_field/totallyreal_rel.py index d7039c26c86..d1e8faf31b7 100644 --- a/src/sage/rings/number_field/totallyreal_rel.py +++ b/src/sage/rings/number_field/totallyreal_rel.py @@ -1,5 +1,5 @@ r""" -Enumeration of Totally Real Fields: Relative Extensions +Enumeration of totally real fields: relative extensions This module contains functions to enumerate primitive extensions `L / K`, where `K` is a given totally real number field, with given degree and small root diff --git a/src/sage/rings/number_field/unit_group.py b/src/sage/rings/number_field/unit_group.py index 63bd1f7cbfc..083cea4d6bf 100644 --- a/src/sage/rings/number_field/unit_group.py +++ b/src/sage/rings/number_field/unit_group.py @@ -1,5 +1,5 @@ r""" -Unit and S-unit groups of Number Fields +Unit and S-unit groups of number fields EXAMPLES:: diff --git a/src/sage/rings/qqbar.py b/src/sage/rings/qqbar.py index 3be8051935c..181c8a89d8d 100644 --- a/src/sage/rings/qqbar.py +++ b/src/sage/rings/qqbar.py @@ -1,13 +1,8 @@ # sage.doctest: needs sage.libs.linbox r""" -Field of Algebraic Numbers +Field of algebraic numbers -AUTHOR: - -- Carl Witty (2007-01-27): initial version -- Carl Witty (2007-10-29): massive rewrite to support complex as well as real numbers - -This is an implementation of the algebraic numbers (the complex +This module implements the algebraic numbers (the complex numbers which are the zero of a polynomial in `\ZZ[x]`; in other words, the algebraic closure of `\QQ`, with an embedding into `\CC`). All computations are exact. We also include an implementation of the @@ -552,6 +547,12 @@ (1.000505492239?, 2), (0.999999587? + 0.?e-11*I, 1), (0.999999999? + 0.?e-11*I, 1)] + +AUTHOR: + +- Carl Witty (2007-01-27): initial version +- Carl Witty (2007-10-29): massive rewrite to support complex as well as real numbers + """ import itertools From 062b177798c41c7800a60545f4390aceba751182 Mon Sep 17 00:00:00 2001 From: Enrique Artal Date: Thu, 23 Nov 2023 08:19:40 +0100 Subject: [PATCH 019/145] doc changes suggested by reviewer --- src/sage/rings/qqbar.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/sage/rings/qqbar.py b/src/sage/rings/qqbar.py index 1570d503d10..a1e1f0f97ee 100644 --- a/src/sage/rings/qqbar.py +++ b/src/sage/rings/qqbar.py @@ -2509,7 +2509,7 @@ def number_field_elements_from_algebraics(numbers, minimal=False, same_field=Fal - ``embedded`` -- Boolean (default: ``False``). Whether to make the NumberField embedded. - - ``name`` -- string (default: ``a``). Name of the primitive element. + - ``name`` -- string (default: ``'a'``); name of the primitive element. - ``prec`` -- integer (default: ``53``). The number of bit of precision to guarantee finding real roots. @@ -3261,8 +3261,7 @@ def union(self, other, name='a'): INPUT: - ``other`` - an algebraic number. - - - ``name`` - string (default: 'a'). A name for the primitive element. + - ``name`` - string (default: ``'a'``); a name for the primitive element. EXAMPLES:: From 04de49b210daeb4363c6d143cf01c192b7d81af5 Mon Sep 17 00:00:00 2001 From: Kwankyu Lee Date: Thu, 23 Nov 2023 18:04:06 +0900 Subject: [PATCH 020/145] Make numerous fixes to make headers look good --- src/doc/en/reference/number_fields/index.rst | 26 ++++------ src/sage/rings/number_field/bdd_height.py | 19 +++---- src/sage/rings/number_field/galois_group.py | 2 +- src/sage/rings/number_field/maps.py | 4 +- src/sage/rings/number_field/number_field.py | 10 ++-- .../rings/number_field/number_field_base.pyx | 13 +++-- .../number_field/number_field_element.pyx | 16 +++--- .../number_field_element_quadratic.pyx | 19 +++---- .../rings/number_field/number_field_rel.py | 2 +- .../small_primes_of_degree_one.py | 8 +-- .../rings/number_field/splitting_field.py | 2 +- src/sage/rings/number_field/structure.py | 8 +-- src/sage/rings/number_field/totallyreal.pyx | 31 ++++++------ .../rings/number_field/totallyreal_data.pyx | 2 +- .../rings/number_field/totallyreal_phc.py | 10 +--- src/sage/rings/number_field/unit_group.py | 2 +- src/sage/rings/qqbar.py | 2 +- src/sage/rings/universal_cyclotomic_field.py | 49 +++++++++---------- 18 files changed, 102 insertions(+), 123 deletions(-) diff --git a/src/doc/en/reference/number_fields/index.rst b/src/doc/en/reference/number_fields/index.rst index 8610cef9ba2..d63a189f964 100644 --- a/src/doc/en/reference/number_fields/index.rst +++ b/src/doc/en/reference/number_fields/index.rst @@ -10,6 +10,7 @@ Number Fields sage/rings/number_field/number_field_base sage/rings/number_field/number_field sage/rings/number_field/number_field_rel + sage/rings/universal_cyclotomic_field sage/rings/number_field/splitting_field sage/rings/number_field/galois_group @@ -51,12 +52,16 @@ Orders, Ideals and Ideal Classes sage/rings/number_field/small_primes_of_degree_one sage/rings/number_field/selmer_group -.. SEEALSO:: +Algebraic Numbers +----------------- - :mod:`sage.rings.finite_rings.residue_field` +.. toctree:: + :maxdepth: 1 -Totally Real Fields -------------------- + sage/rings/qqbar + +Enumeration of Totally Real Fields +---------------------------------- .. toctree:: :maxdepth: 1 @@ -66,17 +71,4 @@ Totally Real Fields sage/rings/number_field/totallyreal_data sage/rings/number_field/totallyreal_phc -Algebraic Numbers ------------------ - -.. toctree:: - :maxdepth: 1 - - sage/rings/qqbar - sage/rings/universal_cyclotomic_field - -.. SEEALSO:: - - :mod:`sage.rings.algebraic_closure_finite_field` - .. include:: ../footer.txt diff --git a/src/sage/rings/number_field/bdd_height.py b/src/sage/rings/number_field/bdd_height.py index ee2080c3bd7..0681aaef58e 100644 --- a/src/sage/rings/number_field/bdd_height.py +++ b/src/sage/rings/number_field/bdd_height.py @@ -2,22 +2,17 @@ r""" Elements of bounded height in number fields -Sage functions to list all elements of a given number field with height less -than a specified bound. +This module provides functions to list all elements of a given number field +with height less than a specified bound. -AUTHORS: - -- John Doyle (2013): initial version - -- David Krumm (2013): initial version - -- TJ Combs (2018): added Doyle-Krumm algorithm - 4 +REFERENCES: -- Raghukul Raman (2018): added Doyle-Krumm algorithm - 4 +- [DK2013]_ -REFERENCES: +AUTHORS: -- [DK2013] +- John Doyle, David Krumm (2013): initial version +- TJ Combs, Raghukul Raman (2018): added Doyle-Krumm algorithm-4 """ # **************************************************************************** diff --git a/src/sage/rings/number_field/galois_group.py b/src/sage/rings/number_field/galois_group.py index 7071fd9a59a..2e6b876e541 100644 --- a/src/sage/rings/number_field/galois_group.py +++ b/src/sage/rings/number_field/galois_group.py @@ -5,7 +5,7 @@ AUTHORS: - William Stein (2004, 2005): initial version -- David Loeffler (2009): rewrite to give explicit homomorphism groups +- David Loeffler (2009): rewrote to give explicit homomorphism groups """ diff --git a/src/sage/rings/number_field/maps.py b/src/sage/rings/number_field/maps.py index 182bfea18d2..2eb9e32c1c9 100644 --- a/src/sage/rings/number_field/maps.py +++ b/src/sage/rings/number_field/maps.py @@ -1,8 +1,8 @@ r""" Structure maps for number fields -Provides isomorphisms between relative and absolute presentations, to and from -vector spaces, name changing maps, etc. +Thid module provides isomorphisms between relative and absolute presentations, +to and from vector spaces, name changing maps, etc. EXAMPLES:: diff --git a/src/sage/rings/number_field/number_field.py b/src/sage/rings/number_field/number_field.py index 742f504eb41..e34606e085b 100644 --- a/src/sage/rings/number_field/number_field.py +++ b/src/sage/rings/number_field/number_field.py @@ -52,18 +52,18 @@ - Steven Sivek (2006-05-12): added support for relative extensions - William Stein (2007-09-04): major rewrite and documentation - Robert Bradshaw (2008-10): specified embeddings into ambient fields -- Simon King (2010-05): Improve coercion from GAP -- Jeroen Demeyer (2010-07, 2011-04): Upgrade PARI (:trac:`9343`, :trac:`10430`, :trac:`11130`) +- Simon King (2010-05): improved coercion from GAP +- Jeroen Demeyer (2010-07, 2011-04): upgraded PARI (:trac:`9343`, :trac:`10430`, :trac:`11130`) - Robert Harron (2012-08): added is_CM(), complex_conjugation(), and maximal_totally_real_subfield() - Christian Stump (2012-11): added conversion to universal cyclotomic field - Julian Rueth (2014-04-03): absolute number fields are unique parents - Vincent Delecroix (2015-02): comparisons/floor/ceil using embeddings - Kiran Kedlaya (2016-05): relative number fields hash based on relative polynomials -- Peter Bruin (2016-06): make number fields fully satisfy unique representation -- John Jones (2017-07): improve check for is_galois(), add is_abelian(), building on work in patch by Chris Wuthrich +- Peter Bruin (2016-06): made number fields fully satisfy unique representation +- John Jones (2017-07): improved check for is_galois(), add is_abelian(), building on work in patch by Chris Wuthrich - Anna Haensch (2018-03): added :meth:`quadratic_defect` -- Michael Daub, Chris Wuthrich (2020-09-01): adding Dirichlet characters for abelian fields +- Michael Daub, Chris Wuthrich (2020-09-01): added Dirichlet characters for abelian fields """ # **************************************************************************** diff --git a/src/sage/rings/number_field/number_field_base.pyx b/src/sage/rings/number_field/number_field_base.pyx index 40961d24d41..609951cab12 100644 --- a/src/sage/rings/number_field/number_field_base.pyx +++ b/src/sage/rings/number_field/number_field_base.pyx @@ -1,13 +1,11 @@ # sage.doctest: needs sage.rings.number_field """ -Base class for all number fields +Base class of number fields +AUTHORS: -TESTS:: +- William Stein (2007-09-04): initial version - sage: x = polygen(ZZ) - sage: k = NumberField(x^2 + 1, 'i'); k == loads(dumps(k)) - True """ @@ -55,6 +53,11 @@ cdef class NumberField(Field): TESTS:: + sage: x = polygen(ZZ) + sage: k = NumberField(x^2 + 1, 'i') + sage: k == loads(dumps(k)) + True + sage: z = polygen(QQ) sage: K. = NumberField([z^3 - 3, z^2 + 1]) sage: K.is_finite() diff --git a/src/sage/rings/number_field/number_field_element.pyx b/src/sage/rings/number_field/number_field_element.pyx index 82558498e37..3c5e944dcf6 100644 --- a/src/sage/rings/number_field/number_field_element.pyx +++ b/src/sage/rings/number_field/number_field_element.pyx @@ -6,17 +6,17 @@ # distutils: language = c++ # sage.doctest: needs sage.libs.linbox """ -Number field elements (implementation using NTL) +Elements of number fields (implemented using NTL) AUTHORS: -- William Stein: version before it got Cython'd -- Joel B. Mohler (2007-03-09): First reimplementation in Cython -- William Stein (2007-09-04): add doctests -- Robert Bradshaw (2007-09-15): specialized classes for relative and - absolute elements -- John Cremona (2009-05-15): added support for local and global - logarithmic heights. +- William Stein: initial version +- Joel B. Mohler (2007-03-09): reimplemented in Cython +- William Stein (2007-09-04): added doctests +- Robert Bradshaw (2007-09-15): specialized classes for relative and absolute + elements +- John Cremona (2009-05-15): added support for local and global logarithmic + heights - Robert Harron (2012-08): conjugate() now works for all fields contained in CM fields diff --git a/src/sage/rings/number_field/number_field_element_quadratic.pyx b/src/sage/rings/number_field/number_field_element_quadratic.pyx index 1be1770d651..8c32754b796 100644 --- a/src/sage/rings/number_field/number_field_element_quadratic.pyx +++ b/src/sage/rings/number_field/number_field_element_quadratic.pyx @@ -6,23 +6,24 @@ # distutils: language = c++ # sage.doctest: needs sage.rings.number_field r""" -Optimized quadratic number field elements +Elements optimized for quadratic number fields This module defines a Cython class :class:`NumberFieldElement_quadratic` to speed up computations in quadratic extensions of `\QQ`. +.. TODO:: + + The ``_new()`` method should be overridden in this class to copy the ``D`` + and ``standard_embedding`` attributes. + AUTHORS: -- Robert Bradshaw (2007-09): Initial version -- David Harvey (2007-10): fix up a few bugs, polish around the edges -- David Loeffler (2009-05): add more documentation and tests -- Vincent Delecroix (2012-07): comparisons for quadratic number fields +- Robert Bradshaw (2007-09): initial version +- David Harvey (2007-10): fixed up a few bugs, polish around the edges +- David Loeffler (2009-05): added more documentation and tests +- Vincent Delecroix (2012-07): added comparisons for quadratic number fields (:trac:`13213`), abs, floor and ceil functions (:trac:`13256`) -.. TODO:: - - The ``_new()`` method should be overridden in this class to copy the ``D`` - and ``standard_embedding`` attributes """ # **************************************************************************** # Copyright (C) 2007 Robert Bradshaw diff --git a/src/sage/rings/number_field/number_field_rel.py b/src/sage/rings/number_field/number_field_rel.py index e6fbb906deb..cb4675f2392 100644 --- a/src/sage/rings/number_field/number_field_rel.py +++ b/src/sage/rings/number_field/number_field_rel.py @@ -59,7 +59,7 @@ - Steven Sivek (2006-05-12): added support for relative extensions - William Stein (2007-09-04): major rewrite and documentation - Robert Bradshaw (2008-10): specified embeddings into ambient fields -- Nick Alexander (2009-01): modernize coercion implementation +- Nick Alexander (2009-01): modernized coercion implementation - Robert Harron (2012-08): added is_CM_extension - Julian Rüth (2014-04): absolute number fields are unique parents diff --git a/src/sage/rings/number_field/small_primes_of_degree_one.py b/src/sage/rings/number_field/small_primes_of_degree_one.py index ce5d3ecd660..63fccc409ad 100644 --- a/src/sage/rings/number_field/small_primes_of_degree_one.py +++ b/src/sage/rings/number_field/small_primes_of_degree_one.py @@ -4,7 +4,7 @@ Iterator for finding several primes of absolute degree one of a number field of *small* prime norm. -.. ALGORITHM:: +ALGORITHM: Let `P` denote the product of some set of prime numbers. (In practice, we use the product of the first 10000 primes, because Pari computes this many by @@ -30,9 +30,9 @@ .. TODO:: -There are situations when this will fail. There are questions of finding -primes of relative degree one. There are questions of finding primes of exact -degree larger than one. In short, if you can contribute, please do! + There are situations when this will fail. There are questions of finding + primes of relative degree one. There are questions of finding primes of exact + degree larger than one. In short, if you can contribute, please do! EXAMPLES:: diff --git a/src/sage/rings/number_field/splitting_field.py b/src/sage/rings/number_field/splitting_field.py index 46c535d2a5e..bf04391a554 100644 --- a/src/sage/rings/number_field/splitting_field.py +++ b/src/sage/rings/number_field/splitting_field.py @@ -4,8 +4,8 @@ AUTHORS: - Jeroen Demeyer (2014-01-02): initial version for :trac:`2217` +- Jeroen Demeyer (2014-01-03): added ``abort_degree`` argument, :trac:`15626` -- Jeroen Demeyer (2014-01-03): add ``abort_degree`` argument, :trac:`15626` """ #***************************************************************************** diff --git a/src/sage/rings/number_field/structure.py b/src/sage/rings/number_field/structure.py index 64d7d688e35..92be301645b 100644 --- a/src/sage/rings/number_field/structure.py +++ b/src/sage/rings/number_field/structure.py @@ -2,10 +2,6 @@ r""" Helper classes for structural embeddings and isomorphisms of number fields -AUTHORS: - -- Julian Rueth (2014-04-03): initial version - Consider the following fields `L` and `M`:: sage: L. = QuadraticField(2) @@ -44,6 +40,10 @@ sage: M is N True +AUTHORS: + +- Julian Rueth (2014-04-03): initial version + """ #***************************************************************************** # Copyright (C) 2014 Julian Rueth diff --git a/src/sage/rings/number_field/totallyreal.pyx b/src/sage/rings/number_field/totallyreal.pyx index d542259b6f9..04b975f7498 100644 --- a/src/sage/rings/number_field/totallyreal.pyx +++ b/src/sage/rings/number_field/totallyreal.pyx @@ -9,17 +9,17 @@ subfields except `\QQ`. See also :mod:`sage.rings.number_field.totallyreal_rel`, which handles the non-primitive case using relative extensions. -.. ALGORITHM:: +ALGORITHM: - We use Hunter's algorithm ([Coh2000]_, Section 9.3) with modifications - due to Takeuchi [Tak1999]_ and the author [Voi2008]_. +We use Hunter's algorithm ([Coh2000]_, Section 9.3) with modifications +due to Takeuchi [Tak1999]_ and the author [Voi2008]_. - We enumerate polynomials `f(x) = x^n + a_{n-1} x^{n-1} + \dots + a_0`. - Hunter's theorem gives bounds on `a_{n-1}` and `a_{n-2}`; then given - `a_{n-1}` and `a_{n-2}`, one can recursively compute bounds on `a_{n-3}, - \dots, a_0`, using the fact that the polynomial is totally real by - looking at the zeros of successive derivatives and applying - Rolle's theorem. See [Tak1999]_ for more details. +We enumerate polynomials `f(x) = x^n + a_{n-1} x^{n-1} + \dots + a_0`. +Hunter's theorem gives bounds on `a_{n-1}` and `a_{n-2}`; then given +`a_{n-1}` and `a_{n-2}`, one can recursively compute bounds on `a_{n-3}, +\dots, a_0`, using the fact that the polynomial is totally real by +looking at the zeros of successive derivatives and applying +Rolle's theorem. See [Tak1999]_ for more details. EXAMPLES: @@ -66,15 +66,12 @@ See also [Mar1980]_. AUTHORS: -- John Voight (2007-09-01): Initial version. -- John Voight (2007-09-19): Various optimization tweaks. -- John Voight (2007-10-09): Added DSage module. -- John Voight (2007-10-17): Added pari functions to avoid recomputations. -- John Voight (2007-10-27): Separated DSage component. -- Craig Citro and John Voight (2007-11-04): Additional doctests and type checking. -- Craig Citro and John Voight (2008-02-10): Final modifications for submission. +- John Voight (2007-09-01): initial version; various optimization tweaks. +- John Voight (2007-10-09): added DSage module; added pari functions to avoid + recomputations; separated DSage component. +- Craig Citro and John Voight (2007-11-04): additional doctests and type checking. +- Craig Citro and John Voight (2008-02-10): final modifications for submission. ------- """ # **************************************************************************** diff --git a/src/sage/rings/number_field/totallyreal_data.pyx b/src/sage/rings/number_field/totallyreal_data.pyx index fd40e9bdf59..070df239bc2 100644 --- a/src/sage/rings/number_field/totallyreal_data.pyx +++ b/src/sage/rings/number_field/totallyreal_data.pyx @@ -1,6 +1,6 @@ # distutils: libraries = gmp """ -Enumeration of totally real fields +Enumeration of totally real fields: data AUTHORS: diff --git a/src/sage/rings/number_field/totallyreal_phc.py b/src/sage/rings/number_field/totallyreal_phc.py index 3441a2fc6c3..e564d760320 100644 --- a/src/sage/rings/number_field/totallyreal_phc.py +++ b/src/sage/rings/number_field/totallyreal_phc.py @@ -3,7 +3,7 @@ AUTHORS: -- John Voight (2007-10-10): zeroth attempt. +- John Voight (2007-09-19): initial version """ # **************************************************************************** @@ -39,10 +39,6 @@ def coefficients_to_power_sums(n, m, a): This uses Newton's relations, which are classical. - AUTHORS: - - - John Voight (2007-09-19) - EXAMPLES:: sage: from sage.rings.number_field.totallyreal_phc import coefficients_to_power_sums @@ -80,10 +76,6 @@ def __lagrange_bounds_phc(n, m, a, tmpfile=None): See Cohen [Coh2000]_ for the general idea and unpublished work of the author for more detail. - AUTHORS: - - - John Voight (2007-09-19) - EXAMPLES:: sage: # optional - phc diff --git a/src/sage/rings/number_field/unit_group.py b/src/sage/rings/number_field/unit_group.py index 083cea4d6bf..e2c1ebccb9e 100644 --- a/src/sage/rings/number_field/unit_group.py +++ b/src/sage/rings/number_field/unit_group.py @@ -1,5 +1,5 @@ r""" -Unit and S-unit groups of number fields +Units and `S`-unit groups of number fields EXAMPLES:: diff --git a/src/sage/rings/qqbar.py b/src/sage/rings/qqbar.py index 181c8a89d8d..637a2d54665 100644 --- a/src/sage/rings/qqbar.py +++ b/src/sage/rings/qqbar.py @@ -1,6 +1,6 @@ # sage.doctest: needs sage.libs.linbox r""" -Field of algebraic numbers +Algebraic numbers This module implements the algebraic numbers (the complex numbers which are the zero of a polynomial in `\ZZ[x]`; in other diff --git a/src/sage/rings/universal_cyclotomic_field.py b/src/sage/rings/universal_cyclotomic_field.py index e60d59cd0db..87843227295 100644 --- a/src/sage/rings/universal_cyclotomic_field.py +++ b/src/sage/rings/universal_cyclotomic_field.py @@ -3,29 +3,9 @@ Universal cyclotomic field The universal cyclotomic field is the smallest subfield of the complex field -containing all roots of unity. It is also the maximal Galois Abelian extension +containing all roots of unity. It is also the maximal abelian extension of the rational numbers. -The implementation simply wraps GAP Cyclotomic. As mentioned in their -documentation: arithmetical operations are quite expensive, so the use of -internally represented cyclotomics is not recommended for doing arithmetic over -number fields, such as calculations with matrices of cyclotomics. - -.. NOTE:: - - There used to be a native Sage version of the universal cyclotomic field - written by Christian Stump (see :trac:`8327`). It was slower on most - operations and it was decided to use a version based on GAP instead (see - :trac:`18152`). One main difference in the design choices is that GAP stores - dense vectors whereas the native ones used Python dictionaries (storing only - nonzero coefficients). Most operations are faster with GAP except some - operation on very sparse elements. All details can be found in - :trac:`18152`. - -REFERENCES: - -- [Bre1997] - EXAMPLES:: sage: UCF = UniversalCyclotomicField(); UCF @@ -102,6 +82,26 @@ sage: E(3) * x - 1 E(3)*x - 1 +The implementation simply wraps GAP Cyclotomic. As mentioned in their +documentation: arithmetical operations are quite expensive, so the use of +internally represented cyclotomics is not recommended for doing arithmetic over +number fields, such as calculations with matrices of cyclotomics. + +.. NOTE:: + + There used to be a native Sage version of the universal cyclotomic field + written by Christian Stump (see :trac:`8327`). It was slower on most + operations and it was decided to use a version based on GAP instead (see + :trac:`18152`). One main difference in the design choices is that GAP stores + dense vectors whereas the native ones used Python dictionaries (storing only + nonzero coefficients). Most operations are faster with GAP except some + operation on very sparse elements. All details can be found in + :trac:`18152`. + +REFERENCES: + +- [Bre1997]_ + TESTS:: sage: UCF.one() @@ -157,11 +157,10 @@ AUTHORS: - Christian Stump (2013): initial Sage version (see :trac:`8327`) +- Vincent Delecroix (2015): completed rewriting using libgap (see :trac:`18152`) +- Sebastian Oehms (2018): deleted the method is_finite since it returned the wrong result (see :trac:`25686`) +- Sebastian Oehms (2019): added :meth:`_factor_univariate_polynomial` (see :trac:`28631`) -- Vincent Delecroix (2015): complete rewriting using libgap (see :trac:`18152`) - -- Sebastian Oehms (2018): deleting the method is_finite since it returned the wrong result (see :trac:`25686`) -- Sebastian Oehms (2019): add :meth:`_factor_univariate_polynomial` (see :trac:`28631`) """ import sage.rings.abc From c1854c8306904f6615b449d3db2ea708f7c36c86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Chapoton?= Date: Thu, 23 Nov 2023 10:33:51 +0100 Subject: [PATCH 021/145] some details in qepcad interface --- src/sage/interfaces/qepcad.py | 37 +++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/src/sage/interfaces/qepcad.py b/src/sage/interfaces/qepcad.py index b6b657515bc..4079256da5b 100644 --- a/src/sage/interfaces/qepcad.py +++ b/src/sage/interfaces/qepcad.py @@ -638,7 +638,9 @@ def _qepcad_atoms(formula): sage: _qepcad_atoms('y^5 + 4 y + 8 >= 0 /\\ y <= 0 /\\ [ y = 0 \\/ y^5 + 4 y + 8 = 0 ]') {'y <= 0', 'y = 0', 'y^5 + 4 y + 8 = 0', 'y^5 + 4 y + 8 >= 0'} """ - return set(i.strip() for i in flatten([i.split('\\/') for i in formula.replace('[','').replace(']','').split('/\\')])) + L = flatten([i.split('\\/') for i in formula.replace('[', '').replace(']', '').split('/\\')]) + return {i.strip() for i in L} + def _qepcad_cmd(memcells=None): r""" @@ -657,10 +659,10 @@ def _qepcad_cmd(memcells=None): True """ if memcells is not None: - memcells_arg = '+N%s' % memcells + memcells_arg = f'+N{memcells}' else: memcells_arg = '' - return "env qe=%s qepcad %s" % (SAGE_LOCAL, memcells_arg) + return f"env qe={SAGE_LOCAL} qepcad {memcells_arg}" _command_info_cache = None @@ -892,7 +894,7 @@ def __repr__(self): sage: qepcad(x - 1 == 0, interact=True) # optional - qepcad QEPCAD object in phase 'Before Normalization' """ - return "QEPCAD object in phase '{}'".format(self.phase()) + return f"QEPCAD object in phase '{self.phase()}'" def assume(self, assume): r""" @@ -1036,7 +1038,7 @@ def set_truth_value(self, index, nv): sage: qe.set_truth_value(1, 1) # optional - qepcad """ index_str = _format_cell_index([index]) - self._eval_line('set-truth-value\n%s\n%s' % (index_str, nv)) + self._eval_line(f'set-truth-value\n{index_str}\n{nv}') def phase(self): r""" @@ -1320,7 +1322,7 @@ def _function_call(self, name, args): name = name.replace('_', '-') args = [str(_) for _ in args] pre_phase = self.phase() - result = self._eval_line('%s %s' % (name, ' '.join(args))) + result = self._eval_line('{} {}'.format(name, ' '.join(args))) post_phase = self.phase() if len(result) and post_phase != 'EXITED': return AsciiArtString(result) @@ -1329,6 +1331,7 @@ def _function_call(self, name, args): return self.answer() return AsciiArtString("QEPCAD object has moved to phase '%s'" % post_phase) + def _format_cell_index(a): """ Given a tuple (or list, etc.) containing a QEPCAD cell index, return a @@ -1673,7 +1676,7 @@ def qepcad(formula, assume=None, interact=False, solution=None, "infinitely many points") return [c.sample_point_dict() for c in cells] else: - raise ValueError("Unknown solution type ({})".format(solution)) + raise ValueError(f"Unknown solution type ({solution})") def qepcad_console(memcells=None): @@ -1722,6 +1725,7 @@ def qepcad_banner(): banner = bytes_to_str(qex.expect().before) return AsciiArtString(banner) + def qepcad_version(): """ Return a string containing the current QEPCAD version number. @@ -1930,7 +1934,7 @@ def atomic(self, lhs, op='=', rhs=0): op = self._normalize_op(op) - formula = ('%r %s %r' % (lhs, op, rhs)) + formula = (f'{lhs!r} {op} {rhs!r}') formula = formula.replace('*', ' ') vars = self._varset(lhs) | self._varset(rhs) @@ -2285,7 +2289,7 @@ def quantifier(self, kind, v, formula, allow_multi=True): formula = self.formula(formula) if allow_multi and isinstance(v, (list, tuple)): - if len(v) == 0: + if not v: return formula else: return self.quantifier(kind, v[0], @@ -2295,10 +2299,10 @@ def quantifier(self, kind, v, formula, allow_multi=True): if form_str[-1] != ']': form_str = '[' + form_str + ']' v = str(v) - if not (v in formula.vars): + if v not in formula.vars: raise ValueError("Attempting to quantify variable which " "does not occur in formula") - form_str = "(%s %s)%s" % (kind, v, form_str) + form_str = f"({kind} {v}){form_str}" return qformula(form_str, formula.vars - frozenset([v]), [v] + formula.qvars) @@ -2348,8 +2352,7 @@ def _eval_qepcad_algebraic(text): if intv.lower().exact_rational() == lbound and intv.upper().exact_rational() == ubound: return AA.polynomial_root(p, intv) - raise ValueError("%s or %s not an exact floating-point number" % (lbound, - ubound)) + raise ValueError(f"{lbound} or {ubound} not an exact floating-point number") class QepcadCell: @@ -2420,7 +2423,7 @@ def __init__(self, parent, lines): if 'Information about the cell' in line: tail = line.split('(')[1] index = tail.split(')')[0] - if index == '': + if not index: index = () else: index = sage_eval(index) @@ -2438,7 +2441,7 @@ def __init__(self, parent, lines): else: self._number_of_children = None if 'Truth value' in line: - pass # might change + pass # might change if 'Degrees after substitution' in line: if self._level == max_level or self._level == 0: self._degrees = None @@ -2452,7 +2455,7 @@ def __init__(self, parent, lines): (lev, n, colon, signs) = line.split() assert lev == 'Level' and colon == ':' assert int(n) == len(all_signs) + 1 - signs = signs.replace('+','1').replace('-','-1').replace(')',',)') + signs = signs.replace('+', '1').replace('-', '-1').replace(')', ',)') all_signs.append(sage_eval(signs)) if 'PRIMITIVE' in line: saw_primitive = True @@ -2751,4 +2754,4 @@ def sample_point_dict(self): """ points = self.sample_point() vars = self._parent._varlist - return dict([(vars[i], points[i]) for i in range(len(points))]) + return {vars[i]: points[i] for i in range(len(points))} From ea895f13fe805971fc27392de7b613aa187cac73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Chapoton?= Date: Thu, 23 Nov 2023 10:54:21 +0100 Subject: [PATCH 022/145] a few minor details in interfaces (mathics, polymake, mathematica, etc) --- src/sage/interfaces/expect.py | 2 +- src/sage/interfaces/interface.py | 2 +- src/sage/interfaces/mathematica.py | 2 +- src/sage/interfaces/mathics.py | 22 +++++++++++----------- src/sage/interfaces/maxima_abstract.py | 4 ++-- src/sage/interfaces/polymake.py | 14 +++----------- 6 files changed, 19 insertions(+), 27 deletions(-) diff --git a/src/sage/interfaces/expect.py b/src/sage/interfaces/expect.py index 17ad63cfbac..d7ce4da3ad7 100644 --- a/src/sage/interfaces/expect.py +++ b/src/sage/interfaces/expect.py @@ -778,7 +778,7 @@ def _get_tmpfile_from_server(self, local_file=None, remote_file=None): os.system(cmd) def _remove_tmpfile_from_server(self): - if not (self.__remote_tmpfile is None): + if self.__remote_tmpfile is not None: raise NotImplementedError def _eval_line_using_file(self, line, restart_if_needed=True): diff --git a/src/sage/interfaces/interface.py b/src/sage/interfaces/interface.py index 78f94269ff4..652d29a890c 100644 --- a/src/sage/interfaces/interface.py +++ b/src/sage/interfaces/interface.py @@ -1016,7 +1016,7 @@ def __del__(self): return if hasattr(self,'_name'): P = self.parent() - if not (P is None): + if P is not None: P.clear(self._name) def _sage_repr(self): diff --git a/src/sage/interfaces/mathematica.py b/src/sage/interfaces/mathematica.py index 9c6e3ca86e9..b283d7e2ee3 100644 --- a/src/sage/interfaces/mathematica.py +++ b/src/sage/interfaces/mathematica.py @@ -1191,7 +1191,7 @@ def request_wolfram_alpha(input, verbose=False): resp = opener.open(req) # the website returns JSON containing the code page_data = json.loads(resp.read().decode("utf-8")) - if not ("code" in page_data): + if "code" not in page_data: raise ValueError("Wolfram did not return a code") proxy_code = page_data['code'] if verbose: diff --git a/src/sage/interfaces/mathics.py b/src/sage/interfaces/mathics.py index 0bf0bc78829..6e7947f8abe 100644 --- a/src/sage/interfaces/mathics.py +++ b/src/sage/interfaces/mathics.py @@ -586,7 +586,7 @@ def set(self, var, value): sage: bool(mathics('u').sage() == 2*x+e) # optional - mathics True """ - cmd = '%s=%s;' % (var, value) + cmd = f'{var}={value};' _ = self.eval(cmd) def get(self, var): @@ -610,7 +610,7 @@ def _function_call_string(self, function, args, kwds): sage: mathics._function_call_string('Sin', ['x'], []) 'Sin[x]' """ - return "%s[%s]" % (function, ",".join(args)) + return "{}[{}]".format(function, ",".join(args)) def _left_list_delim(self): r""" @@ -894,7 +894,7 @@ def __getitem__(self, n): x 0.15 """ - return self.parent().new('%s[[%s]]' % (self._name, n)) + return self.parent().new(f'{self._name}[[{n}]]') def __getattr__(self, attrname): r""" @@ -928,7 +928,7 @@ def __float__(self, precision=16): True """ P = self.parent() - return float(P._eval('N[%s,%s]' % (self.name(), precision)).last_eval.to_mpmath()) + return float(P._eval(f'N[{self.name()},{precision}]').last_eval.to_mpmath()) def _reduce(self): r""" @@ -1071,9 +1071,9 @@ def _sage_(self, locals={}): if self is not p and p is not None: def conv(i): return self.parent()(i).sage() - if type(p) is list: + if isinstance(p, list): return [conv(i) for i in p] - elif type(p) is tuple: + elif isinstance(p, tuple): return tuple([conv(i) for i in p]) elif type(p) is dict: return {conv(k): conv(v) for k, v in p.items()} @@ -1130,7 +1130,7 @@ def save_image(self, filename, ImageSize=600): if not self._is_graphics(): raise ValueError('mathics expression is not graphics') filename = os.path.abspath(filename) - s = 'Export["%s", %s, ImageSize->%s]' % (filename, self.name(), ImageSize) + s = f'Export["{filename}", {self.name()}, ImageSize->{ImageSize}]' P.eval(s) def _rich_repr_(self, display_manager, **kwds): @@ -1214,11 +1214,11 @@ def _richcmp_(self, other, op): False """ P = self.parent() - if str(P("%s < %s" % (self.name(), other.name()))) == P._true_symbol(): + if str(P(f"{self.name()} < {other.name()}")) == P._true_symbol(): return rich_to_bool(op, -1) - elif str(P("%s > %s" % (self.name(), other.name()))) == P._true_symbol(): + elif str(P(f"{self.name()} > {other.name()}")) == P._true_symbol(): return rich_to_bool(op, 1) - elif str(P("%s == %s" % (self.name(), other.name()))) == P._true_symbol(): + elif str(P(f"{self.name()} == {other.name()}")) == P._true_symbol(): return rich_to_bool(op, 0) return NotImplemented @@ -1239,7 +1239,7 @@ def __bool__(self): True """ P = self._check_valid() - cmd = '%s===%s' % (self._name, P._false_symbol()) + cmd = f'{self._name}==={P._false_symbol()}' return not str(P(cmd)) == P._true_symbol() def n(self, *args, **kwargs): diff --git a/src/sage/interfaces/maxima_abstract.py b/src/sage/interfaces/maxima_abstract.py index 9fe624a7f02..4a5e2ed0ee8 100644 --- a/src/sage/interfaces/maxima_abstract.py +++ b/src/sage/interfaces/maxima_abstract.py @@ -918,9 +918,9 @@ def de_solve_laplace(self, de, vars, ics=None): variables will have these initial conditions automatically imposed. """ - if not (ics is None): + if ics is not None: d = len(ics) - for i in range(0,d-1): + for i in range(d - 1): ic = 'atvalue(diff(%s(%s), %s, %s), %s = %s, %s)' % ( vars[1], vars[0], vars[0], i, vars[0], ics[0], ics[1+i]) self.eval(ic) diff --git a/src/sage/interfaces/polymake.py b/src/sage/interfaces/polymake.py index 9161ebd5377..8c2fa5dc2b4 100644 --- a/src/sage/interfaces/polymake.py +++ b/src/sage/interfaces/polymake.py @@ -28,19 +28,12 @@ import os import re -from .expect import Expect from .interface import (Interface, InterfaceElement, InterfaceFunctionElement) from sage.misc.verbose import get_verbose from sage.misc.cachefunc import cached_method from sage.interfaces.tab_completion import ExtraTabCompletion from sage.structure.richcmp import rich_to_bool -import pexpect -from random import randrange - -from time import sleep -import warnings - _name_pattern = re.compile('SAGE[0-9]+') _available_polymake_answers = { @@ -139,7 +132,6 @@ def __init__(self, seed=None): sage: from sage.interfaces.polymake import PolymakeAbstract sage: PolymakeAbstract() Polymake - """ Interface.__init__(self, "polymake") self._seed = seed @@ -167,7 +159,7 @@ def __reduce__(self): True """ - return reduce_load_Polymake, tuple([]) + return reduce_load_Polymake, () def _object_class(self): """ @@ -280,7 +272,7 @@ def _coerce_impl(self, x, use_special=True): # Convert dictionaries to hashes. # This is an adaptation of the list/tuple code from Interface._coerce_impl A = [] - z = dict() + z = {} cls = self._object_class() def convert(y): @@ -1969,7 +1961,7 @@ def eval(self, code, **kwds): sage: print(polymake.eval('$tmp="abc";\nprint $tmp;')) # optional - jupymake abc - When requesting help, polymake sometimes expect the user to choose + When requesting help, polymake sometimes expects the user to choose from a list. In that situation, we abort with a warning, and show the list from which the user can choose; we could demonstrate this using the :meth:`~sage.interfaces.polymake.PolymakeAbstract.help` method, From 87b8a3b09a1338ba610a9ee96dce2a2c1df33b61 Mon Sep 17 00:00:00 2001 From: Kwankyu Lee Date: Thu, 23 Nov 2023 19:15:43 +0900 Subject: [PATCH 023/145] More edits --- src/doc/en/reference/number_fields/index.rst | 4 ++-- src/sage/rings/number_field/small_primes_of_degree_one.py | 3 ++- src/sage/rings/number_field/totallyreal.pyx | 8 ++++---- src/sage/rings/number_field/totallyreal_data.pyx | 8 ++++---- src/sage/rings/number_field/totallyreal_rel.py | 2 +- 5 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/doc/en/reference/number_fields/index.rst b/src/doc/en/reference/number_fields/index.rst index d63a189f964..a29fe9cc2c3 100644 --- a/src/doc/en/reference/number_fields/index.rst +++ b/src/doc/en/reference/number_fields/index.rst @@ -7,10 +7,9 @@ Number Fields .. toctree:: :maxdepth: 1 - sage/rings/number_field/number_field_base sage/rings/number_field/number_field + sage/rings/number_field/number_field_base sage/rings/number_field/number_field_rel - sage/rings/universal_cyclotomic_field sage/rings/number_field/splitting_field sage/rings/number_field/galois_group @@ -59,6 +58,7 @@ Algebraic Numbers :maxdepth: 1 sage/rings/qqbar + sage/rings/universal_cyclotomic_field Enumeration of Totally Real Fields ---------------------------------- diff --git a/src/sage/rings/number_field/small_primes_of_degree_one.py b/src/sage/rings/number_field/small_primes_of_degree_one.py index 63fccc409ad..2ecfccc057a 100644 --- a/src/sage/rings/number_field/small_primes_of_degree_one.py +++ b/src/sage/rings/number_field/small_primes_of_degree_one.py @@ -73,9 +73,10 @@ AUTHORS: -- Nick Alexander (2008) +- Nick Alexander (2008): initial version - David Loeffler (2009): fixed a bug with relative fields - Maarten Derickx (2017): fixed a bug with number fields not generated by an integral element + """ #***************************************************************************** diff --git a/src/sage/rings/number_field/totallyreal.pyx b/src/sage/rings/number_field/totallyreal.pyx index 04b975f7498..3e591fb1baa 100644 --- a/src/sage/rings/number_field/totallyreal.pyx +++ b/src/sage/rings/number_field/totallyreal.pyx @@ -66,11 +66,11 @@ See also [Mar1980]_. AUTHORS: -- John Voight (2007-09-01): initial version; various optimization tweaks. +- John Voight (2007-09-01): initial version; various optimization tweaks - John Voight (2007-10-09): added DSage module; added pari functions to avoid - recomputations; separated DSage component. -- Craig Citro and John Voight (2007-11-04): additional doctests and type checking. -- Craig Citro and John Voight (2008-02-10): final modifications for submission. + recomputations; separated DSage component +- Craig Citro and John Voight (2007-11-04): additional doctests and type checking +- Craig Citro and John Voight (2008-02-10): final modifications for submission """ diff --git a/src/sage/rings/number_field/totallyreal_data.pyx b/src/sage/rings/number_field/totallyreal_data.pyx index 070df239bc2..58200b2f964 100644 --- a/src/sage/rings/number_field/totallyreal_data.pyx +++ b/src/sage/rings/number_field/totallyreal_data.pyx @@ -4,10 +4,10 @@ Enumeration of totally real fields: data AUTHORS: -- John Voight (2007-09-01): Initial version. -- John Voight (2007-09-19): Various optimization tweaks. -- John Voight (2007-10-09): Improvements: Smyth bound, Lagrange multipliers for b. -- Craig Citro and John Voight (2007-11-04): Type checking and other polishing. +- John Voight (2007-09-01): Initial version +- John Voight (2007-09-19): various optimization tweaks +- John Voight (2007-10-09): improvements: Smyth bound, Lagrange multipliers for b +- Craig Citro and John Voight (2007-11-04): type checking and other polishing """ diff --git a/src/sage/rings/number_field/totallyreal_rel.py b/src/sage/rings/number_field/totallyreal_rel.py index d1e8faf31b7..af44569f167 100644 --- a/src/sage/rings/number_field/totallyreal_rel.py +++ b/src/sage/rings/number_field/totallyreal_rel.py @@ -78,7 +78,7 @@ AUTHORS: -- John Voight (2007-11-03): Initial version. +- John Voight (2007-11-03): initial version """ # **************************************************************************** From 0d98449e3c73e9b96a46d570a03a86b095372200 Mon Sep 17 00:00:00 2001 From: Kwankyu Lee Date: Thu, 23 Nov 2023 22:03:56 +0900 Subject: [PATCH 024/145] Fix doctest --- .../rings/number_field/number_field_ideal.py | 76 +++++++++---------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/src/sage/rings/number_field/number_field_ideal.py b/src/sage/rings/number_field/number_field_ideal.py index 707ee6ea781..26fbf2afbf6 100644 --- a/src/sage/rings/number_field/number_field_ideal.py +++ b/src/sage/rings/number_field/number_field_ideal.py @@ -56,35 +56,50 @@ class NumberFieldIdeal(Ideal_generic): """ An ideal of a number field. + + EXAMPLES:: + + sage: x = polygen(ZZ) + sage: K. = NumberField(x^2 + 1) + sage: K.ideal(7) + Fractional ideal (7) + + Initialization from PARI:: + + sage: K.ideal(pari(7)) + Fractional ideal (7) + sage: K.ideal(pari(4), pari(4 + 2*i)) + Fractional ideal (2) + sage: K.ideal(pari("i + 2")) + Fractional ideal (i + 2) + sage: K.ideal(pari("[3,0;0,3]")) + Fractional ideal (3) + sage: F = pari(K).idealprimedec(5) + sage: K.ideal(F[0]) + Fractional ideal (2*i + 1) + + Check that ``_pari_prime`` is set when initializing from a PARI + prime ideal:: + + sage: K.ideal(pari(K).idealprimedec(5)[0])._pari_prime + [5, [-2, 1]~, 1, 1, [2, -1; 1, 2]] + + Number fields defined by non-monic and non-integral + polynomials are supported (:trac:`252`):: + + sage: K. = NumberField(2*x^2 - 1/3) + sage: I = K.ideal(a); I + Fractional ideal (a) + sage: I.norm() + 1/6 """ def __init__(self, field, gens, coerce=True): """ INPUT: - - ``field`` -- a number field + - ``field`` -- a number field - - ``x`` -- a list of :class:`NumberFieldElement` objects belonging to the field - - EXAMPLES:: - - sage: x = polygen(ZZ) - sage: K. = NumberField(x^2 + 1) - sage: K.ideal(7) - Fractional ideal (7) - - Initialization from PARI:: - - sage: K.ideal(pari(7)) - Fractional ideal (7) - sage: K.ideal(pari(4), pari(4 + 2*i)) - Fractional ideal (2) - sage: K.ideal(pari("i + 2")) - Fractional ideal (i + 2) - sage: K.ideal(pari("[3,0;0,3]")) - Fractional ideal (3) - sage: F = pari(K).idealprimedec(5) - sage: K.ideal(F[0]) - Fractional ideal (2*i + 1) + - ``gens`` -- a list of :class:`NumberFieldElement` objects belonging to the field TESTS: @@ -95,21 +110,6 @@ def __init__(self, field, gens, coerce=True): sage: I = K.ideal(2/(5+a)) sage: I == loads(dumps(I)) True - - Check that ``_pari_prime`` is set when initializing from a PARI - prime ideal:: - - sage: K.ideal(pari(K).idealprimedec(5)[0])._pari_prime - [5, [-2, 1]~, 1, 1, [2, -1; 1, 2]] - - Number fields defined by non-monic and non-integral - polynomials are supported (:trac:`252`):: - - sage: K. = NumberField(2*x^2 - 1/3) - sage: I = K.ideal(a); I - Fractional ideal (a) - sage: I.norm() - 1/6 """ from .number_field import NumberField_generic if not isinstance(field, NumberField_generic): From f1bf457812f36381fbfe0f724ebc974637caa237 Mon Sep 17 00:00:00 2001 From: Kwankyu Lee Date: Thu, 23 Nov 2023 22:07:13 +0900 Subject: [PATCH 025/145] Put TESTS: --- src/sage/rings/number_field/number_field_ideal.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/sage/rings/number_field/number_field_ideal.py b/src/sage/rings/number_field/number_field_ideal.py index 26fbf2afbf6..19c9e95ed39 100644 --- a/src/sage/rings/number_field/number_field_ideal.py +++ b/src/sage/rings/number_field/number_field_ideal.py @@ -78,6 +78,8 @@ class NumberFieldIdeal(Ideal_generic): sage: K.ideal(F[0]) Fractional ideal (2*i + 1) + TESTS: + Check that ``_pari_prime`` is set when initializing from a PARI prime ideal:: From 28a7848435e664e74ef9f22be8b546ab7d62eee7 Mon Sep 17 00:00:00 2001 From: Dima Pasechnik Date: Tue, 14 Nov 2023 10:06:39 +0000 Subject: [PATCH 026/145] rectify docs around Tkinter Will fix #36710 --- src/doc/en/faq/faq-usage.rst | 8 +++++--- src/doc/en/installation/source.rst | 24 +++++++++++++++++++----- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/src/doc/en/faq/faq-usage.rst b/src/doc/en/faq/faq-usage.rst index a495ad7f4cc..45bc85e1ba7 100644 --- a/src/doc/en/faq/faq-usage.rst +++ b/src/doc/en/faq/faq-usage.rst @@ -93,8 +93,10 @@ How to get Sage's Python to recognize my system's Tcl/Tk install? """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" It may be that you have Tcl/Tk installed and that your system's Python -recognizes it but Sage's Python does not. To fix that, install the -tcl/tk development library. On Ubuntu, this is the command +recognizes it but Sage's Python does not. Normally speaking, there is little +need to build Sage's Python nowadays (anno 2023), but if you do, here it is. +Make sure you installed the tcl/tk development library. On Ubuntu, this is the +command .. CODE-BLOCK:: shell-session @@ -104,7 +106,7 @@ or something along that line. Next, reinstall Sage's Python: .. CODE-BLOCK:: shell-session - $ sage -f python3 + $ make python3-clean python3-uninstall && make python3 This will pick up the tcl/tk library automatically. After successfully reinstalling Sage's Python, from within the Sage command line interface, diff --git a/src/doc/en/installation/source.rst b/src/doc/en/installation/source.rst index b16fd8e7295..8aa6fd6add2 100644 --- a/src/doc/en/installation/source.rst +++ b/src/doc/en/installation/source.rst @@ -446,13 +446,25 @@ If you don't want conda to be used by sage, deactivate conda (for the current sh operating system, or its own compilers. -Tcl/Tk -^^^^^^ +Tcl/Tk (and system's Python) +^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +If you want to use `Tcl/Tk `_ libraries in Sage, and you +are going to use your OS's Python3 as Sage's Python, you merely need to install +its **Tkinter** module. On Lunix systems, it is usually provided by the +**python3-tk** or a similarly named (e.g. **python3-tkinter**) package, +which can be installed using:: + + $ sudo apt-get install python3-tk -If you want to use `Tcl/Tk `_ libraries in Sage, you need -to install the Tcl/Tk and its development headers before building Sage. Sage's -Python will then automatically recognize your system's install of Tcl/Tk. +or similar commands. + +Tcl/Tk (and Sage's own Python) +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +If you want to use `Tcl/Tk `_ libraries in Sage, +and you are going to build Sage's Python from source, you need to install +these, and the corresponding headers. On Linux systems, these are usually provided by the **tk** and **tk-dev** (or **tk-devel**) packages which can be installed using:: @@ -460,6 +472,8 @@ On Linux systems, these are usually provided by the **tk** and **tk-dev** or similar commands. + +Sage's Python will then automatically recognize your system's install of Tcl/Tk. If you installed Sage first, all is not lost. You just need to rebuild Sage's Python and any part of Sage relying on it:: From 949e6e41748389fa1cc473534d6a10e22d0ca7e9 Mon Sep 17 00:00:00 2001 From: Matteo Cati Date: Tue, 14 Nov 2023 21:06:35 +0000 Subject: [PATCH 027/145] Update italian faq --- src/doc/it/faq/faq-usage.rst | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/doc/it/faq/faq-usage.rst b/src/doc/it/faq/faq-usage.rst index a13048eb71d..37bef7b13c1 100644 --- a/src/doc/it/faq/faq-usage.rst +++ b/src/doc/it/faq/faq-usage.rst @@ -81,15 +81,16 @@ Come posso far riconoscere la mia attuale installazione di Tcl/Tk all'interprete """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" Potresti avere la libreria Tcl/Tk installata e l'interprete Python del -tuo sistema la riconosce ma l'interprete Python di Sage no. -Per risolvere questo ti basta installare la libreria di sviluppo -Tcl/Tk. Su Ubuntu lancia, da riga di comando:: +tuo sistema la riconosce ma l'interprete Python di Sage no. Ad oggi (2023) +solitamente non c'è bisogno di compilare l'interprete Python di Sage, ma se ne +hai bisogno, segui queste istruzioni. Controlla di aver installato la libreria +di sviluppp Tcl/Tk. Su Ubuntu lancia, da riga di comando:: sudo apt-get install tk8.5-dev o qualcosa di simile. Poi reinstalla l'interprete Python di Sage con:: - sage -f python + make python3-clean python3-uninstall && make python3 Questo aggancerà automaticamente la libreria Tcl/Tk. Dopo aver reinstallato correttamente l'interprete Python di Sage, From c45d735fbd0f5d6399a64a20e928b639616c1e97 Mon Sep 17 00:00:00 2001 From: Dima Pasechnik Date: Thu, 23 Nov 2023 14:32:23 +0000 Subject: [PATCH 028/145] capitalise tcl/tk --- src/doc/en/faq/faq-usage.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/doc/en/faq/faq-usage.rst b/src/doc/en/faq/faq-usage.rst index 45bc85e1ba7..53f225fd729 100644 --- a/src/doc/en/faq/faq-usage.rst +++ b/src/doc/en/faq/faq-usage.rst @@ -95,7 +95,7 @@ How to get Sage's Python to recognize my system's Tcl/Tk install? It may be that you have Tcl/Tk installed and that your system's Python recognizes it but Sage's Python does not. Normally speaking, there is little need to build Sage's Python nowadays (anno 2023), but if you do, here it is. -Make sure you installed the tcl/tk development library. On Ubuntu, this is the +Make sure you installed the Tcl/Tk development library. On Ubuntu, this is the command .. CODE-BLOCK:: shell-session @@ -108,7 +108,7 @@ or something along that line. Next, reinstall Sage's Python: $ make python3-clean python3-uninstall && make python3 -This will pick up the tcl/tk library automatically. After successfully +This will pick up the Tcl/Tk library automatically. After successfully reinstalling Sage's Python, from within the Sage command line interface, issue these commands: From 504e3b2d0fd3e6c8a4b6a103c091e2066761fd93 Mon Sep 17 00:00:00 2001 From: Dima Pasechnik Date: Thu, 23 Nov 2023 14:34:15 +0000 Subject: [PATCH 029/145] fix typo in source.rst --- src/doc/en/installation/source.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/doc/en/installation/source.rst b/src/doc/en/installation/source.rst index 8aa6fd6add2..c459d17102e 100644 --- a/src/doc/en/installation/source.rst +++ b/src/doc/en/installation/source.rst @@ -451,7 +451,7 @@ Tcl/Tk (and system's Python) If you want to use `Tcl/Tk `_ libraries in Sage, and you are going to use your OS's Python3 as Sage's Python, you merely need to install -its **Tkinter** module. On Lunix systems, it is usually provided by the +its **Tkinter** module. On Linux systems, it is usually provided by the **python3-tk** or a similarly named (e.g. **python3-tkinter**) package, which can be installed using:: From 6b94f6682c3dee2438d58e39ad2e4326f0447d26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Chapoton?= Date: Thu, 23 Nov 2023 19:16:58 +0100 Subject: [PATCH 030/145] suggested details --- src/sage/interfaces/qepcad.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sage/interfaces/qepcad.py b/src/sage/interfaces/qepcad.py index 4079256da5b..534999c47bc 100644 --- a/src/sage/interfaces/qepcad.py +++ b/src/sage/interfaces/qepcad.py @@ -1934,7 +1934,7 @@ def atomic(self, lhs, op='=', rhs=0): op = self._normalize_op(op) - formula = (f'{lhs!r} {op} {rhs!r}') + formula = f'{lhs!r} {op} {rhs!r}' formula = formula.replace('*', ' ') vars = self._varset(lhs) | self._varset(rhs) From 328461eee68833fd14b050d593a24df06984f1e4 Mon Sep 17 00:00:00 2001 From: Kwankyu Lee Date: Fri, 24 Nov 2023 09:13:15 +0900 Subject: [PATCH 031/145] Fix typos --- src/sage/rings/number_field/S_unit_solver.py | 8 ++++---- src/sage/rings/number_field/maps.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/sage/rings/number_field/S_unit_solver.py b/src/sage/rings/number_field/S_unit_solver.py index 9d1d3d39a4a..865308cc76f 100644 --- a/src/sage/rings/number_field/S_unit_solver.py +++ b/src/sage/rings/number_field/S_unit_solver.py @@ -1,10 +1,10 @@ # sage.doctest: needs sage.rings.number_field sage.rings.padics r""" -Solve `S`-unit equation `x + y = 1` +Solve for the `S`-unit equation `x + y = 1` -Inspired by work of Tzanakis--de Weger, Baker--Wustholz and Smart, we use the -LLL methods in Sage to implement an algorithm that returns all `S`-unit -solutions to the equation `x + y = 1`. +Inspired by works of Tzanakis--de Weger, Baker--Wustholz and Smart, we use the +LLL methods to implement an algorithm that returns all `S`-unit solutions to +the equation `x + y = 1`. EXAMPLES:: diff --git a/src/sage/rings/number_field/maps.py b/src/sage/rings/number_field/maps.py index 2eb9e32c1c9..b14c4ca48f3 100644 --- a/src/sage/rings/number_field/maps.py +++ b/src/sage/rings/number_field/maps.py @@ -1,7 +1,7 @@ r""" Structure maps for number fields -Thid module provides isomorphisms between relative and absolute presentations, +This module provides isomorphisms between relative and absolute presentations, to and from vector spaces, name changing maps, etc. EXAMPLES:: From 91bdfcf2f93370982c6f04ca6e9b32909d395a7d Mon Sep 17 00:00:00 2001 From: Kwankyu Lee Date: Fri, 24 Nov 2023 09:24:25 +0900 Subject: [PATCH 032/145] Noun Solver instead of verb Solve --- src/sage/rings/number_field/S_unit_solver.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sage/rings/number_field/S_unit_solver.py b/src/sage/rings/number_field/S_unit_solver.py index 865308cc76f..68ca166f6df 100644 --- a/src/sage/rings/number_field/S_unit_solver.py +++ b/src/sage/rings/number_field/S_unit_solver.py @@ -1,6 +1,6 @@ # sage.doctest: needs sage.rings.number_field sage.rings.padics r""" -Solve for the `S`-unit equation `x + y = 1` +Solver for the `S`-unit equation `x + y = 1` Inspired by works of Tzanakis--de Weger, Baker--Wustholz and Smart, we use the LLL methods to implement an algorithm that returns all `S`-unit solutions to From a9baadcd721f53364513ae4b2e80318946f4a5da Mon Sep 17 00:00:00 2001 From: Ryuhei Mori Date: Fri, 24 Nov 2023 17:31:33 +0900 Subject: [PATCH 033/145] Improve performance of __getitem__ --- src/sage/rings/cfinite_sequence.py | 39 +++++++++++++----------------- 1 file changed, 17 insertions(+), 22 deletions(-) diff --git a/src/sage/rings/cfinite_sequence.py b/src/sage/rings/cfinite_sequence.py index 26cce303581..646626423cd 100644 --- a/src/sage/rings/cfinite_sequence.py +++ b/src/sage/rings/cfinite_sequence.py @@ -391,7 +391,6 @@ def __init__(self, parent, ogf): rem = num % den if den != 1: self._a = R(num / den).list() - self._aa = (rem.valuation() * [0] + R(rem / den).list())[:self._deg] # needed for _get_item_ else: self._a = num.list() if len(self._a) < alen: @@ -650,28 +649,24 @@ def __getitem__(self, key): m = max(key.start, key.stop) return [self[ii] for ii in range(*key.indices(m + 1))] elif isinstance(key, Integral): - from sage.matrix.constructor import Matrix - d = self._deg - if (self._off <= key and key < self._off + len(self._a)): - return self._a[key - self._off] - elif d == 0: - return 0 - (quo, rem) = self.numerator().quo_rem(self.denominator()) - wp = quo[key - self._off] - if key < self._off: - return wp - A = Matrix(QQ, 1, d, self._c) - B = Matrix.identity(QQ, d - 1) - C = Matrix(QQ, d - 1, 1, 0) - if quo == 0: - off = self._off - V = Matrix(QQ, d, 1, self._a[:d][::-1]) + den = self.denominator() + num = self.numerator() + if self._off >= 0: + num = num.shift(-self._off) else: - off = 0 - V = Matrix(QQ, d, 1, self._aa[:d][::-1]) - M = Matrix.block([[A], [B, C]], subdivide=False) - - return wp + list(M ** (key - off) * V)[d - 1][0] + den = den.shift(self._off) + n = key - self._off + if n < 0: + return 0 + (quo, num) = num.quo_rem(den) + P = self.parent().polynomial_ring() + x = self.parent().gen() + m = n + while m: + num = P((num * den(-x)).list()[m % 2::2]) + den = P((den * den(-x)).list()[::2]) + m //= 2 + return quo[n] + num[0] / den[0] else: raise TypeError("invalid argument type") From 30985bc6eda1f8057e651080f11536d984499e34 Mon Sep 17 00:00:00 2001 From: Ryuhei Mori Date: Fri, 24 Nov 2023 18:47:22 +0900 Subject: [PATCH 034/145] __getitem__ with key greater than 64 bits --- src/sage/rings/cfinite_sequence.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/sage/rings/cfinite_sequence.py b/src/sage/rings/cfinite_sequence.py index 646626423cd..b8d76f677d5 100644 --- a/src/sage/rings/cfinite_sequence.py +++ b/src/sage/rings/cfinite_sequence.py @@ -661,12 +661,15 @@ def __getitem__(self, key): (quo, num) = num.quo_rem(den) P = self.parent().polynomial_ring() x = self.parent().gen() - m = n - while m: - num = P((num * den(-x)).list()[m % 2::2]) + if quo.degree() < n: + wp = 0 + else: + wp = quo[n] + while n: + num = P((num * den(-x)).list()[n % 2::2]) den = P((den * den(-x)).list()[::2]) - m //= 2 - return quo[n] + num[0] / den[0] + n //= 2 + return wp + num[0] / den[0] else: raise TypeError("invalid argument type") From db260ba509c2bf7424b1dc7656816b201dc949d4 Mon Sep 17 00:00:00 2001 From: Tobias Diez Date: Fri, 24 Nov 2023 10:27:15 +0000 Subject: [PATCH 035/145] Fix compilation errors --- src/sage/rings/padics/pow_computer_ext.pyx | 4 ++-- src/sage/structure/coerce_dict.pyx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sage/rings/padics/pow_computer_ext.pyx b/src/sage/rings/padics/pow_computer_ext.pyx index babfec6bb70..3f6e8eb875b 100644 --- a/src/sage/rings/padics/pow_computer_ext.pyx +++ b/src/sage/rings/padics/pow_computer_ext.pyx @@ -59,7 +59,7 @@ from cpython.dict cimport * from cysignals.signals cimport sig_on, sig_off -include "sage/libs/ntl/decl.pxi" +include "../../libs/ntl/decl.pxi" from sage.misc.timing import cputime from sage.libs.gmp.mpz cimport * @@ -69,7 +69,7 @@ from sage.libs.ntl.ntl_ZZ cimport ntl_ZZ from sage.libs.ntl.ntl_ZZ_pX cimport ntl_ZZ_pX, ntl_ZZ_pX_Modulus from sage.rings.integer cimport Integer -cdef extern from "ccobject.h": +cdef extern from "../../ext/ccobject.h": ZZ_c* Allocate_ZZ_array "Allocate_array"(size_t n) void Delete_ZZ_array "Delete_array"(ZZ_c* v) ZZ_pX_c* Allocate_ZZ_pX_array "Allocate_array"(size_t n) diff --git a/src/sage/structure/coerce_dict.pyx b/src/sage/structure/coerce_dict.pyx index 8bfb1f9f030..bd0a7808664 100644 --- a/src/sage/structure/coerce_dict.pyx +++ b/src/sage/structure/coerce_dict.pyx @@ -73,7 +73,7 @@ from cysignals.memory cimport check_calloc, sig_free cdef extern from "Python.h": void PyTuple_SET_ITEM(object tuple, Py_ssize_t index, PyObject* item) -cdef extern from "pyx_visit.h": +cdef extern from "../cpython/pyx_visit.h": void Py_VISIT3(PyObject*, visitproc, void*) cdef type KeyedRef, ref From a4a090ca1677429bb8bee3a9863a85f7a57dc0d5 Mon Sep 17 00:00:00 2001 From: Enrique Artal Date: Fri, 24 Nov 2023 14:59:01 +0100 Subject: [PATCH 036/145] erase tailing dots --- src/sage/rings/qqbar.py | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/sage/rings/qqbar.py b/src/sage/rings/qqbar.py index a1e1f0f97ee..e522aa6ffc9 100644 --- a/src/sage/rings/qqbar.py +++ b/src/sage/rings/qqbar.py @@ -2489,7 +2489,9 @@ def conjugate_shrink(v): return v -def number_field_elements_from_algebraics(numbers, minimal=False, same_field=False, embedded=False, name='a', prec=53): +def number_field_elements_from_algebraics(numbers, minimal=False, + same_field=False, + embedded=False, name='a', prec=53): r""" Given a sequence of elements of either ``AA`` or ``QQbar`` (or a mixture), computes a number field containing all of these @@ -2499,20 +2501,20 @@ def number_field_elements_from_algebraics(numbers, minimal=False, same_field=Fal INPUT: - - ``numbers`` -- a number or list of numbers. + - ``numbers`` -- a number or list of numbers - ``minimal`` -- Boolean (default: ``False``). Whether to minimize the - degree of the extension. + degree of the extension - - ``same_field`` -- Boolean (default: ``False``). See below. + - ``same_field`` -- Boolean (default: ``False``). See below - ``embedded`` -- Boolean (default: ``False``). Whether to make the - NumberField embedded. + NumberField embedded - - ``name`` -- string (default: ``'a'``); name of the primitive element. + - ``name`` -- string (default: ``'a'``); name of the primitive element - ``prec`` -- integer (default: ``53``). The number of bit of precision - to guarantee finding real roots. + to guarantee finding real roots OUTPUT: @@ -3260,8 +3262,8 @@ def union(self, other, name='a'): INPUT: - - ``other`` - an algebraic number. - - ``name`` - string (default: ``'a'``); a name for the primitive element. + - ``other`` - an algebraic number + - ``name`` - string (default: ``'a'``); a name for the primitive element EXAMPLES:: From fc3e7888f53b923a107e6fb63db706eb574e773d Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Fri, 24 Nov 2023 06:59:31 -0500 Subject: [PATCH 037/145] build/pkgs/conway_polynomials: update to v0.7 --- build/pkgs/conway_polynomials/SPKG.rst | 22 +++++++++++++++---- build/pkgs/conway_polynomials/checksums.ini | 9 ++++---- .../conway_polynomials/distros/gentoo.txt | 1 + .../conway_polynomials/install-requires.txt | 1 + .../conway_polynomials/package-version.txt | 2 +- .../pkgs/conway_polynomials/spkg-configure.m4 | 3 +++ build/pkgs/conway_polynomials/spkg-install.in | 2 +- build/pkgs/conway_polynomials/spkg-install.py | 20 ----------------- 8 files changed, 30 insertions(+), 30 deletions(-) create mode 100644 build/pkgs/conway_polynomials/distros/gentoo.txt create mode 100644 build/pkgs/conway_polynomials/install-requires.txt create mode 100644 build/pkgs/conway_polynomials/spkg-configure.m4 delete mode 100644 build/pkgs/conway_polynomials/spkg-install.py diff --git a/build/pkgs/conway_polynomials/SPKG.rst b/build/pkgs/conway_polynomials/SPKG.rst index 64a5bad04df..f282bea1e02 100644 --- a/build/pkgs/conway_polynomials/SPKG.rst +++ b/build/pkgs/conway_polynomials/SPKG.rst @@ -1,12 +1,26 @@ -conway_polynomials: Tables of Conway polynomials over finite fields +Python interface to Frank Lübeck's Conway polynomial database =================================================================== Description ----------- -Frank Lübeck's tables of Conway polynomials over finite fields. +This python module evolved from the old SageMath *conway_polynomials* +package once hosted at, -Upstream contact + http://files.sagemath.org/spkg/upstream/conway_polynomials/ + +It's still maintained by Sage developers, but having a pip-installable +interface to the data will make it easier to install SageMath via pip +or another package manager. + + +License +------- + +GPL version 3 or later + + +Upstream Contact ---------------- -http://www.math.rwth-aachen.de/~Frank.Luebeck/data/ConwayPol/ +https://github.com/sagemath/conway-polynomials diff --git a/build/pkgs/conway_polynomials/checksums.ini b/build/pkgs/conway_polynomials/checksums.ini index cedb5575263..ddceaaa769d 100644 --- a/build/pkgs/conway_polynomials/checksums.ini +++ b/build/pkgs/conway_polynomials/checksums.ini @@ -1,4 +1,5 @@ -tarball=conway_polynomials-VERSION.tar.bz2 -sha1=d4d89bda60ac54e73121f84635e774766e19a8b6 -md5=a2725ba21f44554196781424d957f68a -cksum=1387933493 +tarball=conway-polynomials-VERSION.tar.gz +sha1=a822baa014c68ab44f654d8a88b2ea81436a26ef +md5=779cfaad6fc4413fa5b4d5a17e5e9ceb +cksum=634397699 +upstream_url=https://files.pythonhosted.org/packages/source/c/conway-polynomials/conway-polynomials-VERSION.tar.gz diff --git a/build/pkgs/conway_polynomials/distros/gentoo.txt b/build/pkgs/conway_polynomials/distros/gentoo.txt new file mode 100644 index 00000000000..28b8f1b864b --- /dev/null +++ b/build/pkgs/conway_polynomials/distros/gentoo.txt @@ -0,0 +1 @@ +dev-python/conway-polynomials diff --git a/build/pkgs/conway_polynomials/install-requires.txt b/build/pkgs/conway_polynomials/install-requires.txt new file mode 100644 index 00000000000..9f6ba0d94af --- /dev/null +++ b/build/pkgs/conway_polynomials/install-requires.txt @@ -0,0 +1 @@ +conway-polynomials >=0.7 diff --git a/build/pkgs/conway_polynomials/package-version.txt b/build/pkgs/conway_polynomials/package-version.txt index 2eb3c4fe4ee..eb49d7c7fdc 100644 --- a/build/pkgs/conway_polynomials/package-version.txt +++ b/build/pkgs/conway_polynomials/package-version.txt @@ -1 +1 @@ -0.5 +0.7 diff --git a/build/pkgs/conway_polynomials/spkg-configure.m4 b/build/pkgs/conway_polynomials/spkg-configure.m4 new file mode 100644 index 00000000000..f55f76cbe05 --- /dev/null +++ b/build/pkgs/conway_polynomials/spkg-configure.m4 @@ -0,0 +1,3 @@ +SAGE_SPKG_CONFIGURE([conway_polynomials], [ + SAGE_PYTHON_PACKAGE_CHECK([conway_polynomials]) +]) diff --git a/build/pkgs/conway_polynomials/spkg-install.in b/build/pkgs/conway_polynomials/spkg-install.in index a917196c0c4..deba1bb42bb 100644 --- a/build/pkgs/conway_polynomials/spkg-install.in +++ b/build/pkgs/conway_polynomials/spkg-install.in @@ -1 +1 @@ -exec python3 spkg-install.py +cd src && sdh_pip_install . diff --git a/build/pkgs/conway_polynomials/spkg-install.py b/build/pkgs/conway_polynomials/spkg-install.py deleted file mode 100644 index cb192719d63..00000000000 --- a/build/pkgs/conway_polynomials/spkg-install.py +++ /dev/null @@ -1,20 +0,0 @@ -import os -import pickle - -SAGE_SHARE = os.getenv('SAGE_SHARE') -install_root = os.path.join(SAGE_SHARE, 'conway_polynomials') - -def create_db(): - db = {} - from src import conway_polynomials - for p, n, v in conway_polynomials: - if not p in db: - db[p] = {} - db[p][n] = v - if not os.path.exists(install_root): - os.makedirs(install_root) - with open(os.path.join(install_root, 'conway_polynomials.p'), 'wb') as f: - pickle.dump(db, f) - -if __name__ == '__main__': - create_db() From 90decf7b49ee48c1dc2247cdd6e0021d5c121e38 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Fri, 24 Nov 2023 07:15:49 -0500 Subject: [PATCH 038/145] src/sage/databases/conway.py: update for conway-polynomials-0.7 --- src/sage/databases/conway.py | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/src/sage/databases/conway.py b/src/sage/databases/conway.py index 600c5a7c1ff..dc4fc94bbb4 100644 --- a/src/sage/databases/conway.py +++ b/src/sage/databases/conway.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- r""" -Frank Luebeck's tables of Conway polynomials over finite fields +Frank Lübeck's tables of Conway polynomials over finite fields """ # **************************************************************************** # @@ -15,13 +15,9 @@ # https://www.gnu.org/licenses/ # **************************************************************************** from collections.abc import Mapping -import pickle from sage.features.databases import DatabaseConwayPolynomials -_conwaydict = None - - class DictInMapping(Mapping): def __init__(self, dict): """ @@ -95,14 +91,10 @@ def __init__(self): sage: c = ConwayPolynomials() sage: c - Frank Luebeck's database of Conway polynomials + Frank Lübeck's database of Conway polynomials """ - global _conwaydict - if _conwaydict is None: - _CONWAYDATA = DatabaseConwayPolynomials().absolute_filename() - with open(_CONWAYDATA, 'rb') as f: - _conwaydict = pickle.load(f) - self._store = _conwaydict + import conway_polynomials + self._store = conway_polynomials.database() def __repr__(self): """ @@ -112,9 +104,9 @@ def __repr__(self): sage: c = ConwayPolynomials() sage: c.__repr__() - "Frank Luebeck's database of Conway polynomials" + "Frank Lübeck's database of Conway polynomials" """ - return "Frank Luebeck's database of Conway polynomials" + return "Frank Lübeck's database of Conway polynomials" def __getitem__(self, key): """ @@ -152,7 +144,7 @@ def __len__(self): sage: c = ConwayPolynomials() sage: len(c) - 35352 + 35357 """ try: return self._len From bdf36ab2325797004c887e61504a466e499d2178 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Fri, 24 Nov 2023 07:22:11 -0500 Subject: [PATCH 039/145] src/sage/features/databases.py: update for conway-polynomials-0.7 --- src/sage/features/databases.py | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/src/sage/features/databases.py b/src/sage/features/databases.py index f9b297b1e30..3e8acf46759 100644 --- a/src/sage/features/databases.py +++ b/src/sage/features/databases.py @@ -19,15 +19,15 @@ from . import StaticFile, PythonModule from sage.env import ( - CONWAY_POLYNOMIALS_DATA_DIR, CREMONA_MINI_DATA_DIR, CREMONA_LARGE_DATA_DIR, POLYTOPE_DATA_DIR) -class DatabaseConwayPolynomials(StaticFile): +class DatabaseConwayPolynomials(PythonModule): r""" - A :class:`~sage.features.Feature` which describes the presence of :ref:`Frank Luebeck's - database of Conway polynomials `. + A :class:`~sage.features.Feature` which describes the presence of + :ref:`Frank Lübeck's database of Conway polynomials + `. EXAMPLES:: @@ -44,16 +44,13 @@ def __init__(self): sage: isinstance(DatabaseConwayPolynomials(), DatabaseConwayPolynomials) True """ - if CONWAY_POLYNOMIALS_DATA_DIR: - search_path = [CONWAY_POLYNOMIALS_DATA_DIR] - else: - search_path = [] - StaticFile.__init__(self, "conway_polynomials", - filename='conway_polynomials.p', - search_path=search_path, - spkg='conway_polynomials', - description="Frank Luebeck's database of Conway polynomials", - type='standard') + PythonModule.__init__( + self, + "conway_polynomials", + spkg='conway_polynomials', + description="Frank Lübeck's database of Conway polynomials", + type="standard" + ) CREMONA_DATA_DIRS = set([CREMONA_MINI_DATA_DIR, CREMONA_LARGE_DATA_DIR]) From b801eaaec6e5c626b726faa62d85cd8abf2aab74 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Fri, 24 Nov 2023 08:01:36 -0500 Subject: [PATCH 040/145] src/sage/env.py: drop obsolete CONWAY_POLYNOMIALS_DATA_DIR There's now a python package providing a standard interface to this data. --- src/sage/env.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/sage/env.py b/src/sage/env.py index 4515e90e912..16de5bd0bb7 100644 --- a/src/sage/env.py +++ b/src/sage/env.py @@ -195,7 +195,6 @@ def var(key: str, *fallbacks: Optional[str], force: bool = False) -> Optional[st SAGE_PKG_CONFIG_PATH = var("SAGE_PKG_CONFIG_PATH") # installation directories for various packages -CONWAY_POLYNOMIALS_DATA_DIR = var("CONWAY_POLYNOMIALS_DATA_DIR", join(SAGE_SHARE, "conway_polynomials")) GRAPHS_DATA_DIR = var("GRAPHS_DATA_DIR", join(SAGE_SHARE, "graphs")) ELLCURVE_DATA_DIR = var("ELLCURVE_DATA_DIR", join(SAGE_SHARE, "ellcurves")) POLYTOPE_DATA_DIR = var("POLYTOPE_DATA_DIR", join(SAGE_SHARE, "reflexive_polytopes")) From 48d6e9c69108525667fc3d9584d8cc425d0b7b4b Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Fri, 24 Nov 2023 16:27:33 -0500 Subject: [PATCH 041/145] build/pkgs/conway_polynomials/SPKG.rst: fix header Add back the "conway_polynomials: " prefix in the header to fix the package's inclusion into the TOC. --- build/pkgs/conway_polynomials/SPKG.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/pkgs/conway_polynomials/SPKG.rst b/build/pkgs/conway_polynomials/SPKG.rst index f282bea1e02..f5755f505d3 100644 --- a/build/pkgs/conway_polynomials/SPKG.rst +++ b/build/pkgs/conway_polynomials/SPKG.rst @@ -1,5 +1,5 @@ -Python interface to Frank Lübeck's Conway polynomial database -=================================================================== +conway_polynomials: Python interface to Frank Lübeck's Conway polynomial database +================================================================================= Description ----------- From 4b45b63375a4c242bde8ec64dc8e1442772a2bbe Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Fri, 24 Nov 2023 16:32:37 -0500 Subject: [PATCH 042/145] build/pkgs/conway_polynomials/dependencies: add $(PYTHON_TOOLCHAIN) --- build/pkgs/conway_polynomials/dependencies | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/pkgs/conway_polynomials/dependencies b/build/pkgs/conway_polynomials/dependencies index 6b134137610..78d6ec8d5a7 100644 --- a/build/pkgs/conway_polynomials/dependencies +++ b/build/pkgs/conway_polynomials/dependencies @@ -1,4 +1,4 @@ -| $(PYTHON) +| $(PYTHON_TOOLCHAIN) $(PYTHON) ---------- All lines of this file are ignored except the first. From a76e0fdda13881ae91749c16b99986b71f81af99 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Fri, 24 Nov 2023 19:46:39 -0500 Subject: [PATCH 043/145] =?UTF-8?q?src/sage/databases/all.py:=20Luebeck=20?= =?UTF-8?q?->=20L=C3=BCbeck=20to=20match=20conway.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes a failing doctest describing the database. --- src/sage/databases/all.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sage/databases/all.py b/src/sage/databases/all.py index 8f0daa2aac7..a6571c7a5df 100644 --- a/src/sage/databases/all.py +++ b/src/sage/databases/all.py @@ -23,7 +23,7 @@ EXAMPLES:: sage: ConwayPolynomials() - Frank Luebeck's database of Conway polynomials + Frank Lübeck's database of Conway polynomials sage: CremonaDatabase() Cremona's database of elliptic curves with conductor... From bb55f5ee87347756fe15c2f5db8eba5ab703fdcc Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Fri, 24 Nov 2023 19:47:26 -0500 Subject: [PATCH 044/145] =?UTF-8?q?src/sage/features/=5F=5Finit=5F=5F.py:?= =?UTF-8?q?=20Luebeck=20->=20L=C3=BCbeck=20to=20match=20databases.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes a failing doctest for the description of the Conway polynomials database. --- src/sage/features/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sage/features/__init__.py b/src/sage/features/__init__.py index cabd63a1a24..796496d07b5 100644 --- a/src/sage/features/__init__.py +++ b/src/sage/features/__init__.py @@ -254,7 +254,7 @@ def __repr__(self): sage: from sage.features.databases import DatabaseConwayPolynomials sage: DatabaseConwayPolynomials() # indirect doctest - Feature('conway_polynomials': Frank Luebeck's database of Conway polynomials) + Feature('conway_polynomials': Frank Lübeck's database of Conway polynomials) """ description = f'{self.name!r}: {self.description}' if self.description else f'{self.name!r}' return f'Feature({description})' From 2502f519ccd15336a9a2479c8c5ca84ff9001598 Mon Sep 17 00:00:00 2001 From: Tobias Diez Date: Sat, 25 Nov 2023 03:32:46 +0000 Subject: [PATCH 045/145] Reduce executation time of conda workflow --- .github/workflows/ci-conda.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/ci-conda.yml b/.github/workflows/ci-conda.yml index 2240c224a52..2dc4b400ec9 100644 --- a/.github/workflows/ci-conda.yml +++ b/.github/workflows/ci-conda.yml @@ -21,8 +21,6 @@ jobs: runs-on: ${{ matrix.os }} strategy: - fail-fast: ${{ github.event_name == 'pull_request' }} - max-parallel: ${{ github.event_name == 'pull_request' && 2 || 6 }} matrix: os: [ubuntu-latest, macos-latest] python: ['3.9', '3.10', '3.11'] From c5795080f040e54fb617b9cddefb13df3d91e7ba Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Fri, 24 Nov 2023 22:48:12 -0500 Subject: [PATCH 046/145] src/setup.cfg.m4: pull in conway_polynomial's install-requires as deps conway_polynomials is a python package now and can be depended upon via the python tooling. --- src/setup.cfg.m4 | 1 + 1 file changed, 1 insertion(+) diff --git a/src/setup.cfg.m4 b/src/setup.cfg.m4 index 41ac1c08bfa..7a5bfb61c26 100644 --- a/src/setup.cfg.m4 +++ b/src/setup.cfg.m4 @@ -14,6 +14,7 @@ install_requires = SPKG_INSTALL_REQUIRES_sage_conf SPKG_INSTALL_REQUIRES_six dnl From build/pkgs/sagelib/dependencies + SPKG_INSTALL_REQUIRES_conway_polynomials SPKG_INSTALL_REQUIRES_cypari SPKG_INSTALL_REQUIRES_cysignals SPKG_INSTALL_REQUIRES_cython From a2ab364cbc052e144140c9317035b4257fc3180c Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Fri, 24 Nov 2023 22:51:46 -0500 Subject: [PATCH 047/145] src/sage/features: forego detection of conway_polynomials The conway_polynomials package is now a standard python dependency of sagelib and does not need to be detected at runtime. --- src/sage/features/__init__.py | 13 ++++--------- src/sage/features/databases.py | 33 +-------------------------------- 2 files changed, 5 insertions(+), 41 deletions(-) diff --git a/src/sage/features/__init__.py b/src/sage/features/__init__.py index 796496d07b5..be55d44d0c2 100644 --- a/src/sage/features/__init__.py +++ b/src/sage/features/__init__.py @@ -252,9 +252,6 @@ def __repr__(self): sage: GapPackage("grape") # indirect doctest Feature('gap_package_grape') - sage: from sage.features.databases import DatabaseConwayPolynomials - sage: DatabaseConwayPolynomials() # indirect doctest - Feature('conway_polynomials': Frank Lübeck's database of Conway polynomials) """ description = f'{self.name!r}: {self.description}' if self.description else f'{self.name!r}' return f'Feature({description})' @@ -342,11 +339,10 @@ def is_standard(self): EXAMPLES:: - sage: from sage.features.databases import DatabaseCremona, DatabaseConwayPolynomials + sage: from sage.features.databases import DatabaseCremona sage: DatabaseCremona().is_standard() False - sage: DatabaseConwayPolynomials().is_standard() - True + """ if self.name.startswith('sage.'): return True @@ -358,11 +354,10 @@ def is_optional(self): EXAMPLES:: - sage: from sage.features.databases import DatabaseCremona, DatabaseConwayPolynomials + sage: from sage.features.databases import DatabaseCremona sage: DatabaseCremona().is_optional() True - sage: DatabaseConwayPolynomials().is_optional() - False + """ return self._spkg_type() == 'optional' diff --git a/src/sage/features/databases.py b/src/sage/features/databases.py index 3e8acf46759..bca8c094b30 100644 --- a/src/sage/features/databases.py +++ b/src/sage/features/databases.py @@ -23,36 +23,6 @@ POLYTOPE_DATA_DIR) -class DatabaseConwayPolynomials(PythonModule): - r""" - A :class:`~sage.features.Feature` which describes the presence of - :ref:`Frank Lübeck's database of Conway polynomials - `. - - EXAMPLES:: - - sage: from sage.features.databases import DatabaseConwayPolynomials - sage: DatabaseConwayPolynomials().is_present() - FeatureTestResult('conway_polynomials', True) - """ - - def __init__(self): - r""" - TESTS:: - - sage: from sage.features.databases import DatabaseConwayPolynomials - sage: isinstance(DatabaseConwayPolynomials(), DatabaseConwayPolynomials) - True - """ - PythonModule.__init__( - self, - "conway_polynomials", - spkg='conway_polynomials', - description="Frank Lübeck's database of Conway polynomials", - type="standard" - ) - - CREMONA_DATA_DIRS = set([CREMONA_MINI_DATA_DIR, CREMONA_LARGE_DATA_DIR]) @@ -194,8 +164,7 @@ def __init__(self, name='polytopes_db', dirname='Full3D'): def all_features(): - return [DatabaseConwayPolynomials(), - DatabaseCremona(), DatabaseCremona('cremona_mini'), + return [DatabaseCremona(), DatabaseCremona('cremona_mini'), DatabaseJones(), DatabaseKnotInfo(), DatabaseCubicHecke(), From c0dc661b701483338a6a09c9641f31afd9fa19d5 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Sat, 25 Nov 2023 07:35:03 -0500 Subject: [PATCH 048/145] src/sage/databases/conway.py: drop DatabaseConwayPolynomials import The feature detection for Conway polynomials was removed; they're always installed via a python package now. --- src/sage/databases/conway.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/sage/databases/conway.py b/src/sage/databases/conway.py index dc4fc94bbb4..b1f76292ce8 100644 --- a/src/sage/databases/conway.py +++ b/src/sage/databases/conway.py @@ -16,8 +16,6 @@ # **************************************************************************** from collections.abc import Mapping -from sage.features.databases import DatabaseConwayPolynomials - class DictInMapping(Mapping): def __init__(self, dict): """ From 0b995ea7ea964c30620c987bbd712519785c2f58 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Sun, 26 Nov 2023 09:31:25 -0500 Subject: [PATCH 049/145] build/bin: drop cygwin support These are pretty obvious: run "git grep -i cygwin build/bin" and then delete the special cases for Cygwin. --- build/bin/sage-apply-patches | 4 ++-- build/bin/sage-bootstrap-python | 8 +++----- build/bin/sage-dist-helpers | 11 ++--------- build/bin/sage-spkg | 33 --------------------------------- build/bin/sage-venv | 14 ++++---------- 5 files changed, 11 insertions(+), 59 deletions(-) diff --git a/build/bin/sage-apply-patches b/build/bin/sage-apply-patches index 522116e4196..a7352a78de4 100755 --- a/build/bin/sage-apply-patches +++ b/build/bin/sage-apply-patches @@ -10,8 +10,8 @@ # the root of the package source. # # An optional patch subdirectory may be specified with the -d flag. -# For example `sage-apply-patches -d cygwin` applies only those -# patches under /cygwin. +# For example `sage-apply-patches -d macos` applies only those +# patches under /macos. # # The -p arg is the argument accepted by the `patch` command, # and overrides the default -p1 diff --git a/build/bin/sage-bootstrap-python b/build/bin/sage-bootstrap-python index 1fa3ea565b1..53cdae3a515 100755 --- a/build/bin/sage-bootstrap-python +++ b/build/bin/sage-bootstrap-python @@ -36,9 +36,7 @@ SAGE_ORIG_PATH=${NEW_PATH%%':'} # a defect of sage_bootstrap on macOS regarding SSL URLs. # Trac #30177: Also check for hashlib.sha1 to guard against broken python2 -# from old homebrew installations. Also check whether the current directory -# is accessible by this python; this is to guard on Cygwin against Pythons -# installed somewhere else in Windows. +# from old homebrew installations. # Trac #29285: Do not accept pythons that manipulate PATH, such as # the shims provided by pyenv. @@ -60,7 +58,7 @@ PYTHONS="python python3 python3.12 python3.11 python3.10 python3.9 python3.8 pyt for PY in $PYTHONS; do PYTHON="$(PATH="$SAGE_ORIG_PATH" command -v $PY)" if [ -n "$PYTHON" ]; then - if CHECK_PATH="$PATH" "$PYTHON" -c "import argparse; import urllib; from hashlib import sha1; from ssl import HAS_SNI; assert HAS_SNI; from os import listdir, environ; listdir(\"$(pwd)\"); assert environ[\"PATH\"] == environ[\"CHECK_PATH\"];" 2>/dev/null; then + if CHECK_PATH="$PATH" "$PYTHON" -c "import argparse; import urllib; from hashlib import sha1; from ssl import HAS_SNI; assert HAS_SNI; from os import environ; assert environ[\"PATH\"] == environ[\"CHECK_PATH\"];" 2>/dev/null; then exec "$PYTHON" "$@" fi fi @@ -69,7 +67,7 @@ done for PY in $PYTHONS; do PYTHON="$(PATH="$SAGE_ORIG_PATH" command -v $PY)" if [ -n "$PYTHON" ]; then - if CHECK_PATH="$PATH" "$PYTHON" -c "import argparse; import urllib; from hashlib import sha1; from os import listdir, environ; listdir(\"$(pwd)\"); assert environ[\"PATH\"] == environ[\"CHECK_PATH\"];" 2>/dev/null; then + if CHECK_PATH="$PATH" "$PYTHON" -c "import argparse; import urllib; from hashlib import sha1; from os import environ; assert environ[\"PATH\"] == environ[\"CHECK_PATH\"];" 2>/dev/null; then exec "$PYTHON" "$@" fi fi diff --git a/build/bin/sage-dist-helpers b/build/bin/sage-dist-helpers index b6259ca9ef1..f08aab31b7f 100644 --- a/build/bin/sage-dist-helpers +++ b/build/bin/sage-dist-helpers @@ -170,16 +170,9 @@ sdh_configure() { if [ -z "$CONFIG_SHELL" ]; then export CONFIG_SHELL=`command -v bash` fi - if [ "$UNAME" = "CYGWIN" ]; then - # TODO: To use --disable-static for all packages on Cygwin, need - # #30814: Cygwin: Fix remaining packages to build shared libraries, using AM_LDFLAGS=-no-undefined - DISABLE_STATIC= - else - DISABLE_STATIC=--disable-static - fi - ./configure --prefix="$SAGE_INST_LOCAL" --libdir="$SAGE_INST_LOCAL/lib" $DISABLE_STATIC --disable-maintainer-mode --disable-dependency-tracking "$@" + ./configure --prefix="$SAGE_INST_LOCAL" --libdir="$SAGE_INST_LOCAL/lib" --disable-static --disable-maintainer-mode --disable-dependency-tracking "$@" if [ $? -ne 0 ]; then # perhaps it is a non-autoconf'd project - ./configure --prefix="$SAGE_INST_LOCAL" --libdir="$SAGE_INST_LOCAL/lib" $DISABLE_STATIC "$@" + ./configure --prefix="$SAGE_INST_LOCAL" --libdir="$SAGE_INST_LOCAL/lib" --disable-static "$@" if [ $? -ne 0 ]; then if [ -f "$(pwd)/config.log" ]; then sdh_die <<_EOF_ diff --git a/build/bin/sage-spkg b/build/bin/sage-spkg index b540c8e866f..415116b8ebf 100755 --- a/build/bin/sage-spkg +++ b/build/bin/sage-spkg @@ -584,26 +584,6 @@ export https_proxy=$http_proxy export ftp_proxy=$http_proxy export rsync_proxy=$http_proxy -################################################################## -# We need to run sage-rebase.sh for each package installed, but it -# can be dangerous to do this while other packages are installing -# so we need to use a lock to manage when rebase is allowed to -# run. Because of this, if multiple sage-spkg runs are waiting on -# the rebase lock, we can end up with multiple consecutive rebase -# calls that are redundant, but I don't see an obvious way around -# that. This also unfortunately slows down parallel builds since -# all packages will eventually need to wait for this lock, but -# again there's no simple way around that. -################################################################## - -if [ "$UNAME" = "CYGWIN" ]; then - # This is a global lock - so we use SAGE_LOCAL, not SAGE_INST_LOCAL. - if [ ! -d "$SAGE_LOCAL/var/lock" ]; then - mkdir -p "$SAGE_LOCAL/var/lock" - fi - exec 200>"$SAGE_LOCAL/var/lock/rebase.lock" - sage-flock -s $lock_type 200 -fi ################################################################## # Actually install @@ -738,19 +718,6 @@ if [ -f spkg-postinst ]; then fi fi -if [ "$UNAME" = "CYGWIN" ]; then - # Drop our sage-spkg's shared lock, and try to call sage-rebase.sh - # under an exclusive lock - sage-flock -u 200 - - # Rebase after installing each package--in case any packages load this - # package at build time we need to ensure during the build that no binaries - # have conflicting address spaces - echo "Waiting for rebase lock" - sage-flock -x "$SAGE_LOCAL/var/lock/rebase.lock" \ - sage-rebase.sh "$SAGE_LOCAL" 2>/dev/null -fi - # Note: spkg-check tests are run after the package has been copied into # SAGE_INST_LOCAL. It might make more sense to run the tests before, but the diff --git a/build/bin/sage-venv b/build/bin/sage-venv index c2728ba1143..8621433f70b 100755 --- a/build/bin/sage-venv +++ b/build/bin/sage-venv @@ -37,19 +37,13 @@ options = parser.parse_args() if options.upgrade and options.clear: raise ValueError('you cannot supply --upgrade and --clear together.') -if sys.platform == 'cygwin': - # default for Cygwin; see https://github.com/sagemath/sage/issues/30149 - use_symlinks = False -else: - # default for posix - # On macOS, definitely need symlinks=True (which matches what we test in build/pkgs/spkg-configure.m4) - # or it may fail with 'dyld: Library not loaded: @executable_path/../Python3' on macOS. - use_symlinks = True - + +# On macOS, definitely need symlinks=True (which matches what we test in build/pkgs/spkg-configure.m4) +# or it may fail with 'dyld: Library not loaded: @executable_path/../Python3' on macOS. b = venv.EnvBuilder(system_site_packages=options.system_site, clear=options.clear, upgrade=options.upgrade, - symlinks=use_symlinks) + symlinks=True) c = b.ensure_directories(options.env_dir) b.setup_python(c) b.create_configuration(c) From ac7b464290f50fc7b38eedcb8439dc5dd564d5e7 Mon Sep 17 00:00:00 2001 From: Dima Pasechnik Date: Sun, 26 Nov 2023 14:52:15 +0000 Subject: [PATCH 050/145] don't need no rebase, no --- src/bin/sage-rebase.bat | 52 -------------------------- src/bin/sage-rebase.sh | 75 -------------------------------------- src/bin/sage-rebaseall.bat | 56 ---------------------------- src/bin/sage-rebaseall.sh | 20 ---------- 4 files changed, 203 deletions(-) delete mode 100755 src/bin/sage-rebase.bat delete mode 100755 src/bin/sage-rebase.sh delete mode 100755 src/bin/sage-rebaseall.bat delete mode 100755 src/bin/sage-rebaseall.sh diff --git a/src/bin/sage-rebase.bat b/src/bin/sage-rebase.bat deleted file mode 100755 index de481343786..00000000000 --- a/src/bin/sage-rebase.bat +++ /dev/null @@ -1,52 +0,0 @@ -@echo off -rem Author: -rem * Jean-Pierre Flori -rem * Erik M. Bray -rem -rem Rebase all dlls in the SAGE_LOCAL directory (and its subdirectories), -rem but do not touch the ones already stored in the system database, -rem and do not update it. -rem Note that subsequent calls to 'rebaseall' will not update the Sage dlls. -rem -rem Invoke this script from a Windows command prompt -rem and, if Cygwin is installed in a non-standard location, -rem adjusting CYGWIN_ROOT. - -setlocal ENABLEEXTENSIONS - -set THIS_BIN=%~dp0 - -rem SAGE_LOCAL should be one level up from the bin/ this script is in -rem This is about the most elegant way to do this I can find thanks -rem http://stackoverflow.com/a/33404867/982257 -call :NORMALIZEPATH "%THIS_BIN%.." -set SAGE_LOCAL=%RETVAL% - -rem Cygwin saves its installation root here -rem If there is more than one Cygwin installation on the system this -rem will just pick up the first one -call :READREGISTRY HKEY_LOCAL_MACHINE\SOFTWARE\Cygwin\setup rootdir -set CYGWIN_ROOT=%RETVAL% - -rem Make sure bash can be called from MSDOS prompt: -path %CYGWIN_ROOT%\bin;%path% -rem Suppress warning about MSDOS-style path: -set CYGWIN=%CYGWIN% nodosfilewarning -rem Call the bash script to do the real work: -cd %SAGE_LOCAL% -bash bin\sage-rebase.sh - - -:: ========== FUNCTIONS ========== -exit /B - -:READREGISTRY - for /F "usebackq skip=2 tokens=3" %%V in (`reg query %1 /v %2 2^>nul`) do ( - set RETVAL=%%V - break - ) - exit /B - -:NORMALIZEPATH - set RETVAL=%~dpfn1 - exit /B diff --git a/src/bin/sage-rebase.sh b/src/bin/sage-rebase.sh deleted file mode 100755 index 21017c704e8..00000000000 --- a/src/bin/sage-rebase.sh +++ /dev/null @@ -1,75 +0,0 @@ -#!/bin/dash - -# Author: -# * Jean-Pierre Flori -# * Gary Zablackis -# * Dmitrii Pasechnik -# * Erik M. Bray -# -# Rebase all dlls in the SAGE_LOCAL directory (and its subdirectories), -# but do not touch the ones already stored in the system database, -# and do not update it. -# Note that subsequent calls to 'rebaseall' will not update the Sage dlls. -# -# Usage: -# -# sage-rebase.sh [--all] [sage_local] [-- additional_flags] -# -# Positional arguments: -# -# sage_local optionally, provide the path to the $SAGE_LOCAL directory to -# search for DLLs to rebase; otherwise the current working -# directory is assumed to be $SAGE_LOCAL unless $SAGE_LOCAL -# is already set in the environment -# -# Optional arguments: -# -# --all run rebaseall instead of rebase (originally the call to -# rebaseall was in the sage-rebaseall.sh script, but now that is -# just a wrapper around this script) -# -# -- additional arguments passed in after -- are passed to the -# rebase/rebaseall call in addition to the default arguments -# passed in by this script -# -# Invoke this script from a shell after going to the SAGE_LOCAL directory. -ALL=0 -REBASEFLAGS="" - -while [ $# -gt 0 ]; do - case "$1" in - --all) - ALL=1 - ;; - --) - shift - REBASEFLAGS="$REBASEFLAGS $1" - ;; - *) - if [ -z "$REBASEFLAGS" ]; then - SAGE_LOCAL="${1%/}" - else - REBASEFLAGS="$REBASEFLAGS $1" - fi - ;; - esac - shift -done - -if [ -z "$SAGE_LOCAL" ]; then - # Assume we are in $SAGE_LOCAL by default (the old behavior of this script) - SAGE_LOCAL=. -fi - -FINDFLAGS="-type f ( -name *.dll -o -name *.so -o -name *.fas ) -print" -FINDFLAGS="$FINDFLAGS -o -path "$SAGE_LOCAL"/var/tmp -prune" - -echo "Getting list of dlls. This may take a while..." -/bin/find "$SAGE_LOCAL" $FINDFLAGS > /tmp/sage-dlls.lst -echo "Now rebasing..." - -if [ $ALL -eq 0 ]; then - /bin/rebase -O -T /tmp/sage-dlls.lst $REBASEFLAGS -else - /bin/rebaseall -s dll -s exe -s so -s fas -T /tmp/sage-dlls.lst $REBASEFLAGS -fi diff --git a/src/bin/sage-rebaseall.bat b/src/bin/sage-rebaseall.bat deleted file mode 100755 index 0ae927f5e64..00000000000 --- a/src/bin/sage-rebaseall.bat +++ /dev/null @@ -1,56 +0,0 @@ -@echo off -rem Authors: -rem * Dmitrii Pasechnik -rem * Jean-Pierre Flori -rem * Erik M. Bray -rem -rem Rebase all dlls in the SAGE_LOCAL directory (and its subdirectories), -rem as well as the ones already stored in the system database, -rem and update the database. -rem This system-wide database is located in '/etc/rebase.db.i386' and -rem includes the Cygwin system dlls. -rem -rem Invoke this script from a Windows command prompt -rem and, if Cygwin is installed in a non-standard location, -rem adjusting CYGWIN_ROOT. -rem -rem Ensure that no other Cygwin processes are currently running. -rem Note that you need write access to the system-wide rebase database -rem (which usually means admin rights). - -set THIS_BIN=%~dp0 - -rem SAGE_LOCAL should be one level up from the bin/ this script is in -rem This is about the most elegant way to do this I can find thanks -rem http://stackoverflow.com/a/33404867/982257 -call :NORMALIZEPATH "%THIS_BIN%.." -set SAGE_LOCAL=%RETVAL% - -rem Cygwin saves its installation root here -rem If there is more than one Cygwin installation on the system this -rem will just pick up the first one -call :READREGISTRY HKEY_LOCAL_MACHINE\SOFTWARE\Cygwin\setup rootdir -set CYGWIN_ROOT=%RETVAL% - -rem Make sure dash can be called from MSDOS prompt: -path %CYGWIN_ROOT%\bin;%path% -rem Suppress warning about MSDOS-style path: -set CYGWIN=%CYGWIN% nodosfilewarning -rem Call the dash script to do the real work: -cd %SAGE_LOCAL% -dash bin\sage-rebaseall.sh - - -:: ========== FUNCTIONS ========== -exit /B - -:READREGISTRY - for /F "usebackq skip=2 tokens=3" %%V in (`reg query %1 /v %2 2^>nul`) do ( - set RETVAL=%%V - break - ) - exit /B - -:NORMALIZEPATH - set RETVAL=%~dpfn1 - exit /B diff --git a/src/bin/sage-rebaseall.sh b/src/bin/sage-rebaseall.sh deleted file mode 100755 index dfdf2e08067..00000000000 --- a/src/bin/sage-rebaseall.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/dash - -# Authors: -# * Gary Zablackis -# * Dmitrii Pasechnik -# * Jean-Pierre Flori -# -# Rebase all dlls in the SAGE_LOCAL directory (and its subdirectories) -# as well as the ones already stored in the system database, -# and update the database. -# This system-wide database is located in '/etc/rebase.db.i386' and -# includes the Cygwin system dlls. -# -# Invoke this script from a dash shell after going to the SAGE_LOCAL directory. -# Ensure that no other Cygwin processes are currently running. -# Note that you need write access to the system-wide rebase database -# (which usually means admin rights). - -DIR=$(dirname "$(readlink -f "$0")") -exec "$DIR"/sage-rebase.sh --all $@ From 6bd341b8bc0fd96120e5c1e0a06ee8a5de771eb4 Mon Sep 17 00:00:00 2001 From: Dima Pasechnik Date: Sun, 26 Nov 2023 14:58:32 +0000 Subject: [PATCH 051/145] no, no rebase - apart from git rebase --- .github/workflows/extract-sage-local.sh | 7 ----- build/pkgs/sagelib/spkg-install | 4 --- src/doc/en/installation/source.rst | 37 ------------------------- src/sage/misc/cython.py | 24 ---------------- src/setup.cfg.m4 | 4 --- 5 files changed, 76 deletions(-) diff --git a/.github/workflows/extract-sage-local.sh b/.github/workflows/extract-sage-local.sh index a7ae987a92c..1d4928aa5bb 100755 --- a/.github/workflows/extract-sage-local.sh +++ b/.github/workflows/extract-sage-local.sh @@ -33,10 +33,3 @@ fi # Show how we are doing on free space. df -h - -# Rebase! -case "$(uname)" in - CYGWIN*) - exec src/bin/sage-rebase.sh --all "$SAGE_LOCAL" - ;; -esac diff --git a/build/pkgs/sagelib/spkg-install b/build/pkgs/sagelib/spkg-install index 730829b3101..b8d92074cf3 100755 --- a/build/pkgs/sagelib/spkg-install +++ b/build/pkgs/sagelib/spkg-install @@ -89,7 +89,3 @@ fi # Trac #33103: The temp.* directories are large after a full build. # We remove them to save space; they are not needed for fast rebuilds. rm -rf build/temp.* - -if [ "$UNAME" = "CYGWIN" ]; then - sage-rebase.sh "$SAGE_VENV" 2>/dev/null; -fi diff --git a/src/doc/en/installation/source.rst b/src/doc/en/installation/source.rst index b16fd8e7295..a13aed9250a 100644 --- a/src/doc/en/installation/source.rst +++ b/src/doc/en/installation/source.rst @@ -377,43 +377,6 @@ Use the following instructions to get started. .. literalinclude:: cygwin-optional.txt -.. NOTE:: - - On Cygwin, at any point in time after building/installing software, - it may be required to "rebase" ``dll`` files. - Sage provides some scripts, located in :file:`$SAGE_LOCAL/bin`, to do so: - - - ``sage-rebaseall.sh``, a shell script which calls Cygwin's - ``rebaseall`` program. It must be run within a ``dash`` shell - from the :envvar:`SAGE_ROOT` directory after all other Cygwin - processes have been shut down and needs write-access to the - system-wide rebase database located at - :file:`/etc/rebase.db.i386`, which usually means administrator - privileges. It updates the system-wide database and adds Sage - dlls to it, so that subsequent calls to ``rebaseall`` will take - them into account. - - - ``sage-rebase.sh``, a shell script which calls Cygwin's ``rebase`` program - together with the ``-O/--oblivious`` option. - It must be run within a shell from :envvar:`SAGE_ROOT` directory. - Contrary to the ``sage-rebaseall.sh`` script, it neither updates the - system-wide database, nor adds Sage dlls to it. - Therefore, subsequent calls to ``rebaseall`` will not take them into account. - - - ``sage-rebaseall.bat`` (respectively ``sage-rebase.bat``), an MS-DOS batch - file which calls the ``sage-rebaseall.sh`` (respectively ``sage-rebase.sh``) - script. - It must be run from a Windows command prompt, after adjusting - :envvar:`SAGE_ROOT` to the Windows location of Sage's home directory, and, if - Cygwin is installed in a non-standard location, adjusting - :envvar:`CYGWIN_ROOT` as well. - - Some systems may encounter this problem frequently enough to make building or - testing difficult. - If executing the above scripts or directly calling ``rebaseall`` does not solve - rebasing issues, deleting the system-wide database and then regenerating it - from scratch, e.g., by executing ``sage-rebaseall.sh``, might help. - Other platforms ^^^^^^^^^^^^^^^ diff --git a/src/sage/misc/cython.py b/src/sage/misc/cython.py index c0c803bf943..13781e2585d 100644 --- a/src/sage/misc/cython.py +++ b/src/sage/misc/cython.py @@ -344,30 +344,6 @@ def cython(filename, verbose=0, compile_message=False, extra_compile_args = ['-w'] # no warnings extra_link_args = [] - if sys.platform == 'cygwin': - # Link using --enable-auto-image-base, reducing the likelihood of the - # new DLL colliding with existing DLLs in memory. - # Note: Cygwin locates --enable-auto-image-base DLLs in the range - # 0x4:00000000 up to 0x6:00000000; this is documented in heap.cc in the - # Cygwin sources, while 0x6:00000000 and up is reserved for the Cygwin - # heap. - # In practice, Sage has enough DLLs that when rebasing everything we - # use up through, approximately, 0x4:80000000 though there is nothing - # precise here. When running 'rebase' it just start from 0x2:00000000 - # (below that is reserved for Cygwin's DLL and some internal - # structures). - # Therefore, to minimize the likelihood of collision with one of Sage's - # standard DLLs, while giving ~2GB (should be more than enough) for - # Sage to grow, we base these DLLs from 0x5:8000000, leaving again ~2GB - # for temp DLLs which in normal use should be more than enough. - # See https://github.com/sagemath/sage/issues/28258 - # It should be noted, this is not a bulletproof solution; there is - # still a potential for DLL overlaps with this. But this reduces the - # probability thereof, especially in normal practice. - dll_filename = os.path.splitext(pyxfile)[0] + '.dll' - image_base = _compute_dll_image_base(dll_filename) - extra_link_args.extend(['-Wl,--disable-auto-image-base', - '-Wl,--image-base=0x{:x}'.format(image_base)]) ext = Extension(name, sources=[pyxfile], diff --git a/src/setup.cfg.m4 b/src/setup.cfg.m4 index 41ac1c08bfa..9f7da4442ef 100644 --- a/src/setup.cfg.m4 +++ b/src/setup.cfg.m4 @@ -85,10 +85,6 @@ scripts = 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 From 002c98400268092abac34816472a52e5dd99a982 Mon Sep 17 00:00:00 2001 From: Dima Pasechnik Date: Sun, 26 Nov 2023 15:26:23 +0000 Subject: [PATCH 052/145] no CYGWIN-related studd from installation scrips and CI --- .github/workflows/cygwin.yml | 151 ------------------ .github/workflows/extract-sage-local.sh | 1 - COPYING.txt | 4 +- build/pkgs/ecl/spkg-install.in | 7 - build/pkgs/eclib/spkg-install.in | 3 - build/pkgs/ecm/spkg-install.in | 6 - build/pkgs/fplll/spkg-check.in | 6 - build/pkgs/fplll/spkg-install.in | 10 -- build/pkgs/gc/spkg-install.in | 5 - build/pkgs/gf2x/SPKG.rst | 2 - build/pkgs/giac/spkg-install.in | 4 - build/pkgs/glpk/SPKG.rst | 3 - .../patches/src/02-cygwin_sharedlib.patch | 56 ------- build/pkgs/gmp/spkg-install.in | 11 +- build/pkgs/jmol/jmol | 5 - build/pkgs/libatomic_ops/spkg-install.in | 4 - build/pkgs/libpng/spkg-install.in | 5 - build/pkgs/mcqd/spkg-install.in | 12 +- build/pkgs/mpc/spkg-install.in | 4 - build/pkgs/mpfr/spkg-install.in | 4 - build/pkgs/ntl/spkg-install.in | 3 - build/pkgs/numpy/spkg-install.in | 5 - build/pkgs/palp/spkg-install.in | 5 - build/pkgs/patch/spkg-install.in | 4 - build/pkgs/ppl/spkg-install.in | 7 - 25 files changed, 4 insertions(+), 323 deletions(-) delete mode 100644 .github/workflows/cygwin.yml delete mode 100644 build/pkgs/glpk/patches/src/02-cygwin_sharedlib.patch diff --git a/.github/workflows/cygwin.yml b/.github/workflows/cygwin.yml deleted file mode 100644 index 26c193dfb2b..00000000000 --- a/.github/workflows/cygwin.yml +++ /dev/null @@ -1,151 +0,0 @@ -name: Reusable workflow for Cygwin - -on: - workflow_call: - inputs: - targets_pre: - default: build/make/Makefile - type: string - targets: - type: string - targets_optional: - default: build/make/Makefile - type: string - prefix: - required: false - default: /opt/sage - type: string - toxenv: - required: false - default: local-cygwin-choco-standard - type: string - # - # For use in multi-stage CIs - # - stage: - required: false - default: main - type: string - previous_stages: - required: false - type: string - # - # For use in upstream CIs - # - upstream_artifact: - required: false - type: string - sage_repo: - required: false - type: string - sage_trac_git: - required: false - type: string - sage_trac_ticket: - required: false - type: string - sage_ref: - required: false - type: string - -jobs: - stage: - env: - MAKE: make -j8 - SAGE_NUM_THREADS: 3 - CYGWIN: winsymlinks:native - EXTRA_CONFIGURE_ARGS: --enable-fat-binary - SAGE_LOCAL: ${{ inputs.prefix }}-${{ github.sha }} - LOCAL_ARTIFACT_NAME: sage-local-commit-${{ github.sha }}-${{ inputs.toxenv }} - LOGS_ARTIFACT_NAME: logs-commit-${{ github.sha }}-${{ inputs.toxenv }} - - runs-on: windows-latest - - steps: - - run: | - git config --global core.autocrlf false - git config --global core.symlinks true - - - name: install cygwin with choco - shell: bash {0} - run: | - choco --version - choco install git python39 python39-pip --source cygwin - - - name: Check out SageMath - uses: actions/checkout@v4 - with: - repository: ${{ inputs.sage_repo }} - ref: ${{ inputs.sage_ref }} - fetch-depth: 2000 - - - name: Check out git-trac-command - uses: actions/checkout@v4 - with: - repository: sagemath/git-trac-command - path: git-trac-command - if: inputs.sage_trac_git != '' - - name: Check out SageMath from trac.sagemath.org - shell: bash {0} - # Random sleep and retry to limit the load on trac.sagemath.org - run: | - git config --global user.email "ci-sage@example.com" - git config --global user.name "ci-sage workflow" - if [ ! -d .git ]; then git init; fi; git remote add trac ${{ inputs.sage_trac_git }} && x=1 && while [ $x -le 5 ]; do x=$(( $x + 1 )); sleep $(( $RANDOM % 60 + 1 )); if git-trac-command/git-trac fetch ${{ inputs.sage_trac_ticket }}; then git merge FETCH_HEAD || echo "(ignored)"; exit 0; fi; sleep 40; done; exit 1 - if: inputs.sage_trac_git != '' - - - name: Download upstream artifact - uses: actions/download-artifact@v3 - with: - path: upstream - name: ${{ inputs.upstream_artifact }} - if: inputs.upstream_artifact - - name: Update Sage packages from upstream artifact - run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && git config --global --add safe.directory $(pwd) && ls -l upstream/ && export PATH="$(pwd)/build/bin:$PATH:/usr/local/bin:/usr/bin" && (cd upstream && bash -x update-pkgs.sh) && git diff' - if: inputs.upstream_artifact - - - name: Download sage-local artifact - uses: actions/download-artifact@v3 - with: - name: ${{ env.LOCAL_ARTIFACT_NAME }} - path: C:\\tools\\cygwin\\tmp - if: inputs.previous_stages - - name: Extract sage-local artifact - run: | - C:\\tools\\cygwin\\bin\\dash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && .github/workflows/extract-sage-local.sh /tmp/sage-local-*.tar && tar --create --listed-incremental=/tmp/sage-local.snar --file /dev/null "${{ env.SAGE_LOCAL }}"' - if: inputs.previous_stages - - name: tox - run: | - C:\\tools\\cygwin\\bin\\bash -l -x -c 'cat /proc/cpuinfo' - C:\\tools\\cygwin\\bin\\bash -l -x -c 'python3.9 -m pip install tox' - C:\\tools\\cygwin\\bin\\bash -l -x -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && PREFIX="${{ env.SAGE_LOCAL }}" TARGETS_PRE="${{ inputs.targets_pre }}" TARGETS_OPTIONAL="${{ inputs.targets_optional }}" tox -e ${{ inputs.toxenv }} -- ${{ inputs.targets }}' - - name: Prepare logs artifact - run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && mkdir -p "artifacts/$LOGS_ARTIFACT_NAME"; for a in "${{ env.SAGE_LOCAL }}"/var/tmp/sage/build/*; do if [ -d "$a" ]; then tar -c --remove-files -f "artifacts/$LOGS_ARTIFACT_NAME/"$(basename "$a")".tar" "$a"; fi; done; cp -r logs/* "artifacts/$LOGS_ARTIFACT_NAME"' - if: always() - - uses: actions/upload-artifact@v3 - with: - path: artifacts - name: ${{ env.LOGS_ARTIFACT_NAME }} - if: always() - - name: Print out logs for immediate inspection - # The markup in the output is a GitHub Actions logging command - # https://help.github.com/en/actions/automating-your-workflow-with-github-actions/development-tools-for-github-actions - shell: bash - run: | - find "artifacts/$LOGS_ARTIFACT_NAME" -type f -name "*.log" -exec sh -c 'if tail -20 "{}" 2>/dev/null | grep "^Error" >/dev/null; then echo :":"error file={}:":" ==== LOG FILE {} CONTAINS AN ERROR ====; cat {} ; fi' \; - if: always() - - name: Prepare sage-local artifact - # We specifically use the cygwin tar so that symlinks are saved/restored correctly on Windows. - # We remove the $SAGE_LOCAL/lib64 link, which will be recreated by the next stage. - run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && rm -f "${{ env.SAGE_LOCAL }}"/lib64; tar -cf /tmp/sage-local-${{ inputs.stage }}.tar --listed-incremental=/tmp/sage-local.snar "${{ env.SAGE_LOCAL }}"' - if: always() - - uses: actions/upload-artifact@v3 - # upload-artifact@v2 does not support whitespace in file names. - # so we tar up the directory ourselves - with: - path: C:\\tools\\cygwin\\tmp\\sage-local-${{ inputs.stage }}.tar - name: ${{ env.LOCAL_ARTIFACT_NAME }} - if: always() diff --git a/.github/workflows/extract-sage-local.sh b/.github/workflows/extract-sage-local.sh index 1d4928aa5bb..cd689926f9d 100755 --- a/.github/workflows/extract-sage-local.sh +++ b/.github/workflows/extract-sage-local.sh @@ -8,7 +8,6 @@ fi # Show all tar files ls -l $* -# Cygwin note: We specifically use the cygwin tar so that symlinks are saved/restored correctly on Windows. for a in $*; do echo Extracting $a (cd / && tar xf -) < $a diff --git a/COPYING.txt b/COPYING.txt index d5c28eacead..f1282bc4890 100644 --- a/COPYING.txt +++ b/COPYING.txt @@ -1229,9 +1229,7 @@ The following software used with SINGULAR have their own copyright: the omalloc library, the readline library, the Gnu Multiple Precision Library (GMP), NTL: A Library for doing Number Theory (NTL), the Multi Protocol library (MP), the Singular-Factory library, the -Singular-libfac library, surfex, and, for the Windows distributions the -Cygwin DLL and the Cygwin tools (Cygwin), and the XEmacs editor -(XEmacs). +Singular-libfac library, surfex, and the XEmacs editor (XEmacs). Their copyrights and licenses can be found in the accompanying files COPYING which are distributed along with these packages. (Since diff --git a/build/pkgs/ecl/spkg-install.in b/build/pkgs/ecl/spkg-install.in index 72083337942..1eb218a2f28 100644 --- a/build/pkgs/ecl/spkg-install.in +++ b/build/pkgs/ecl/spkg-install.in @@ -1,12 +1,5 @@ cd src -if [ "$UNAME" = "CYGWIN" ]; then - # Some of ECL's sources rely on GNU-isms that are allowed by default on - # most glibcs, but not in newlib; https://github.com/sagemath/sage/issues/25057 - CFLAGS="$CFLAGS -D_GNU_SOURCE" - CXXFLAGS="$CXXFLAGS -D_GNU_SOURCE" -fi - export CFLAGS export CXXFLAGS export LDFLAGS diff --git a/build/pkgs/eclib/spkg-install.in b/build/pkgs/eclib/spkg-install.in index 1611cfdd27d..2a83bdb5235 100644 --- a/build/pkgs/eclib/spkg-install.in +++ b/build/pkgs/eclib/spkg-install.in @@ -10,9 +10,6 @@ echo "would interfere with new builds..." rm -f "$SAGE_LOCAL"/lib/lib{curvesntl,g0nntl,jcntl,rankntl,mwrank}.* # Delete autotools libraries: rm -f "$SAGE_LOCAL"/lib/lib{e,j}c.* -if [ "$UNAME" = "CYGWIN" ]; then - rm -f "$SAGE_LOCAL"/lib/cyg{e,j}c-*.dll -fi echo "Deleting old include directory..." rm -rf "$SAGE_LOCAL"/include/eclib/ diff --git a/build/pkgs/ecm/spkg-install.in b/build/pkgs/ecm/spkg-install.in index ce58949c8ee..edc6bb2df5f 100644 --- a/build/pkgs/ecm/spkg-install.in +++ b/build/pkgs/ecm/spkg-install.in @@ -73,12 +73,6 @@ else echo "to, or '--with-pic' was given in ECM_CONFIGURE." fi -if [ "$UNAME" == "CYGWIN" ]; then - # Force shared library build only on Cygwin; it will not build otherwise - ECM_CONFIGURE="$ECM_CONFIGURE --enable-shared --disable-static" -fi - - if [ "$SAGE_DEBUG" = yes ]; then # Add debug symbols and disable optimization: echo >&2 "Warning: Setting SAGE_DEBUG=yes completely disables optimization." diff --git a/build/pkgs/fplll/spkg-check.in b/build/pkgs/fplll/spkg-check.in index 4ebb7d714c1..27cd9419538 100644 --- a/build/pkgs/fplll/spkg-check.in +++ b/build/pkgs/fplll/spkg-check.in @@ -1,8 +1,2 @@ cd src - -if [ "$UNAME" = "CYGWIN" ]; then - echo "Disable parallel testing on Cygwin" - MAKE="$MAKE -j1" -fi - $MAKE check diff --git a/build/pkgs/fplll/spkg-install.in b/build/pkgs/fplll/spkg-install.in index dda663d433c..68c0cb70ad2 100644 --- a/build/pkgs/fplll/spkg-install.in +++ b/build/pkgs/fplll/spkg-install.in @@ -2,20 +2,10 @@ cd src || exit INCLUDES="-I$SAGE_LOCAL/include/" -if [ "$UNAME" = "CYGWIN" ]; then - CXXFLAGS="$CXXFLAGS -std=gnu++11" -fi CXXFLAGS="$CXXFLAGS -fPIC $INCLUDES -L$SAGE_LOCAL/lib" CPPFLAGS="$INCLUDES" CONFIGUREFLAGS="--prefix=$SAGE_LOCAL --libdir=$SAGE_LOCAL/lib" -if [ "$UNAME" = "CYGWIN" ]; then - echo "Disable parallel building on Cygwin" - MAKE="$MAKE -j1" - export MAKE - CONFIGUREFLAGS="$CONFIGUREFLAGS --disable-recursive-enum" -fi - if [ "x$SAGE_DEBUG" = "xyes" ]; then CONFIGUREFLAGS="$CONFIGUREFLAGS --enable-debug" fi diff --git a/build/pkgs/gc/spkg-install.in b/build/pkgs/gc/spkg-install.in index f42295bb279..414513794b0 100644 --- a/build/pkgs/gc/spkg-install.in +++ b/build/pkgs/gc/spkg-install.in @@ -2,11 +2,6 @@ cd src GC_CONFIGURE="--enable-large-config" -if [ "$UNAME" = "CYGWIN" ]; then - # See https://github.com/sagemath/sage/issues/22694 - GC_CONFIGURE="$GC_CONFIGURE --enable-threads=posix --enable-handle-fork" -fi - sdh_configure $GC_CONFIGURE sdh_make sdh_make_install diff --git a/build/pkgs/gf2x/SPKG.rst b/build/pkgs/gf2x/SPKG.rst index d8b4694eb45..b31f78b7c48 100644 --- a/build/pkgs/gf2x/SPKG.rst +++ b/build/pkgs/gf2x/SPKG.rst @@ -35,8 +35,6 @@ Special Update/Build Instructions Patches ~~~~~~~ -- 0001-Trac-15014-Let-gf2x-build-a-shared-library-on-Cygwin.patch: pass - -no-undefined flag to libtool. - 0002-tr-portability.patch: backport upstream fix for non-portable tr use - 0003-Improve-detection-of-sse2-support.patch: backport upstream diff --git a/build/pkgs/giac/spkg-install.in b/build/pkgs/giac/spkg-install.in index c20671a7b88..e3eb86e6034 100644 --- a/build/pkgs/giac/spkg-install.in +++ b/build/pkgs/giac/spkg-install.in @@ -51,10 +51,6 @@ if [ "$UNAME" = "Darwin" ]; then echo "OS X Building without Native Language Support" DISABLENLS="--disable-nls" fi -if [ "$UNAME" = "CYGWIN" ]; then - export ac_cv_lib_nauty_main=no - export ac_cv_header_nauty_naututil_h=no -fi sdh_configure --disable-gui --disable-ao "$DISABLENLS" --enable-png=no --disable-samplerate --disable-static --disable-micropy --disable-quickjs diff --git a/build/pkgs/glpk/SPKG.rst b/build/pkgs/glpk/SPKG.rst index 4cabfae0ba1..dde5e8ce8fc 100644 --- a/build/pkgs/glpk/SPKG.rst +++ b/build/pkgs/glpk/SPKG.rst @@ -57,9 +57,6 @@ Patches - All patches below are currently used by spkg-src - src/01-zlib.patch: don't build the included zlib library. -- src/02-cygwin_sharedlib.patch: Let a shared library be built on - Cygwin by - passing the -no-undefined flag to libtool. The numbering reflect the order in which they have been created from glpk pristine's sources diff --git a/build/pkgs/glpk/patches/src/02-cygwin_sharedlib.patch b/build/pkgs/glpk/patches/src/02-cygwin_sharedlib.patch deleted file mode 100644 index c554216ab56..00000000000 --- a/build/pkgs/glpk/patches/src/02-cygwin_sharedlib.patch +++ /dev/null @@ -1,56 +0,0 @@ -diff --git a/configure.ac b/configure.ac -index a65361a..2e86030 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -54,7 +54,7 @@ define([AC_LIBTOOL_LANG_GCJ_CONFIG], [:]) - dnl Check for programs - AC_PROG_CC - AC_PROG_INSTALL --AC_PROG_LIBTOOL -+LT_INIT([win32-dll]) - - dnl Check for math library - AC_CHECK_LIB([m], [exp]) -@@ -101,6 +101,42 @@ else - AC_MSG_RESULT([no]) - fi - -+dnl Configs for Windows DLLs. -+dnl libtool requires "-no-undefined" for win32 dll -+case $host_os in -+ cygwin* | mingw*) -+ if test "$enable_shared" = yes; then -+ NOUNDEFINED=" -no-undefined" -+ if test "$with_gmp" = yes; then -+ AC_MSG_CHECKING(for DLL/static GMP) -+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ -+#include "gmp.h" -+#if !__GMP_LIBGMP_DLL -+# error "Dead man" -+error -+#endif -+ ]], [[]])],[AC_MSG_RESULT(DLL)],[ -+ AC_MSG_RESULT(static) -+ AC_MSG_ERROR([gmp.h isn't a DLL: use --enable-static --disable-shared]) ]) -+ fi -+ fi -+ if test "$enable_static" = yes; then -+ if test "$with_gmp" = yes; then -+ AC_MSG_CHECKING(for DLL/static GMP) -+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ -+#include "gmp.h" -+#if __GMP_LIBGMP_DLL -+# error "Dead man" -+error -+#endif -+ ]], [[]])],[AC_MSG_RESULT(static)],[ -+ AC_MSG_RESULT(DLL) -+ AC_MSG_ERROR([gmp.h is a DLL: use --disable-static --enable-shared]) ]) -+ fi -+ fi -+ ;; -+esac -+ - case $host_os in - darwin* | macosx*) - LIBIODBC="libiodbc.dylib" diff --git a/build/pkgs/gmp/spkg-install.in b/build/pkgs/gmp/spkg-install.in index fa53576f8c6..27ebbd88c6b 100644 --- a/build/pkgs/gmp/spkg-install.in +++ b/build/pkgs/gmp/spkg-install.in @@ -122,15 +122,8 @@ export ABI CFLAGS CXXFLAGS LDFLAGS # Partially redundant, but safe(r). GMP_CONFIGURE="--enable-shared $GMP_CONFIGURE" # Also build the static library to be used by e.g. ECM -# unless we are on Cygwin where we can only build a shared -# or a static library but not both: -if [ "$UNAME" = "CYGWIN" ]; then - echo "Building GMP with the C++ interface and (only) shared libraries." - GMP_CONFIGURE="--enable-cxx $GMP_CONFIGURE --disable-static" -else - echo "Building GMP with the C++ interface and (also) static libraries." - GMP_CONFIGURE="--enable-cxx --enable-static $GMP_CONFIGURE" -fi +echo "Building GMP with the C++ interface and (also) static libraries." +GMP_CONFIGURE="--enable-cxx --enable-static $GMP_CONFIGURE" # If SAGE_FAT_BINARY is enabled, then add --enable-fat to configure # options on Linux x86 systems. On other systems, fat binaries are not diff --git a/build/pkgs/jmol/jmol b/build/pkgs/jmol/jmol index 4c5710099f0..fe1114e27b5 100755 --- a/build/pkgs/jmol/jmol +++ b/build/pkgs/jmol/jmol @@ -7,11 +7,6 @@ if [ ! -f "$JMOL_JAR" ]; then echo >&2 "Jmol.jar not found in $JMOL_HOME" fi -if [ "$UNAME" = "CYGWIN" ]; then - # We are using the native Windows Java so we must provide Windows paths - JMOL_JAR="$(cygpath -w "$JMOL_JAR")" -fi - # May also pass arguments to the Java interpreter, in which case they # should come first in the argument list java -Xmx512m -jar "$JMOL_JAR" $@ diff --git a/build/pkgs/libatomic_ops/spkg-install.in b/build/pkgs/libatomic_ops/spkg-install.in index 4953f4b0c1a..bcf36b76c24 100644 --- a/build/pkgs/libatomic_ops/spkg-install.in +++ b/build/pkgs/libatomic_ops/spkg-install.in @@ -5,10 +5,6 @@ if [ "$SAGE64" = "yes" ]; then export CFLAGS="-m64 $CFLAGS" fi -if [ "$UNAME" = "CYGWIN" ]; then - LIBATOMIC_OPS_CONFIGURE="$LIBATOMIC_OPS_CONFIGURE --enable-shared --disable-static" -fi - sdh_configure --enable-static $LIBATOMIC_OPS_CONFIGURE sdh_make sdh_make_install diff --git a/build/pkgs/libpng/spkg-install.in b/build/pkgs/libpng/spkg-install.in index 75a47f7fca5..95326748188 100644 --- a/build/pkgs/libpng/spkg-install.in +++ b/build/pkgs/libpng/spkg-install.in @@ -6,11 +6,6 @@ export CFLAGS="$CFLAGS -fPIC -g" # Pick up Sage's zlib: export CPPFLAGS="-I$SAGE_LOCAL/include $CPPFLAGS" -# Needed to generate a correct import library -if [ "$UNAME" = "CYGWIN" ]; then - MAKE="$MAKE SYMBOL_PREFIX= " -fi - cd src sdh_configure --enable-shared=yes diff --git a/build/pkgs/mcqd/spkg-install.in b/build/pkgs/mcqd/spkg-install.in index 38e13b69bfc..a866618913e 100644 --- a/build/pkgs/mcqd/spkg-install.in +++ b/build/pkgs/mcqd/spkg-install.in @@ -3,11 +3,6 @@ grep -v "std..cout.*current max" mcqd.h > mcqd2.h mv mcqd2.h mcqd.h case "$UNAME" in -"CYGWIN") - SO_NAME="cygmcqd.dll" - IMPLIB_NAME="libmcqd.dll.a" - MCQD_LDFLAGS="-Wl,--out-implib,$IMPLIB_NAME" - ;; "Darwin") SO_NAME="libmcqd.dylib" ;; @@ -19,12 +14,7 @@ esac $CXX -fPIC -O3 -c mcqd.cpp -o mcqd.o $CXX -shared mcqd.o -o "$SO_NAME" $MCQD_LDFLAGS -if [ "$UNAME" = "CYGWIN" ]; then - sdh_install "$SO_NAME" "$SAGE_LOCAL/bin/" - sdh_install "$IMPLIB_NAME" "$SAGE_LOCAL/lib/" -else - sdh_install "$SO_NAME" "$SAGE_LOCAL/lib/" -fi +sdh_install "$SO_NAME" "$SAGE_LOCAL/lib/" if [ "$UNAME" = "Darwin" ]; then install_name_tool -id ${SAGE_LOCAL}/lib/$SO_NAME \ diff --git a/build/pkgs/mpc/spkg-install.in b/build/pkgs/mpc/spkg-install.in index 3ee37482fd4..b260b531f17 100644 --- a/build/pkgs/mpc/spkg-install.in +++ b/build/pkgs/mpc/spkg-install.in @@ -8,10 +8,6 @@ unset CFLAGS EXTRA="" -if [ $UNAME = "CYGWIN" ]; then - EXTRA="--disable-static --enable-shared" -fi - # Building sdh_configure $SAGE_CONFIGURE_GMP $SAGE_CONFIGURE_MPFR $EXTRA sdh_make diff --git a/build/pkgs/mpfr/spkg-install.in b/build/pkgs/mpfr/spkg-install.in index fbd4c59d541..a0ecd15ec43 100644 --- a/build/pkgs/mpfr/spkg-install.in +++ b/build/pkgs/mpfr/spkg-install.in @@ -48,10 +48,6 @@ mpfr_configure() # currently causes problems on a few systems: SAGE_CONF_OPTS="--disable-thread-safe" - if [ "$UNAME" = CYGWIN ]; then - SAGE_CONF_OPTS="$SAGE_CONF_OPTS --disable-static --enable-shared" - fi - ########################################################################### # Pre-configure MPFR with CC and CFLAGS unset: ########################################################################### diff --git a/build/pkgs/ntl/spkg-install.in b/build/pkgs/ntl/spkg-install.in index db04aa6b546..a26c3b5026e 100644 --- a/build/pkgs/ntl/spkg-install.in +++ b/build/pkgs/ntl/spkg-install.in @@ -31,9 +31,6 @@ ntl_configure() echo "Setting SHAREDFLAGS to '-fno-common'" SHAREDFLAGS="-fno-common" ;; - CYGWIN) - LIBTOOL_LINK_FLAGS="-no-undefined" - ;; esac # If SAGE_FAT_BINARY is enabled we don't want NTL to be built with CPU- diff --git a/build/pkgs/numpy/spkg-install.in b/build/pkgs/numpy/spkg-install.in index baebfd466a7..38f74b9c7a4 100644 --- a/build/pkgs/numpy/spkg-install.in +++ b/build/pkgs/numpy/spkg-install.in @@ -7,11 +7,6 @@ set -e # -- this also affects numpy export CXX=$(echo "$CXX" | sed 's/-std=[a-z0-9+]*//g') -if [ "$UNAME" = "CYGWIN" ]; then - # Trac #30643 - export CPPFLAGS="${CPPFLAGS} -D_GNU_SOURCE" -fi - if [ "$SAGE_FAT_BINARY" = "yes" ]; then export NUMPY_FCONFIG="--cpu-baseline=NONE" else diff --git a/build/pkgs/palp/spkg-install.in b/build/pkgs/palp/spkg-install.in index f594cc307a9..e31d133daf2 100644 --- a/build/pkgs/palp/spkg-install.in +++ b/build/pkgs/palp/spkg-install.in @@ -5,11 +5,6 @@ cd src mv Global.h Global.h-template CFLAGS="-O3 -W -Wall $CFLAGS -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE" -# On Cygwin the stack size is ridiculously low by default, so that the nef -# executable which allocates everything on the stack for speed reason blows it -if [ "$UNAME" = "CYGWIN" ] ; then - CFLAGS="$CFLAGS -Wl,--stack,8000000" -fi # Undefine NDEBUG. Palp source has assert statements and preprocessing them # away changes the syntactical meaning of the program. diff --git a/build/pkgs/patch/spkg-install.in b/build/pkgs/patch/spkg-install.in index 5e86a881ff1..57f66569cb0 100644 --- a/build/pkgs/patch/spkg-install.in +++ b/build/pkgs/patch/spkg-install.in @@ -10,7 +10,3 @@ cd src sdh_configure sdh_make sdh_make_install - -if [ "$UNAME" = "CYGWIN" ] ; then - cp ../patch.exe.manifest "$SAGE_DESTDIR$SAGE_LOCAL/bin/" -fi diff --git a/build/pkgs/ppl/spkg-install.in b/build/pkgs/ppl/spkg-install.in index 1f3162a6269..c986b3a20c6 100644 --- a/build/pkgs/ppl/spkg-install.in +++ b/build/pkgs/ppl/spkg-install.in @@ -17,12 +17,5 @@ if ! (sdh_configure --enable-interfaces=c,c++ $SAGE_CONFIGURE_GMP \ sdh_configure --enable-interfaces=c++ $SAGE_CONFIGURE_GMP $PPL_CONFIGURE fi -# Workaround to disable PPL's "watchdog timer", preventing it from clobbering -# Cysignals' SIGALRM handler on Cygwin; see -# https://github.com/sagemath/sage/issues/21190 -if [ "$UNAME" = "CYGWIN" ]; then - sed -i 's/#define HAVE_DECL_SETITIMER 1/#define HAVE_DECL_SETITIMER 0/' config.h -fi - sdh_make sdh_make_install From 9e147a12fce0dd8aafacc0095f2590aaeba4ae2c Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sun, 26 Nov 2023 22:39:16 -0800 Subject: [PATCH 053/145] build/pkgs/cython: Update to 3.0.6 --- build/pkgs/cython/checksums.ini | 6 +++--- build/pkgs/cython/package-version.txt | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build/pkgs/cython/checksums.ini b/build/pkgs/cython/checksums.ini index a728e447c9b..8a3547fe2b3 100644 --- a/build/pkgs/cython/checksums.ini +++ b/build/pkgs/cython/checksums.ini @@ -1,5 +1,5 @@ tarball=Cython-VERSION.tar.gz -sha1=9924cb41152a854124c264e2046b3d48ec8207a5 -md5=9bafc611be35748b17a62f47bc479b35 -cksum=1074764487 +sha1=94945822403911b75608fa9689039187686437dd +md5=3b08e76d112619ed9b5bc240b6b53cf4 +cksum=467020180 upstream_url=https://pypi.io/packages/source/C/Cython/Cython-VERSION.tar.gz diff --git a/build/pkgs/cython/package-version.txt b/build/pkgs/cython/package-version.txt index b0f2dcb32fc..818bd47abfc 100644 --- a/build/pkgs/cython/package-version.txt +++ b/build/pkgs/cython/package-version.txt @@ -1 +1 @@ -3.0.4 +3.0.6 From d394b5228006fdff870353f44cc308020928c998 Mon Sep 17 00:00:00 2001 From: Enrique Manuel Artal Bartolo Date: Mon, 27 Nov 2023 07:46:41 +0100 Subject: [PATCH 054/145] Update src/sage/rings/qqbar.py Correct length hyphen Co-authored-by: Travis Scrimshaw --- src/sage/rings/qqbar.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sage/rings/qqbar.py b/src/sage/rings/qqbar.py index e522aa6ffc9..50f0fb393b8 100644 --- a/src/sage/rings/qqbar.py +++ b/src/sage/rings/qqbar.py @@ -3262,8 +3262,8 @@ def union(self, other, name='a'): INPUT: - - ``other`` - an algebraic number - - ``name`` - string (default: ``'a'``); a name for the primitive element + - ``other`` -- an algebraic number + - ``name`` -- string (default: ``'a'``); a name for the primitive element EXAMPLES:: From e6af986b030e8108cdb1206ebda18128bc6676ee Mon Sep 17 00:00:00 2001 From: Dima Pasechnik Date: Mon, 27 Nov 2023 13:09:30 +0000 Subject: [PATCH 055/145] conda now has this package independently of Sage --- build/pkgs/conway_polynomials/distros/conda.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/pkgs/conway_polynomials/distros/conda.txt b/build/pkgs/conway_polynomials/distros/conda.txt index a8228a35e86..3283bb6c3ee 100644 --- a/build/pkgs/conway_polynomials/distros/conda.txt +++ b/build/pkgs/conway_polynomials/distros/conda.txt @@ -1 +1 @@ -sagemath-db-conway-polynomials +conway-polynomials From 3cfec74b6c4224aaed8806df8f02e79e31b39a59 Mon Sep 17 00:00:00 2001 From: Ryuhei Mori Date: Tue, 28 Nov 2023 10:05:06 +0900 Subject: [PATCH 056/145] Small performance improvements --- src/sage/rings/cfinite_sequence.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/sage/rings/cfinite_sequence.py b/src/sage/rings/cfinite_sequence.py index b8d76f677d5..f7da28e046c 100644 --- a/src/sage/rings/cfinite_sequence.py +++ b/src/sage/rings/cfinite_sequence.py @@ -649,25 +649,26 @@ def __getitem__(self, key): m = max(key.start, key.stop) return [self[ii] for ii in range(*key.indices(m + 1))] elif isinstance(key, Integral): + n = key - self._off + if n < 0: + return 0 den = self.denominator() num = self.numerator() if self._off >= 0: num = num.shift(-self._off) else: den = den.shift(self._off) - n = key - self._off - if n < 0: - return 0 (quo, num) = num.quo_rem(den) - P = self.parent().polynomial_ring() - x = self.parent().gen() if quo.degree() < n: wp = 0 else: wp = quo[n] + P = self.parent().polynomial_ring() + x = P.gen() while n: - num = P((num * den(-x)).list()[n % 2::2]) - den = P((den * den(-x)).list()[::2]) + nden = den(-x) + num = P((num * nden).list()[n % 2::2]) + den = P((den * nden).list()[::2]) n //= 2 return wp + num[0] / den[0] else: From 8acab5a3293abd3efcf762948ecde8e78fbbe4ce Mon Sep 17 00:00:00 2001 From: Dima Pasechnik Date: Sun, 26 Nov 2023 22:45:07 +0000 Subject: [PATCH 057/145] more removals --- build/pkgs/iconv/spkg-check.in | 8 +-- build/pkgs/iconv/spkg-install.in | 16 ++---- .../pkgs/pari/patches/prot_none_cygwin.patch | 49 ------------------- .../pkgs/python3/patches/cygwin-ctypes.patch | 16 ------ build/pkgs/python3/spkg-install.in | 4 -- 5 files changed, 9 insertions(+), 84 deletions(-) delete mode 100644 build/pkgs/pari/patches/prot_none_cygwin.patch delete mode 100644 build/pkgs/python3/patches/cygwin-ctypes.patch diff --git a/build/pkgs/iconv/spkg-check.in b/build/pkgs/iconv/spkg-check.in index c0e91eff164..fe8b527f6aa 100644 --- a/build/pkgs/iconv/spkg-check.in +++ b/build/pkgs/iconv/spkg-check.in @@ -1,4 +1,4 @@ -# Only test iconv on Solaris, HP-UX and Cygwin, as those are the only +# Only test iconv on Solaris, HP-UX, as those are the only # platforms on which the iconv shipped with Sage will be installed. On # other platforms Sage uses the system's iconv. @@ -13,7 +13,7 @@ SunOS) echo " http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6550204" esac case "$UNAME" in -CYGWIN|HP-UX|SunOS) +HP-UX|SunOS) cd src @@ -26,10 +26,10 @@ CYGWIN|HP-UX|SunOS) echo "All the tests for iconv passed." exit 0 ;; -*) # Not CYGWIN, HP-UX or SunOS (Solaris) +*) # Not HP-UX or SunOS (Solaris) echo "iconv was not to be tested, since Sage will use the system's iconv" echo "and not the one shipped with Sage." - echo "The iconv supplied by Sage is only used on Cygwin, HP-UX and Solaris." + echo "The iconv supplied by Sage is only used on HP-UX and Solaris." exit 0 esac diff --git a/build/pkgs/iconv/spkg-install.in b/build/pkgs/iconv/spkg-install.in index 89b401c70e9..3c7a3ff3171 100644 --- a/build/pkgs/iconv/spkg-install.in +++ b/build/pkgs/iconv/spkg-install.in @@ -1,22 +1,16 @@ -# Only build iconv on Solaris, HP-UX and Cygwin. See +# Only build iconv on Solaris or HP-UX. See # https://github.com/sagemath/sage/issues/8567 and # https://github.com/sagemath/sage/issues/9603 # for details. case "$UNAME" in -CYGWIN|HP-UX|SunOS) - echo "iconv will be installed as the operating system is Cygwin, HP-UX or Solaris." +HP-UX|SunOS) + echo "iconv will be installed as the operating system is HP-UX or Solaris." echo "These systems either lack iconv, or do not have a sufficiently capable" echo "version of iconv. See:" echo " https://github.com/sagemath/sage/issues/8567" echo " https://github.com/sagemath/sage/issues/9603" - # Disable NLS on Cygwin to be able to build libiconv without the Cygwin - # libiconv package. - if [ "$UNAME" = "CYGWIN" ]; then - ICONV_CONFIGURE="--disable-nls $ICONV_CONFIGURE" - fi - cd src sdh_configure $ICONV_CONFIGURE @@ -24,9 +18,9 @@ CYGWIN|HP-UX|SunOS) sdh_make_install exit 0 ;; -*) # Not CYGWIN, HP-UX or SunOS (Solaris) +*) # Not HP-UX or SunOS (Solaris) echo "iconv will not be installed, as we only need to build it on" - echo "Solaris, HP-UX and Cygwin, as the system's iconv will be used" + echo "Solaris or HP-UX, as the system's iconv will be used" echo "on other platforms, rather than the one shipped with Sage." echo "See:" echo " https://github.com/sagemath/sage/issues/8567" diff --git a/build/pkgs/pari/patches/prot_none_cygwin.patch b/build/pkgs/pari/patches/prot_none_cygwin.patch deleted file mode 100644 index 16340dd492b..00000000000 --- a/build/pkgs/pari/patches/prot_none_cygwin.patch +++ /dev/null @@ -1,49 +0,0 @@ -Fix pari_mainstack_mreset() on Cygwin - -Rejected upstream because Cygwin is considered a dead platform - -diff --git a/src/language/init.c b/src/language/init.c -index 8473a3b..d9993cc 100644 ---- a/src/language/init.c -+++ b/src/language/init.c -@@ -884,8 +884,8 @@ pari_mainstack_mfree(void *s, size_t size) - /* Completely discard the memory mapped between the addresses "from" - * and "to" (which must be page-aligned). - * -- * We use mmap() with PROT_NONE, which means that the underlying memory -- * is freed and that the kernel should not commit memory for it. We -+ * We (generally) use mmap() with PROT_NONE, which means that the underlying -+ * memory is freed and that the kernel should not commit memory for it. We - * still keep the mapping such that we can change the flags to - * PROT_READ|PROT_WRITE later. - * -@@ -893,7 +893,12 @@ pari_mainstack_mfree(void *s, size_t size) - * calling mprotect(..., PROT_NONE) because the latter will keep the - * memory committed (this is in particular relevant on Linux with - * vm.overcommit = 2). This remains true even when calling -- * madvise(..., MADV_DONTNEED). */ -+ * madvise(..., MADV_DONTNEED). -+ * -+ * Unfortunately, the opposite is true on Cygwin--there, calling -+ * mprotect(..., PROT_NONE) does in fact decommit / free the mapped -+ * memory. Meanwhile there is a known bug that prevents already mapped -+ * memory to be re-mapped with MAP_FIXED and different protection flags. */ - static void - pari_mainstack_mreset(pari_sp from, pari_sp to) - { -@@ -902,11 +907,15 @@ pari_mainstack_mreset(pari_sp from, pari_sp to) - if (!s) return; - - addr = (void*)from; -+#ifdef __CYGWIN__ -+ if (mprotect(addr, s, PROT_NONE)) pari_err(e_MEM); -+#else - BLOCK_SIGINT_START; - res = mmap(addr, s, PROT_NONE, - MAP_FIXED|MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE, -1, 0); - BLOCK_SIGINT_END; - if (res != addr) pari_err(e_MEM); -+#endif - } - - /* Commit (make available) the virtual memory mapped between the diff --git a/build/pkgs/python3/patches/cygwin-ctypes.patch b/build/pkgs/python3/patches/cygwin-ctypes.patch deleted file mode 100644 index d3a0cc9053e..00000000000 --- a/build/pkgs/python3/patches/cygwin-ctypes.patch +++ /dev/null @@ -1,16 +0,0 @@ -This patch is needed for the ctypes library to get the correct name of the -libpython DLL, and is related to https://bugs.python.org/issue13756 -diff --git a/Lib/ctypes/__init__.py.orig b/Lib/ctypes/__init__.py -index f870968..8c87b7c 100644 ---- a/Lib/ctypes/__init__.py -+++ b/Lib/ctypes/__init__.py -@@ -431,7 +431,8 @@ pydll = LibraryLoader(PyDLL) - if _os.name == "nt": - pythonapi = PyDLL("python dll", None, _sys.dllhandle) - elif _sys.platform == "cygwin": -- pythonapi = PyDLL("libpython%d.%d.dll" % _sys.version_info[:2]) -+ import sysconfig as _sysconfig -+ pythonapi = PyDLL(_sysconfig.get_config_var('DLLLIBRARY')) - else: - pythonapi = PyDLL(None) - diff --git a/build/pkgs/python3/spkg-install.in b/build/pkgs/python3/spkg-install.in index eae0f39647a..caf91d20c6d 100644 --- a/build/pkgs/python3/spkg-install.in +++ b/build/pkgs/python3/spkg-install.in @@ -59,8 +59,4 @@ fi if [ "$UNAME" = "Darwin" ] && \ [ `uname -r | cut '-d.' -f1` -gt 9 ]; then rm -f "${SAGE_DESTDIR}${PYTHON_CONFIG_DIR}/libpython${PYTHON_LDVERSION}.a" -elif [ "$UNAME" = "CYGWIN" ]; then - # See https://github.com/sagemath/sage/issues/20437 - ln -sf "${PYTHON_CONFIG_DIR}/libpython${PYTHON_LDVERSION}.dll.a" \ - "${SAGE_DESTDIR_LOCAL}/lib/libpython${PYTHON_LDVERSION}.dll.a" fi From df6204810d6ec91c72c6a6616a0ef12390f1de98 Mon Sep 17 00:00:00 2001 From: Dima Pasechnik Date: Sun, 26 Nov 2023 23:05:38 +0000 Subject: [PATCH 058/145] remove easy cygwin things in build and tox.ini --- build/pkgs/giac/patches/cygwin-icas.patch | 23 ------------------- .../ppl/patches/cygwin-weak-symbols.patch | 14 ----------- build/pkgs/readline/spkg-install.in | 3 --- build/pkgs/rpy2/SPKG.rst | 9 -------- build/pkgs/singular/spkg-install.in | 18 +++------------ build/pkgs/tachyon/spkg-install.in | 12 ++-------- build/pkgs/zlib/SPKG.rst | 8 ------- build/pkgs/zlib/patches/cygwin-gzopen_w.patch | 13 ----------- .../pkgs/zlib/patches/cygwin-windef.diff_bin | 9 -------- build/pkgs/zlib/spkg-install.in | 21 ++++------------- tox.ini | 4 ---- 11 files changed, 9 insertions(+), 125 deletions(-) delete mode 100644 build/pkgs/giac/patches/cygwin-icas.patch delete mode 100644 build/pkgs/ppl/patches/cygwin-weak-symbols.patch delete mode 100644 build/pkgs/zlib/patches/cygwin-gzopen_w.patch delete mode 100644 build/pkgs/zlib/patches/cygwin-windef.diff_bin diff --git a/build/pkgs/giac/patches/cygwin-icas.patch b/build/pkgs/giac/patches/cygwin-icas.patch deleted file mode 100644 index 56321e78b26..00000000000 --- a/build/pkgs/giac/patches/cygwin-icas.patch +++ /dev/null @@ -1,23 +0,0 @@ -Disable threaded eval function on Cygwin since it's currently -buggy, and not strictly needed in the first place since we don't -build giac with FLTK support; see https://github.com/sagemath/sage/issues/27385 ---- a/src/icas.cc 2018-12-22 17:08:24.000000000 +0100 -+++ b/src/icas.cc 2019-03-06 14:38:19.814030200 +0100 -@@ -160,7 +160,7 @@ - using namespace giac; - #define STDIN_FILENO 0 - namespace xcas { -- /* -+#ifdef __CYGWIN__ - void icas_eval(giac::gen & g,giac::gen & gg,int & reading_file,std::string &filename,giac::context * contextptr){ - gg=protecteval(g,10,contextptr); - } -@@ -168,7 +168,7 @@ - bool fltk_view(const giac::gen & g,giac::gen & ge,const std::string & filename,std::string & figure_filename,int file_type,const giac::context *contextptr){ - return false; - } -- */ -+#endif - } - - #else diff --git a/build/pkgs/ppl/patches/cygwin-weak-symbols.patch b/build/pkgs/ppl/patches/cygwin-weak-symbols.patch deleted file mode 100644 index 535a009f82d..00000000000 --- a/build/pkgs/ppl/patches/cygwin-weak-symbols.patch +++ /dev/null @@ -1,14 +0,0 @@ -weak symbols don't work properly in 64-bit Cygwin and should not -be used (even though it will compile with __attribute__((weak)), -it will not linke; see https://github.com/sagemath/sage/issues/16152 ---- a/src/assertions.hh 2016-07-26 16:21:22.591434100 +0200 -+++ b/src/assertions.hh 2016-07-26 16:35:09.500888200 +0200 -@@ -98,7 +98,7 @@ - - namespace Parma_Polyhedra_Library { - --#if PPL_CXX_SUPPORTS_ATTRIBUTE_WEAK -+#if PPL_CXX_SUPPORTS_ATTRIBUTE_WEAK && ! (defined(__CYGWIN__) && defined(__x86_64__)) - #define PPL_WEAK_NORETURN __attribute__((weak, noreturn)) - #else - #define PPL_WEAK_NORETURN __attribute__((noreturn)) diff --git a/build/pkgs/readline/spkg-install.in b/build/pkgs/readline/spkg-install.in index 126c4372169..69b4e686d75 100644 --- a/build/pkgs/readline/spkg-install.in +++ b/build/pkgs/readline/spkg-install.in @@ -20,9 +20,6 @@ sdh_make_install case "$UNAME" in Darwin) DYLIB_NAME=libreadline.dylib;; - CYGWIN) - # It is of course very lame that readline names the file .dll.a, but that's what it does. - DYLIB_NAME=libreadline.dll.a;; OpenBSD) # Untested. (David Kirkby, 11th November 2010) # Extension changed from 6.1 to 6.2; still untested. (October 2011) diff --git a/build/pkgs/rpy2/SPKG.rst b/build/pkgs/rpy2/SPKG.rst index a4d119802f1..3ba34445021 100644 --- a/build/pkgs/rpy2/SPKG.rst +++ b/build/pkgs/rpy2/SPKG.rst @@ -21,12 +21,3 @@ Upstream Contact ---------------- - https://rpy2.bitbucket.io - -Special Update/Build Instructions ---------------------------------- - -Patches -~~~~~~~ - -- setup.patch: takes care of a few parsing issues. -- cygwin.patch: let rpy2 build on Cygwin. diff --git a/build/pkgs/singular/spkg-install.in b/build/pkgs/singular/spkg-install.in index c20def91a2f..1c24a5d7ef8 100644 --- a/build/pkgs/singular/spkg-install.in +++ b/build/pkgs/singular/spkg-install.in @@ -40,16 +40,9 @@ remove_old_version() singular_resources # 4.x and up gfan ) - if [ "$UNAME" = "CYGWIN" ]; then - for name in ${libs[*]}; do - rm -f "$SAGE_LOCAL"/bin/cyg${name}*.dll - rm -f "$SAGE_LOCAL"/lib/lib${name}*.a - done - else - for name in ${libs[*]}; do - rm -f "$SAGE_LOCAL"/lib/lib${name}* - done - fi + for name in ${libs[*]}; do + rm -f "$SAGE_LOCAL"/lib/lib${name}* + done rm -f "$SAGE_LOCAL"/lib/p_Procs_Field* # 3.x only rm -rf "$SAGE_LOCAL/share/singular" @@ -58,11 +51,6 @@ remove_old_version() config() { - if [ "$UNAME" = "CYGWIN" ]; then - # from Hans Schoenemann - https://github.com/Singular/Singular/issues/1017 - SINGULAR_CONFIGURE="$SINGULAR_CONFIGURE --disable-p-procs-dynamic --enable-p-procs-static --with-builtinmodules=gfanlib,gitfan,interval,loctriv,partialgb,syzextra,customstd,cohomo,subsets,freealgebra,systhreads --disable-cf-inline --disable-Order-module --disable-bigintm-module --disable-pyobject-module" - fi - # configure notes (dates from Singular 3.x, maybe outdated for 4.x): # 1) We really need to add --exec-prefix and --bindir as Singular # uses some weird defaults. diff --git a/build/pkgs/tachyon/spkg-install.in b/build/pkgs/tachyon/spkg-install.in index ec52842b6a5..5f0d2980dc3 100644 --- a/build/pkgs/tachyon/spkg-install.in +++ b/build/pkgs/tachyon/spkg-install.in @@ -4,9 +4,6 @@ cd "$CUR/src/unix" TARGET="" case "$UNAME" in -"CYGWIN") - TARGET=win32 - ;; "Darwin") TARGET=macosx ;; @@ -59,12 +56,7 @@ sdh_make "$TARGET" echo "Installing the Tachyon binary..." cd "$CUR" -if [ "$UNAME" = CYGWIN ]; then - binary_name=tachyon.exe -else - binary_name=tachyon -fi +binary_name=tachyon -# The '*' is a place-holder for the arch just built (e.g. 'win32' for -# Cygwin, other directories won't exist): +# The '*' is a place-holder for the arch just built: sdh_install src/compile/*/"${binary_name}" "$SAGE_LOCAL/bin" diff --git a/build/pkgs/zlib/SPKG.rst b/build/pkgs/zlib/SPKG.rst index 5a3496935cf..dd001ab087e 100644 --- a/build/pkgs/zlib/SPKG.rst +++ b/build/pkgs/zlib/SPKG.rst @@ -17,11 +17,3 @@ Upstream Contact ---------------- - http://www.zlib.net/ - -Special Update/Build Instructions ---------------------------------- - -Patches -~~~~~~~ - -- cygwin_symbols.patch: remove undefined symbols on Cygwin. diff --git a/build/pkgs/zlib/patches/cygwin-gzopen_w.patch b/build/pkgs/zlib/patches/cygwin-gzopen_w.patch deleted file mode 100644 index 3de4978c306..00000000000 --- a/build/pkgs/zlib/patches/cygwin-gzopen_w.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/gzguts.h b/gzguts.h -index 990a4d2..6378d46 100644 ---- a/gzguts.h -+++ b/gzguts.h -@@ -39,7 +39,7 @@ - # include - #endif - --#if defined(_WIN32) || defined(__CYGWIN__) -+#if defined(_WIN32) - # define WIDECHAR - #endif - diff --git a/build/pkgs/zlib/patches/cygwin-windef.diff_bin b/build/pkgs/zlib/patches/cygwin-windef.diff_bin deleted file mode 100644 index a16ef1ac239..00000000000 --- a/build/pkgs/zlib/patches/cygwin-windef.diff_bin +++ /dev/null @@ -1,9 +0,0 @@ -diff --git a/win32/zlib.def b/win32/zlib.def -index 784b138..b69fa3e 100644 ---- a/win32/zlib.def -+++ b/win32/zlib.def -@@ -91,4 +91,3 @@ EXPORTS - inflateCodesUsed - inflateResetKeep - deflateResetKeep -- gzopen_w diff --git a/build/pkgs/zlib/spkg-install.in b/build/pkgs/zlib/spkg-install.in index 6b21192934b..b70d55e02a2 100644 --- a/build/pkgs/zlib/spkg-install.in +++ b/build/pkgs/zlib/spkg-install.in @@ -1,22 +1,9 @@ cd src/ -echo "patching win32/zlib.def with a binary patch" -patch -p1 --posix --binary <"$SAGE_ROOT/build/pkgs/zlib/patches/cygwin-windef.diff_bin" -if [ "$UNAME" = CYGWIN ]; then - export BINARY_PATH="$SAGE_LOCAL/bin" - export INCLUDE_PATH="$SAGE_LOCAL/include" - export LIBRARY_PATH="$SAGE_LOCAL/lib" - cp -f win32/Makefile.gcc Makefile || \ - sdh_die "Error copying over zlib's Makefile for Cygwin." - - # We want to install shared objects - sed -i 's/SHARED_MODE=0/SHARED_MODE=1/' Makefile -else - # Trac #28890: zlib does not use a standard autoconf-generated configure - # script, so don't use the sdh_configure helper as it may have minor - # incompatibilities - ./configure --shared --prefix="$SAGE_LOCAL" --libdir="$SAGE_LOCAL/lib" || sdh_die "Error configuring $PKG_NAME" -fi +# Trac #28890: zlib does not use a standard autoconf-generated configure +# script, so don't use the sdh_configure helper as it may have minor +# incompatibilities +./configure --shared --prefix="$SAGE_LOCAL" --libdir="$SAGE_LOCAL/lib" || sdh_die "Error configuring $PKG_NAME" sdh_make sdh_make_install diff --git a/tox.ini b/tox.ini index 438c1ca8763..8e8d0852e1c 100644 --- a/tox.ini +++ b/tox.ini @@ -699,10 +699,6 @@ commands = local-conda: bash -c 'case "{env:SKIP_SYSTEM_PKG_INSTALL:}" in 1|y*|Y*);; *) {env:SETENV} && {env:CONDA_PREFIX}/bin/conda update -n base --yes conda;; esac' local-conda: bash -c 'export PATH="build/bin:$PATH" && PACKAGES=$(sage-get-system-packages conda $(sage-package list {env:SAGE_PACKAGE_LIST_ARGS}) {env:ALL_EXTRA_SAGE_PACKAGES}); {env:SETENV} && {env:CONDA_PREFIX}/bin/conda install --yes --quiet $PACKAGES' # - # local-cygwin-choco: Use choco to install cygwin packages - # - local-cygwin-choco: bash -c 'export PATH="build/bin:$PATH" && PACKAGES=$(sage-get-system-packages {env:SYSTEM} $(sage-package list {env:SAGE_PACKAGE_LIST_ARGS}) _bootstrap); /cygdrive/c/ProgramData/Chocolatey/bin/choco install $PACKAGES --source cygwin' - # # local-root: Assume we are root, run the system package commands # local-sudo: Use sudo to run the system package commands as root # From 99099b0240c6c9b5147a5fb446a819b7ed2563ed Mon Sep 17 00:00:00 2001 From: Dima Pasechnik Date: Sun, 26 Nov 2023 23:37:29 +0000 Subject: [PATCH 059/145] remove cygwin stuff in src/, pkgs/, configure.ac --- configure.ac | 1 - pkgs/sage-conf/README.rst | 4 +- pkgs/sage-docbuild/README.rst | 2 +- pkgs/sagemath-bliss/README.rst | 2 +- pkgs/sagemath-categories/README.rst | 2 +- pkgs/sagemath-coxeter3/README.rst | 2 +- pkgs/sagemath-environment/README.rst | 2 +- pkgs/sagemath-mcqd/README.rst | 2 +- pkgs/sagemath-meataxe/README.rst | 2 +- pkgs/sagemath-objects/README.rst | 2 +- pkgs/sagemath-repl/README.rst | 2 +- pkgs/sagemath-sirocco/README.rst | 2 +- pkgs/sagemath-standard/README.rst | 2 +- pkgs/sagemath-tdlib/README.rst | 2 +- src/bin/sage-env | 16 ---- src/doc/bootstrap | 2 +- src/doc/en/developer/git_setup.rst | 4 - src/doc/en/developer/packaging.rst | 3 +- src/doc/en/developer/portability_testing.rst | 7 +- src/doc/en/installation/source.rst | 91 +------------------- src/sage/cpython/__init__.py | 39 --------- src/sage/env.py | 25 ++---- src/sage/interfaces/mathematica.py | 21 ----- src/sage/libs/singular/singular.pyx | 13 ++- src/sage/misc/compat.py | 27 +----- src/sage/misc/cython.py | 86 ------------------ src/sage/misc/inline_fortran.py | 14 ++- src/sage/misc/persist.pyx | 2 - src/sage/misc/sage_ostools.pyx | 42 --------- src/sage/misc/sageinspect.py | 2 - src/sage/misc/timing.py | 3 +- src/sage/misc/viewer.py | 13 --- src/sage_docbuild/utils.py | 8 +- src/sage_setup/library_order.py | 3 +- src/sage_setup/setenv.py | 1 - 35 files changed, 42 insertions(+), 409 deletions(-) diff --git a/configure.ac b/configure.ac index 62d80bc79ca..cbd6e0241d0 100644 --- a/configure.ac +++ b/configure.ac @@ -206,7 +206,6 @@ The Sage community would also appreciate any patches you submit]]);; *-*-linux*);; *-*-darwin*);; *-*-solaris*);; -*-*-cygwin*);; # Wildcard for other unsupported platforms *) diff --git a/pkgs/sage-conf/README.rst b/pkgs/sage-conf/README.rst index 5730592e35a..590e5ba1356 100644 --- a/pkgs/sage-conf/README.rst +++ b/pkgs/sage-conf/README.rst @@ -66,8 +66,8 @@ 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 +following the Filesystem Hierarchy Standard, as well as on macOS. +On multi-user systems, only one user can use a given version of the distribution; other installation schemes are recommended for systems with multiple Sage users. diff --git a/pkgs/sage-docbuild/README.rst b/pkgs/sage-docbuild/README.rst index 16ed52cdd52..178f9f213c9 100644 --- a/pkgs/sage-docbuild/README.rst +++ b/pkgs/sage-docbuild/README.rst @@ -12,7 +12,7 @@ About SageMath https://www.sagemath.org -SageMath fully supports all major Linux distributions, recent versions of macOS, and Windows (using Cygwin or Windows Subsystem for Linux). +SageMath fully supports all major Linux distributions, recent versions of macOS, and Windows (using 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). diff --git a/pkgs/sagemath-bliss/README.rst b/pkgs/sagemath-bliss/README.rst index 9e1cb2e826f..72526111226 100644 --- a/pkgs/sagemath-bliss/README.rst +++ b/pkgs/sagemath-bliss/README.rst @@ -13,7 +13,7 @@ About SageMath https://www.sagemath.org SageMath fully supports all major Linux distributions, recent versions of -macOS, and Windows (using Cygwin or Windows Subsystem for Linux). +macOS, and Windows (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). diff --git a/pkgs/sagemath-categories/README.rst b/pkgs/sagemath-categories/README.rst index 55cddc3c95c..398b5f81a91 100644 --- a/pkgs/sagemath-categories/README.rst +++ b/pkgs/sagemath-categories/README.rst @@ -13,7 +13,7 @@ About SageMath https://www.sagemath.org SageMath fully supports all major Linux distributions, recent versions of -macOS, and Windows (using Cygwin or Windows Subsystem for Linux). +macOS, and Windows (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). diff --git a/pkgs/sagemath-coxeter3/README.rst b/pkgs/sagemath-coxeter3/README.rst index 8b605bda499..c75e83995a3 100644 --- a/pkgs/sagemath-coxeter3/README.rst +++ b/pkgs/sagemath-coxeter3/README.rst @@ -13,7 +13,7 @@ About SageMath https://www.sagemath.org SageMath fully supports all major Linux distributions, recent versions of -macOS, and Windows (using Cygwin or Windows Subsystem for Linux). +macOS, and Windows (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). diff --git a/pkgs/sagemath-environment/README.rst b/pkgs/sagemath-environment/README.rst index eaeb4078fed..a8003060bd9 100644 --- a/pkgs/sagemath-environment/README.rst +++ b/pkgs/sagemath-environment/README.rst @@ -13,7 +13,7 @@ About SageMath https://www.sagemath.org SageMath fully supports all major Linux distributions, recent versions of -macOS, and Windows (using Cygwin or Windows Subsystem for Linux). +macOS, and Windows (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). diff --git a/pkgs/sagemath-mcqd/README.rst b/pkgs/sagemath-mcqd/README.rst index 00ef5f8ea3e..4fcf37ec1a3 100644 --- a/pkgs/sagemath-mcqd/README.rst +++ b/pkgs/sagemath-mcqd/README.rst @@ -13,7 +13,7 @@ About SageMath https://www.sagemath.org SageMath fully supports all major Linux distributions, recent versions of -macOS, and Windows (using Cygwin or Windows Subsystem for Linux). +macOS, and Windows (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). diff --git a/pkgs/sagemath-meataxe/README.rst b/pkgs/sagemath-meataxe/README.rst index 659edb3cf9f..e38540cc304 100644 --- a/pkgs/sagemath-meataxe/README.rst +++ b/pkgs/sagemath-meataxe/README.rst @@ -13,7 +13,7 @@ About SageMath https://www.sagemath.org SageMath fully supports all major Linux distributions, recent versions of -macOS, and Windows (using Cygwin or Windows Subsystem for Linux). +macOS, and Windows (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). diff --git a/pkgs/sagemath-objects/README.rst b/pkgs/sagemath-objects/README.rst index 4426d8683a3..e2959d72eae 100644 --- a/pkgs/sagemath-objects/README.rst +++ b/pkgs/sagemath-objects/README.rst @@ -13,7 +13,7 @@ About SageMath https://www.sagemath.org SageMath fully supports all major Linux distributions, recent versions of -macOS, and Windows (using Cygwin or Windows Subsystem for Linux). +macOS, and Windows (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). diff --git a/pkgs/sagemath-repl/README.rst b/pkgs/sagemath-repl/README.rst index 90b73be3cf5..115614a5d7e 100644 --- a/pkgs/sagemath-repl/README.rst +++ b/pkgs/sagemath-repl/README.rst @@ -13,7 +13,7 @@ About SageMath https://www.sagemath.org SageMath fully supports all major Linux distributions, recent versions of -macOS, and Windows (using Cygwin or Windows Subsystem for Linux). +macOS, and Windows (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). diff --git a/pkgs/sagemath-sirocco/README.rst b/pkgs/sagemath-sirocco/README.rst index 0207d63b9a5..824ca3b03a6 100644 --- a/pkgs/sagemath-sirocco/README.rst +++ b/pkgs/sagemath-sirocco/README.rst @@ -13,7 +13,7 @@ About SageMath https://www.sagemath.org SageMath fully supports all major Linux distributions, recent versions of -macOS, and Windows (using Cygwin or Windows Subsystem for Linux). +macOS, and Windows (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). diff --git a/pkgs/sagemath-standard/README.rst b/pkgs/sagemath-standard/README.rst index f624d1414a7..f429984aa4c 100644 --- a/pkgs/sagemath-standard/README.rst +++ b/pkgs/sagemath-standard/README.rst @@ -12,7 +12,7 @@ About SageMath https://www.sagemath.org -SageMath fully supports all major Linux distributions, recent versions of macOS, and Windows (using Cygwin or Windows Subsystem for Linux). +SageMath fully supports all major Linux distributions, recent versions of macOS, and Windows (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). diff --git a/pkgs/sagemath-tdlib/README.rst b/pkgs/sagemath-tdlib/README.rst index 0c91ddcf1c6..fb1729a073c 100644 --- a/pkgs/sagemath-tdlib/README.rst +++ b/pkgs/sagemath-tdlib/README.rst @@ -13,7 +13,7 @@ About SageMath https://www.sagemath.org SageMath fully supports all major Linux distributions, recent versions of -macOS, and Windows (using Cygwin or Windows Subsystem for Linux). +macOS, and Windows (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). diff --git a/src/bin/sage-env b/src/bin/sage-env index b4fca91b314..3393315a5f6 100644 --- a/src/bin/sage-env +++ b/src/bin/sage-env @@ -267,13 +267,6 @@ if [ -n "$SAGE_LOCAL" -a -f "$SAGE_LOCAL"/toolchain/toolchain-env ]; then source "$SAGE_LOCAL"/toolchain/toolchain-env fi -# setting of the variable UNAME (describing the o.s.) -# On Cygwin the result of `uname` depends on the version of Windows -# it is running on, e.g. CYGWIN_NT-5.1 on 32 bits Windows XP or -# CYGWIN_NT-6.1-WOW64 on 64 bits Windows 7. -# Currently, this information is of no use to us so we discard it. -export UNAME=`uname | sed 's/CYGWIN.*/CYGWIN/' ` - # Mac OS X-specific setup if [ "$UNAME" = "Darwin" ]; then export MACOSX_VERSION=`uname -r | awk -F. '{print $1}'` @@ -547,15 +540,6 @@ if [ "$TOUCH" = "" ]; then TOUCH="touch" && export TOUCH fi -if [ "$UNAME" = "CYGWIN" -a -n "$SAGE_LOCAL" ]; then - # Cygwin needs pathnames in PATH to resolve runtime dependencies - PATH="$SAGE_LOCAL/lib/R/lib:$SAGE_LOCAL/lib:$PATH" && export PATH - # And "dlopen" needs them in LD_LIBRARY_PATH, just as on Linuces, - # except that on Cygwin shared libraries are usually stored in "bin" - # and not in "lib" - LD_LIBRARY_PATH="$SAGE_LOCAL/bin:$LD_LIBRARY_PATH" && export LD_LIBRARY_PATH -fi - # Handle parallel building/testing/... case "$SAGE_NUM_THREADS,$SAGE_NUM_THREADS_PARALLEL" in [1-9][0-9]*,[1-9][0-9]*) diff --git a/src/doc/bootstrap b/src/doc/bootstrap index fde83e4fd1b..b6830ad7bb3 100755 --- a/src/doc/bootstrap +++ b/src/doc/bootstrap @@ -28,7 +28,7 @@ shopt -s extglob RECOMMENDED_SPKG_PATTERN="@(_recommended$(for a in $(head -n 1 build/pkgs/_recommended/dependencies); do echo -n "|"$a; done))" DEVELOP_SPKG_PATTERN="@(_develop$(for a in $(head -n 1 build/pkgs/_develop/dependencies); do echo -n "|"$a; done))" -for SYSTEM in arch debian fedora cygwin homebrew opensuse; do +for SYSTEM in arch debian fedora homebrew opensuse; do SYSTEM_PACKAGES= OPTIONAL_SYSTEM_PACKAGES= SAGELIB_SYSTEM_PACKAGES= diff --git a/src/doc/en/developer/git_setup.rst b/src/doc/en/developer/git_setup.rst index 49218288afa..f95b0d653da 100644 --- a/src/doc/en/developer/git_setup.rst +++ b/src/doc/en/developer/git_setup.rst @@ -18,10 +18,6 @@ Debian / Ubuntu Fedora Run ``sudo yum install git-core`` -Windows (Cygwin) - Install the Cygwin package Git. Do not attempt to use native - Windows installations of Git. - Windows (WSL) We strongly recommend to install the package using the Linux distribution's package manager. Native Windows installations of diff --git a/src/doc/en/developer/packaging.rst b/src/doc/en/developer/packaging.rst index 9f8bd2528ef..97904e97ea7 100644 --- a/src/doc/en/developer/packaging.rst +++ b/src/doc/en/developer/packaging.rst @@ -514,7 +514,6 @@ containing files with names like :: arch.txt conda.txt - cygwin.txt debian.txt homebrew.txt ... @@ -1216,7 +1215,7 @@ must meet the following requirements: them `_. - **Build Support**. The code must build on all the fully supported - platforms (Linux, macOS, Cygwin); see :ref:`chapter-portability_testing`. + platforms (Linux, macOS); see :ref:`chapter-portability_testing`. It must be installed either from source as a normal package, or as a Python (platform-independent) wheel package, see :ref:`section-package-source-types`. diff --git a/src/doc/en/developer/portability_testing.rst b/src/doc/en/developer/portability_testing.rst index b95bb7b5ab7..0ad863f4e0f 100644 --- a/src/doc/en/developer/portability_testing.rst +++ b/src/doc/en/developer/portability_testing.rst @@ -10,7 +10,7 @@ Testing on Multiple Platforms Sage is intended to build and run on a variety of platforms, including all major Linux distributions, as well as MacOS, and -Windows (with Cygwin and WSL). +Windows (with WSL). There is considerable variation among these platforms. To ensure that Sage continues to build correctly on users' @@ -967,11 +967,6 @@ This is defined in the files - `$SAGE_ROOT/.github/workflows/ci-macos.yml `_, and -- `$SAGE_ROOT/.github/workflows/ci-cygwin-standard.yml - `_ - (which calls `$SAGE_ROOT/.github/workflows/cygwin.yml - `_). - GitHub Actions runs these build jobs on 2-core machines with 7 GB of RAM memory and 14 GB of SSD disk space, cf. `here `_, diff --git a/src/doc/en/installation/source.rst b/src/doc/en/installation/source.rst index a13aed9250a..283c1919bec 100644 --- a/src/doc/en/installation/source.rst +++ b/src/doc/en/installation/source.rst @@ -288,95 +288,6 @@ WSL post-installation notes When the installation is complete, you may be interested in :ref:`sec-launching-wsl-post-installation`. -.. _section_cygwinprereqs: - -Cygwin prerequisite installation -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -Previous versions of Sage targeted the Windows platform using `Cygwin -`_. - -As of Sage 9.7, we no longer recommend attempting to build Sage on -Cygwin and instead suggest that users on Windows 10 and 11 switch to -installing Sage using Windows Subsystem for Linux (WSL), which gives a -better performance and user/developer experience than Cygwin. - -Users on hardware configurations that do not support running WSL, as -well as users on legacy versions of Windows such as Windows 8 may find -it necessary to build Sage on Cygwin. - -.. WARNING:: - - As of Sage 9.7, :trac:`known issues with several packages - ` - will prevent a successful installation. Users need to be prepared - to contribute to Sage by fixing these issues. - -Use the following instructions to get started. - -1. Download `the 64-bit version of Cygwin `_ - (do not get the 32-bit version; it is not supported by Sage). - -2. Run the ``setup-x86_64.exe`` graphical installer. Pick the default - options in most cases. At the package selection screen, use the - search bar to find and select at least the following packages: - ``bzip2``, ``coreutils``, ``curl``, ``gawk``, ``gzip``, ``tar``, ``wget``, ``git``. - -3. Start the Cygwin terminal and ensure you get a working bash prompt. - -4. Make sure the path of your Cygwin home directory does not contain - space characters. Also avoid building in home directories of Windows domain - users or in paths with capital letters. - - By default, your username in Cygwin is the same as your username in - Windows. This might contain spaces and other traditionally - non-UNIX-friendly characters, e.g., if it is your full name. You - can check this as follows:: - - $ whoami - Erik M. Bray - - This means your default home directory on Cygwin contains this - username verbatim; in the above example, ``/home/Erik M. Bray``. - It will save some potential trouble if you change your Cygwin home - directory to contain only alphanumeric characters, for example, - ``/home/embray``. The easiest way to do this is to first create - the home directory you want to use instead, then create an - ``/etc/passwd`` file specifying that directory as your home, as follows:: - - $ whocanibe=embray - $ mkdir /home/$whocanibe - $ mkpasswd.exe -l -u "$(whoami)" | sed -r 's,/home/[^:]+,/home/'$whocanibe, > /etc/passwd - - After this, close all Cygwin terminals (ensure nothing in - ``C:\cygwin64`` is running), then start a new Cygwin terminal and - your home directory should have moved. - - There are `other ways to do - this `_, - but the above seems to be the simplest that's still supported. - -5. (Optional) Although it is possible to install Sage's dependencies using the - Cygwin graphical installer, it is recommended to install the - `apt-cyg `_ - command-line package installer, which is used for the remainder of - these instructions. To install ``apt-cyg``, run:: - - $ curl -OL https://rawgit.com/transcode-open/apt-cyg/master/apt-cyg - $ install apt-cyg /usr/local/bin - $ rm -f apt-cyg - -6. Then, to install the current set of system packages known to work for building - Sage, run the following command (or use the graphical installer to - select and install these packages): - - .. literalinclude:: cygwin.txt - - Optional packages that are also known to be installable via system packages - include: - - .. literalinclude:: cygwin-optional.txt - Other platforms ^^^^^^^^^^^^^^^ @@ -475,7 +386,7 @@ Installation steps If the log files are very large (and many are), then don't paste the whole file, but make sure to include any error messages. It would also be helpful to include the type of operating system - (Linux, macOS, Solaris, OpenSolaris, Cygwin, or any other system), + (Linux, macOS, Solaris, OpenSolaris, or any other system), the version and release date of that operating system and the version of the copy of Sage you are using. (There are no formal requirements for bug reports -- just send them; diff --git a/src/sage/cpython/__init__.py b/src/sage/cpython/__init__.py index cb262984002..0e4de12a8b1 100644 --- a/src/sage/cpython/__init__.py +++ b/src/sage/cpython/__init__.py @@ -15,42 +15,3 @@ if hasattr(_ExtensionFileLoader, 'get_source'): del _ExtensionFileLoader.get_source del _ExtensionFileLoader - -# Work around a Cygwin-specific bug caused by sqlite3; see -# https://github.com/sagemath/sage/issues/30157 and the docstring for -# fix_for_ticket_30157 -# Here we monkey-patch the sqlite3 module to ensure the fix is -# applied the very first time a connection is made to a sqlite3 -# database -import sys as _sys -if _sys.platform == 'cygwin': - def _patch_sqlite3(): - try: - from sage.misc.sage_ostools import fix_for_ticket_30157 - except ImportError: - # The module might not have been re-built yet; don't worry about it - # then - return - - import sqlite3 - import functools - orig_sqlite3_connect = sqlite3.connect - - @functools.wraps(orig_sqlite3_connect) - def connect(*args, **kwargs): - if fix_for_ticket_30157(): - raise RuntimeError( - 'patch for Github issue #30157 failed; please report this ' - 'bug to https://github.com/sagemath/sage/issues') - - # Undo the monkey-patch - try: - return orig_sqlite3_connect(*args, **kwargs) - finally: - sqlite3.connect = orig_sqlite3_connect - - sqlite3.connect = connect - - _patch_sqlite3() - del _patch_sqlite3 - del _sys diff --git a/src/sage/env.py b/src/sage/env.py index 4515e90e912..8e801e90403 100644 --- a/src/sage/env.py +++ b/src/sage/env.py @@ -253,19 +253,12 @@ def var(key: str, *fallbacks: Optional[str], force: bool = False) -> Optional[st # post process 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 - # write privileges to c:\cygwin\home, so we just put - # .sage there. - DOT_SAGE = var("DOT_SAGE", "/home/.sage", force=True) - else: - print("Your home directory has a space in it. This") - print("will probably break some functionality of Sage. E.g.,") - print("the GAP interface will not work. A workaround") - print("is to set the environment variable HOME to a") - print("directory with no spaces that you have write") - print("permissions to before you start sage.") + print("Your home directory has a space in it. This") + print("will probably break some functionality of Sage. E.g.,") + print("the GAP interface will not work. A workaround") + print("is to set the environment variable HOME to a") + print("directory with no spaces that you have write") + print("permissions to before you start sage.") def sage_include_directories(use_sources=False): @@ -461,8 +454,6 @@ def uname_specific(name, value, alternative): aliases["LINUX_NOEXECSTACK"] = uname_specific("Linux", ["-Wl,-z,noexecstack"], []) - aliases["CYGWIN_SQLITE3_LIBS"] = uname_specific("CYGWIN", ["sqlite3"], - []) # LinBox needs special care because it actually requires C++11 with # GNU extensions: -std=c++11 does not work, you need -std=gnu++11 @@ -478,8 +469,8 @@ def uname_specific(name, value, alternative): aliases["ARB_LIBRARY"] = ARB_LIBRARY # TODO: Remove Cygwin hack by installing a suitable cblas.pc - if os.path.exists('/usr/lib/libblas.dll.a'): - aliases["CBLAS_LIBS"] = ['gslcblas'] + # if os.path.exists('/usr/lib/libblas.dll.a'): + # aliases["CBLAS_LIBS"] = ['gslcblas'] try: aliases["M4RI_CFLAGS"].remove("-pedantic") diff --git a/src/sage/interfaces/mathematica.py b/src/sage/interfaces/mathematica.py index 9c6e3ca86e9..02cf7ff502e 100644 --- a/src/sage/interfaces/mathematica.py +++ b/src/sage/interfaces/mathematica.py @@ -341,8 +341,6 @@ - William Stein (2005): first version -- Doug Cutrell (2006-03-01): Instructions for use under Cygwin/Windows. - - Felix Lawrence (2009-08-21): Added support for importing Mathematica lists and floats with exponents. @@ -585,25 +583,6 @@ def _install_hints(self): that's the only ways at present). """ -# The following only works with Sage for Cygwin. - -# Create a file named "math", which you place in the Sage root -# directory. The file contained a single line, which was the -# path to the mathematica math.exe file. In my case, this might be: - -# C:/Program Files/Wolfram Research/Mathematica/4.0/math.exe - -# The key points are -# 1) there is a file named "math.exe", and it will generally be -# located in a place analogous to the above (depending on where -# Mathematica has been installed). This file is used only for -# launching the kernel with a text-based interface. -# 2) a cygwin batch file must be created which executes this file, -# which means using forward slashes rather than back slashes, -# and probably surrounding everything in quotes -# 3) this cygwin batch file must be on the path for Sage (placing -# it in /bin/ is an easy way to ensure this). - def eval(self, code, strip=True, **kwds): s = Expect.eval(self, code, **kwds) if strip: diff --git a/src/sage/libs/singular/singular.pyx b/src/sage/libs/singular/singular.pyx index 63a6e9b332f..d1989366dcb 100644 --- a/src/sage/libs/singular/singular.pyx +++ b/src/sage/libs/singular/singular.pyx @@ -1777,13 +1777,12 @@ cdef init_libsingular() noexcept: os.environ["SINGULAR_BIN_DIR"] = dirname(singular_executable) import platform - if not platform.system().startswith("CYGWIN"): - # reload the current module to force reload of libSingular (see #33446) - lib = str_to_bytes(__loader__.path, FS_ENCODING, "surrogateescape") - handle = dlopen(lib, RTLD_GLOBAL|RTLD_LAZY) - if not handle: - err = dlerror() - raise RuntimeError(f"Could not reload Singular library with RTLD_GLOBAL ({err})") + # reload the current module to force reload of libSingular (see #33446) + lib = str_to_bytes(__loader__.path, FS_ENCODING, "surrogateescape") + handle = dlopen(lib, RTLD_GLOBAL|RTLD_LAZY) + if not handle: + err = dlerror() + raise RuntimeError(f"Could not reload Singular library with RTLD_GLOBAL ({err})") # load SINGULAR siInit(lib) diff --git a/src/sage/misc/compat.py b/src/sage/misc/compat.py index 4ad6d3fe5ef..e374cf97aac 100644 --- a/src/sage/misc/compat.py +++ b/src/sage/misc/compat.py @@ -21,32 +21,7 @@ # Replacements (as needed) for Python stdlib functions to provide # better platform compatibility ################################################################# -if sys.platform == 'cygwin': - # find_library that works in cygwin adapted from - # http://cygwin-ports.svn.sourceforge.net/viewvc/cygwin-ports/ports/trunk/lang/python/2.5.2-ctypes-util-find_library.patch?revision=8245&view=markup - def _find_library(name): - libdirs = [] - if SAGE_LOCAL: - libdirs.append(os.path.join(SAGE_LOCAL, 'lib')) - libdirs.extend(['/usr/local/lib', '/usr/lib']) - for libdir in libdirs: - for libext in ['dll.a', 'a']: - implib = os.path.join(libdir, - 'lib{0}.{1}'.format(name, libext)) - if not os.path.exists(implib): - continue - - cmd = ['dlltool', '-I', implib] - - p = subprocess.Popen(cmd, stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - universal_newlines=True) - - stdout, stderr = p.communicate() - - if p.returncode == 0: - return stdout.strip() -elif sys.platform == 'darwin': +if sys.platform == 'darwin': # On OSX non-standard library paths are not automatically found by the # find_library implementation without setting DYLD_LIBRARY_PATH; see # https://github.com/sagemath/sage/issues/21399#comment:25 diff --git a/src/sage/misc/cython.py b/src/sage/misc/cython.py index 13781e2585d..f631e9eea23 100644 --- a/src/sage/misc/cython.py +++ b/src/sage/misc/cython.py @@ -78,10 +78,6 @@ def _standard_libs_libdirs_incdirs_aliases(): sequence_number = {} -# Only used on Cygwin; see note below about --enable-auto-image-base -CYTHON_IMAGE_BASE = 0x580000000 - - def cython(filename, verbose=0, compile_message=False, use_cache=False, create_local_c_file=False, annotate=True, sage_namespace=True, create_local_so_file=False): @@ -696,85 +692,3 @@ def cython_compile(code, **kwds): with open(tmpfile, 'w') as f: f.write(code) return cython_import_all(tmpfile, get_globals(), **kwds) - - -# THe following utility functions are used on Cygwin only to work around a -# shortcoming in ld/binutils; see https://github.com/sagemath/sage/issues/28258 -def _strhash(s): - """ - Implementation of the strhash function from binutils - - See - https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=blob;f=binutils/dllwrap.c;hb=d0e6d77b3fb64561ca66535f8ed6ca523eac923e#l449 - - This is used to re-implement support for --enable-auto-image-base with a - custom base address, which is currently broken in ld/binutils for PE32+ - binaries. - - TESTS:: - - sage: from sage.misc.cython import _strhash - sage: hex(_strhash('test.pyx')) - '0x3d99a20' - """ - - s = str_to_bytes(s) - h = 0 - l = len(s) - - for c in s: - h += c + (c << 17) - h ^= h >> 2 - - h += l + (l << 17) - h ^= h >> 2 - return h - - -def _compute_dll_image_base(filename, auto_image_base=None): - """ - Compute a DLL image base address from a hash of its filename, using the - same implementation as --enable-auto-image-base from binutils, but with - support for a custom minimum base address. - - See - https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=blob;f=ld/emultempl/pe.em;h=c18cb266beb23d14108044571382e0c7f4dbedb3;hb=d0e6d77b3fb64561ca66535f8ed6ca523eac923e#l919 - which implements this for PE32 images (for PE32+ images the support for - custom base addresses is broken). - - See also :trac:`28258`. - - TESTS:: - - sage: from sage.misc.cython import _compute_dll_image_base - sage: hex(_compute_dll_image_base('test.pyx')) - '0x59a200000' - - Test that given a random filename it is always below 0x6:00000000; in - principle this could fail randomly, but if it never fails then no problem. - We do not test for collisions since there is always a random chance of - collisions with two arbitrary filenames:: - - sage: from sage.misc.temporary_file import tmp_filename - sage: image_base = _compute_dll_image_base(tmp_filename(ext='.pyx')) - sage: hex(image_base) # random - '0x59a200000' - sage: image_base <= (0x600000000 - 0x10000) - True - """ - - if auto_image_base is None: - # The default, which can in principle be modified at runtime if needed - auto_image_base = CYTHON_IMAGE_BASE - - # See https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=blob;f=ld/emultempl/pep.em;h=dca36cc341aabfa2ec9db139b8ec94690165201a;hb=d0e6d77b3fb64561ca66535f8ed6ca523eac923e#l113 - # where move_default_addr_high=1 on Cygwin targets. - # This is actually derived from taking the upper limit 0x6:00000000 minus - # the lower limit 0x4:00000000 minus a gap of at least 0x10000. I don't - # know why but this is supposed to work: https://narkive.com/HCyWCS6h.23 - # Currently in binutils auto_image_base of 0x4:00000000 is hard-coded, so - # this comes out to 0x1:ffff0000, but here we must compute it. - NT_DLL_AUTO_IMAGE_MASK = 0x600000000 - auto_image_base - 0x10000 - - h = _strhash(filename) - return auto_image_base + ((h << 16) & NT_DLL_AUTO_IMAGE_MASK) diff --git a/src/sage/misc/inline_fortran.py b/src/sage/misc/inline_fortran.py index 5d4fc7831bb..82da6982bec 100644 --- a/src/sage/misc/inline_fortran.py +++ b/src/sage/misc/inline_fortran.py @@ -191,15 +191,11 @@ def eval(self, x, globals=None, locals=None): finally: os.chdir(old_cwd) - if sys.platform != 'cygwin': - # Do not delete temporary DLLs on Cygwin; this will cause - # future forks of this process to fail. Instead temporary DLLs - # will be cleaned up upon process exit - try: - shutil.rmtree(mytmpdir) - except OSError: - # This can fail for example over NFS - pass + try: + shutil.rmtree(mytmpdir) + except OSError: + # This can fail for example over NFS + pass for k, x in mod.__dict__.items(): if k[0] != '_': diff --git a/src/sage/misc/persist.pyx b/src/sage/misc/persist.pyx index 670a9a6ac17..0a9a62952aa 100644 --- a/src/sage/misc/persist.pyx +++ b/src/sage/misc/persist.pyx @@ -1041,8 +1041,6 @@ def picklejar(obj, dir=None): ....: uid = -1 sage: if uid == 0: ....: print("OK (cannot test this as root)") - ....: elif sys.platform == 'cygwin': - ....: print("OK (cannot test this on Cygwin)") ....: else: ....: try: ....: sage.misc.persist.picklejar(1, dir + '/noaccess') diff --git a/src/sage/misc/sage_ostools.pyx b/src/sage/misc/sage_ostools.pyx index 0034f7a5d89..64e9c42809b 100644 --- a/src/sage/misc/sage_ostools.pyx +++ b/src/sage/misc/sage_ostools.pyx @@ -1,4 +1,3 @@ -# distutils: libraries = CYGWIN_SQLITE3_LIBS """ Miscellaneous operating system functions """ @@ -304,44 +303,3 @@ cdef class redirection: if self.close_dest: self.dest_file.close() self.dest_fd = -1 - - -IF PY_PLATFORM == 'cygwin': - from libc.stddef cimport wchar_t - - cdef extern from "Windows.h": - int SetDllDirectoryW(wchar_t* lpPathName) - - cdef extern from "sqlite3.h": - int sqlite3_initialize() - - def fix_for_ticket_30157(): - """ - Cygwin-only workaround for an issue caused by the sqlite3 library. - - See :trac:`30157`. - - The issue here is that when the sqlite3 library is first initialized - it modifies Windows' default DLL search path order, which can possibly - break the correct search path for subsequent DLL loads. - - This workaround ensures that the sqlite3 library is initialized very - early on (this does not add any significant overhead) and then - immediately undoes its deleterious effects. In particular, calling - SetDllDirectoryW(NULL) restores the default DLL search path. - - To be clear, there's no reason sqlite3 needs this to function - correctly; it's just a poorly-considered hack that attempted to work - around a problem that doesn't affect us. - - Returns 0 if it succeeeds or a non-zero value if not. - """ - - ret = sqlite3_initialize() - - if ret != 0: - # Library initialization failed for some reason - return ret - - # SetDllDirectory returns 1 if it succeeds. - return not SetDllDirectoryW(NULL) diff --git a/src/sage/misc/sageinspect.py b/src/sage/misc/sageinspect.py index 0fa8551a271..4d7c3f9c19c 100644 --- a/src/sage/misc/sageinspect.py +++ b/src/sage/misc/sageinspect.py @@ -178,8 +178,6 @@ def loadable_module_extension(): r""" Return the filename extension of loadable modules, including the dot. - It is '.dll' on cygwin, '.so' otherwise. - This function is deprecated. EXAMPLES:: diff --git a/src/sage/misc/timing.py b/src/sage/misc/timing.py index cc2753e50b8..5e5c49b9594 100644 --- a/src/sage/misc/timing.py +++ b/src/sage/misc/timing.py @@ -32,8 +32,7 @@ def cputime(t=0, subprocesses=False): ``cputime()`` implementation into account. The measurement for the main Sage process is done via a call to - :func:`resource.getrusage()`, so it avoids the wraparound problems in - :func:`time.clock()` on Cygwin. + :func:`resource.getrusage()`. INPUT: diff --git a/src/sage/misc/viewer.py b/src/sage/misc/viewer.py index 439dedc5e75..85ff09aa341 100644 --- a/src/sage/misc/viewer.py +++ b/src/sage/misc/viewer.py @@ -73,19 +73,6 @@ def default_viewer(viewer=None): PDF_VIEWER = BROWSER PNG_VIEWER = BROWSER - elif os.uname()[0][:6] == 'CYGWIN': - # Windows is also easy, since it has a system for - # determining what opens things. However, on Cygwin we - # should access this through the 'cygstart' program rather - # than trying to run rundll32 directly, which on newer Windows versions - # has security implications - # Indeed, on Sage for Windows, BROWSER is set by default to cygstart, - # so we just canonize that here - BROWSER = os.environ.get('BROWSER', 'cygstart') - DVI_VIEWER = BROWSER - PDF_VIEWER = BROWSER - PNG_VIEWER = BROWSER - elif have_program('xdg-open'): # On other OS'es try xdg-open if present. # See http://portland.freedesktop.org/xdg-utils-1.0. diff --git a/src/sage_docbuild/utils.py b/src/sage_docbuild/utils.py index 28677d9b6c4..d9c1109850e 100644 --- a/src/sage_docbuild/utils.py +++ b/src/sage_docbuild/utils.py @@ -107,10 +107,7 @@ def build_many(target, args, processes=None): also require significant cleanup. It also avoids starting new processes from a pthread, which results in at - least two known issues: - - * On versions of Cygwin prior to 3.0.0 there were bugs in mmap handling - on threads (see :trac:`27214#comment:25`). + least one known issue: * When PARI is built with multi-threading support, forking a Sage process from a thread leaves the main Pari interface instance broken @@ -136,8 +133,7 @@ def build_many(target, args, processes=None): Processed task ... Processed task ... - Unlike the first version of ``build_many`` which was only intended to get - around the Cygwin bug, this version can also return a result, and thus can + This version can also return a result, and thus can be used as a replacement for ``multiprocessing.Pool.map`` (i.e. it still blocks until the result is ready):: diff --git a/src/sage_setup/library_order.py b/src/sage_setup/library_order.py index f40690f8d22..4576ddd4e7d 100644 --- a/src/sage_setup/library_order.py +++ b/src/sage_setup/library_order.py @@ -6,8 +6,7 @@ # be put *before* any library it links to. Cython allows # defining libraries using "# distutils: libraries = LIB". However, if # there are multiple libraries, the order is undefined so we need to -# manually reorder the libraries according to this list. The order is -# important in particular for Cygwin. Any libraries which are not +# manually reorder the libraries according to this list. 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, default_required_modules, default_optional_modules diff --git a/src/sage_setup/setenv.py b/src/sage_setup/setenv.py index 7ff9a05ef2e..b868360d612 100644 --- a/src/sage_setup/setenv.py +++ b/src/sage_setup/setenv.py @@ -45,5 +45,4 @@ def setenv(): # not done: PATH prepend of SAGE_SRC/bin, SAGE_ROOT/build/bin # not done: MACOSX_DEPLOYMENT_TARGET # not done: PATH prepend for ccache & CCACHE_BASEDIR - # not done: Cygwin LD_LIBRARY_PATH # not done: OPENBLAS_NUM_THREADS From 7861f3b72a5a708548b3a4178913d1c71eab93f6 Mon Sep 17 00:00:00 2001 From: Dima Pasechnik Date: Sun, 26 Nov 2023 23:42:52 +0000 Subject: [PATCH 060/145] remove outdated section in SPKG.rst --- build/pkgs/gf2x/SPKG.rst | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/build/pkgs/gf2x/SPKG.rst b/build/pkgs/gf2x/SPKG.rst index b31f78b7c48..0dc6335894b 100644 --- a/build/pkgs/gf2x/SPKG.rst +++ b/build/pkgs/gf2x/SPKG.rst @@ -23,32 +23,3 @@ Upstream Contact - Pierrick Gaudry - Emmanuel Thomé - Paul Zimmermann - -Special Update/Build Instructions ---------------------------------- - -- As some patches touch config/acinclude.m4, we have to touch - aclocal.m4, - configure, Makefile.in and gf2x/gf2x-config.h.in to prevent autotools - to try to regenerate these files. - -Patches -~~~~~~~ - -- 0002-tr-portability.patch: backport upstream fix for non-portable tr - use -- 0003-Improve-detection-of-sse2-support.patch: backport upstream - improved check for sse2 - -- 0004-Add-disable-hardware-specific-code.patch: add option - -disable-hardware-specific-code to build system. This is partly - backported from upstream. - -- 0005-Update-autotooled-files.patch: the above patches make changes to - code used by autotools for generation of the build system. This - patches - those files, so that autotools need not be installed. - -- 0006-Fix_make_check_not_failing_on_errors.patch: (upstream patch) - Fix bug in shell script such that 'make check' always fails upon - errors. From 7b45aaf2c31caf5cb959598b54077a2f7696f662 Mon Sep 17 00:00:00 2001 From: Dima Pasechnik Date: Sun, 26 Nov 2023 23:47:40 +0000 Subject: [PATCH 061/145] keep verbatim notice from Singular --- COPYING.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/COPYING.txt b/COPYING.txt index f1282bc4890..d5c28eacead 100644 --- a/COPYING.txt +++ b/COPYING.txt @@ -1229,7 +1229,9 @@ The following software used with SINGULAR have their own copyright: the omalloc library, the readline library, the Gnu Multiple Precision Library (GMP), NTL: A Library for doing Number Theory (NTL), the Multi Protocol library (MP), the Singular-Factory library, the -Singular-libfac library, surfex, and the XEmacs editor (XEmacs). +Singular-libfac library, surfex, and, for the Windows distributions the +Cygwin DLL and the Cygwin tools (Cygwin), and the XEmacs editor +(XEmacs). Their copyrights and licenses can be found in the accompanying files COPYING which are distributed along with these packages. (Since From 486c77618bd3dbdb629e0fae8796a1e7743ed099 Mon Sep 17 00:00:00 2001 From: Ryuhei Mori Date: Tue, 28 Nov 2023 17:35:55 +0900 Subject: [PATCH 062/145] Add a reference and examples for __getitem__ --- src/doc/en/reference/references/index.rst | 5 +++++ src/sage/rings/cfinite_sequence.py | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/src/doc/en/reference/references/index.rst b/src/doc/en/reference/references/index.rst index fa67dade3ab..9d7fba94c49 100644 --- a/src/doc/en/reference/references/index.rst +++ b/src/doc/en/reference/references/index.rst @@ -1044,6 +1044,11 @@ REFERENCES: *Guide to using plantri*, version 5.0, 2016. http://cs.anu.edu.au/~bdm/plantri/plantri-guide.txt +.. [BM2021] Alin Bostan and Ryuhei Mori, + *A simple and fast algorithm for computing the N-th term of a linearly recurrent sequence*, + Proceedings of Symposium on Simplicity in Algorithms (SOSA), pp. 118--132, 2021. + :doi:`10.1137/1.9781611976496.14` + .. [BMBFLR2008] A. Blondin-Massé, S. Brlek, A. Frosini, S. Labbé, S. Rinaldi, *Reconstructing words from a fixed palindromic length sequence*, Proc. TCS 2008, 5th IFIP diff --git a/src/sage/rings/cfinite_sequence.py b/src/sage/rings/cfinite_sequence.py index f7da28e046c..4d9353e57b8 100644 --- a/src/sage/rings/cfinite_sequence.py +++ b/src/sage/rings/cfinite_sequence.py @@ -644,6 +644,14 @@ def __getitem__(self, key): [0, 0, 1, 2, 3, 4, 5, 6, 7, 8] sage: s = C(x^3 * (1 - x)^-2); s[0:10] [0, 0, 0, 1, 2, 3, 4, 5, 6, 7] + sage: s = C(1/(1-x^1000)); s[10^18] + 1 + sage: s = C(1/(1-x^1000)); s[10^20] + 1 + + REFERENCES: + + - [BM2021]_ """ if isinstance(key, slice): m = max(key.start, key.stop) From 1685d81026d60a794199f0fc9408434092c7827f Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Tue, 28 Nov 2023 09:25:31 -0500 Subject: [PATCH 063/145] build/pkgs/conway_polynomials: update to v0.8 --- build/pkgs/conway_polynomials/checksums.ini | 6 +++--- build/pkgs/conway_polynomials/install-requires.txt | 2 +- build/pkgs/conway_polynomials/package-version.txt | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/build/pkgs/conway_polynomials/checksums.ini b/build/pkgs/conway_polynomials/checksums.ini index ddceaaa769d..eeb24706c7d 100644 --- a/build/pkgs/conway_polynomials/checksums.ini +++ b/build/pkgs/conway_polynomials/checksums.ini @@ -1,5 +1,5 @@ tarball=conway-polynomials-VERSION.tar.gz -sha1=a822baa014c68ab44f654d8a88b2ea81436a26ef -md5=779cfaad6fc4413fa5b4d5a17e5e9ceb -cksum=634397699 +sha1=cf0904c184d7f947eaae0de1b0e2e47411e9cfda +md5=ddc0e82da67120efc353a6ec29c4cca2 +cksum=2976854063 upstream_url=https://files.pythonhosted.org/packages/source/c/conway-polynomials/conway-polynomials-VERSION.tar.gz diff --git a/build/pkgs/conway_polynomials/install-requires.txt b/build/pkgs/conway_polynomials/install-requires.txt index 9f6ba0d94af..308e934cef1 100644 --- a/build/pkgs/conway_polynomials/install-requires.txt +++ b/build/pkgs/conway_polynomials/install-requires.txt @@ -1 +1 @@ -conway-polynomials >=0.7 +conway-polynomials >=0.8 diff --git a/build/pkgs/conway_polynomials/package-version.txt b/build/pkgs/conway_polynomials/package-version.txt index eb49d7c7fdc..aec258df73d 100644 --- a/build/pkgs/conway_polynomials/package-version.txt +++ b/build/pkgs/conway_polynomials/package-version.txt @@ -1 +1 @@ -0.7 +0.8 From 68c460021f76a0c613279555d5c3fb3dff886a0a Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Tue, 28 Nov 2023 09:33:58 -0800 Subject: [PATCH 064/145] build/pkgs/iconv: Reduce to a dummy package --- build/pkgs/iconv/SPKG.rst | 7 ------ build/pkgs/iconv/checksums.ini | 4 --- build/pkgs/iconv/dependencies | 4 --- build/pkgs/iconv/package-version.txt | 1 - build/pkgs/iconv/spkg-check.in | 37 ---------------------------- build/pkgs/iconv/spkg-install.in | 31 ----------------------- 6 files changed, 84 deletions(-) delete mode 100644 build/pkgs/iconv/checksums.ini delete mode 100644 build/pkgs/iconv/dependencies delete mode 100644 build/pkgs/iconv/package-version.txt delete mode 100644 build/pkgs/iconv/spkg-check.in delete mode 100644 build/pkgs/iconv/spkg-install.in diff --git a/build/pkgs/iconv/SPKG.rst b/build/pkgs/iconv/SPKG.rst index 48e0ffe761f..cd51fd5f0a2 100644 --- a/build/pkgs/iconv/SPKG.rst +++ b/build/pkgs/iconv/SPKG.rst @@ -18,10 +18,3 @@ Upstream Contact - http://www.gnu.org/software/libiconv/ - Bug reports to bug-gnu-libiconv@gnu.org - -Special Update/Build Instructions ---------------------------------- - -- None, other than anyone updating this package should be familiar with - how - to write shell scripts. diff --git a/build/pkgs/iconv/checksums.ini b/build/pkgs/iconv/checksums.ini deleted file mode 100644 index d45d8b0fb87..00000000000 --- a/build/pkgs/iconv/checksums.ini +++ /dev/null @@ -1,4 +0,0 @@ -tarball=libiconv-VERSION.tar.gz -sha1=7af3149fa7c4bd1d3a36a30f02e95a0ebfd6b18f -md5=ace8b5f2db42f7b3b3057585e80d9808 -cksum=538361871 diff --git a/build/pkgs/iconv/dependencies b/build/pkgs/iconv/dependencies deleted file mode 100644 index 4f00de20375..00000000000 --- a/build/pkgs/iconv/dependencies +++ /dev/null @@ -1,4 +0,0 @@ -# no dependencies - ----------- -All lines of this file are ignored except the first. diff --git a/build/pkgs/iconv/package-version.txt b/build/pkgs/iconv/package-version.txt deleted file mode 100644 index d40acaaea09..00000000000 --- a/build/pkgs/iconv/package-version.txt +++ /dev/null @@ -1 +0,0 @@ -1.15 diff --git a/build/pkgs/iconv/spkg-check.in b/build/pkgs/iconv/spkg-check.in deleted file mode 100644 index fe8b527f6aa..00000000000 --- a/build/pkgs/iconv/spkg-check.in +++ /dev/null @@ -1,37 +0,0 @@ -# Only test iconv on Solaris, HP-UX, as those are the only -# platforms on which the iconv shipped with Sage will be installed. On -# other platforms Sage uses the system's iconv. - -case "$UNAME" in -SunOS) - # We must test iconv, but on Solaris some tests will always fail. - echo "If you see 3 core dumps, don't be too alarmed." - echo "This is a known Solaris bug and can safely be ignored. See" - echo " https://github.com/sagemath/sage/issues/8270" - echo "It will probably be fixed in later releases of Solaris 10," - echo "and was fixed in build 66 of OpenSolaris:" - echo " http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6550204" -esac -case "$UNAME" in -HP-UX|SunOS) - - cd src - - $MAKE check - - if [ $? -ne 0 ]; then - echo "Error encountered while running the iconv test suite ... exiting" - exit 1 - fi - echo "All the tests for iconv passed." - exit 0 - ;; -*) # Not HP-UX or SunOS (Solaris) - echo "iconv was not to be tested, since Sage will use the system's iconv" - echo "and not the one shipped with Sage." - echo "The iconv supplied by Sage is only used on HP-UX and Solaris." - exit 0 -esac - -# NOT REACHED - diff --git a/build/pkgs/iconv/spkg-install.in b/build/pkgs/iconv/spkg-install.in deleted file mode 100644 index 3c7a3ff3171..00000000000 --- a/build/pkgs/iconv/spkg-install.in +++ /dev/null @@ -1,31 +0,0 @@ -# Only build iconv on Solaris or HP-UX. See -# https://github.com/sagemath/sage/issues/8567 and -# https://github.com/sagemath/sage/issues/9603 -# for details. - -case "$UNAME" in -HP-UX|SunOS) - echo "iconv will be installed as the operating system is HP-UX or Solaris." - echo "These systems either lack iconv, or do not have a sufficiently capable" - echo "version of iconv. See:" - echo " https://github.com/sagemath/sage/issues/8567" - echo " https://github.com/sagemath/sage/issues/9603" - - cd src - - sdh_configure $ICONV_CONFIGURE - sdh_make - sdh_make_install - exit 0 - ;; -*) # Not HP-UX or SunOS (Solaris) - echo "iconv will not be installed, as we only need to build it on" - echo "Solaris or HP-UX, as the system's iconv will be used" - echo "on other platforms, rather than the one shipped with Sage." - echo "See:" - echo " https://github.com/sagemath/sage/issues/8567" - echo " https://github.com/sagemath/sage/issues/9603" - exit 0 -esac - -# NOT REACHED From 1713eed49f4c468eb1cbef84cd299cee37d1d4b2 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Tue, 28 Nov 2023 09:35:31 -0800 Subject: [PATCH 065/145] src/sage/env.py: Remove commented-out cygwin code --- src/sage/env.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/sage/env.py b/src/sage/env.py index 8e801e90403..ea3c99b1823 100644 --- a/src/sage/env.py +++ b/src/sage/env.py @@ -468,10 +468,6 @@ def uname_specific(name, value, alternative): aliases["ARB_LIBRARY"] = ARB_LIBRARY - # TODO: Remove Cygwin hack by installing a suitable cblas.pc - # if os.path.exists('/usr/lib/libblas.dll.a'): - # aliases["CBLAS_LIBS"] = ['gslcblas'] - try: aliases["M4RI_CFLAGS"].remove("-pedantic") except (ValueError, KeyError): From 128e3483e1d35573226730f61a181f1933d4e135 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Tue, 28 Nov 2023 09:37:44 -0800 Subject: [PATCH 066/145] src/bin/sage-env: Restore lost setting of UNAME --- src/bin/sage-env | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/bin/sage-env b/src/bin/sage-env index 3393315a5f6..29b96c3c895 100644 --- a/src/bin/sage-env +++ b/src/bin/sage-env @@ -267,6 +267,9 @@ if [ -n "$SAGE_LOCAL" -a -f "$SAGE_LOCAL"/toolchain/toolchain-env ]; then source "$SAGE_LOCAL"/toolchain/toolchain-env fi +# setting of the variable UNAME (describing the o.s.) +export UNAME=`uname` + # Mac OS X-specific setup if [ "$UNAME" = "Darwin" ]; then export MACOSX_VERSION=`uname -r | awk -F. '{print $1}'` From 822a9f95ea37928f32a93fca482ba5713162d7e2 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Tue, 28 Nov 2023 09:38:27 -0800 Subject: [PATCH 067/145] src/sage/libs/singular/singular.pyx: Remove unused import --- src/sage/libs/singular/singular.pyx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/sage/libs/singular/singular.pyx b/src/sage/libs/singular/singular.pyx index d1989366dcb..cf0124e0a35 100644 --- a/src/sage/libs/singular/singular.pyx +++ b/src/sage/libs/singular/singular.pyx @@ -1776,7 +1776,6 @@ cdef init_libsingular() noexcept: else: os.environ["SINGULAR_BIN_DIR"] = dirname(singular_executable) - import platform # reload the current module to force reload of libSingular (see #33446) lib = str_to_bytes(__loader__.path, FS_ENCODING, "surrogateescape") handle = dlopen(lib, RTLD_GLOBAL|RTLD_LAZY) From 76aad01bab87ec31312d554ff9e5be523974d526 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Tue, 28 Nov 2023 09:45:04 -0800 Subject: [PATCH 068/145] src/sage/interfaces/mathematica.py: Restore AUTHORS item --- src/sage/interfaces/mathematica.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/sage/interfaces/mathematica.py b/src/sage/interfaces/mathematica.py index 02cf7ff502e..2a6353c113f 100644 --- a/src/sage/interfaces/mathematica.py +++ b/src/sage/interfaces/mathematica.py @@ -341,6 +341,8 @@ - William Stein (2005): first version +- Doug Cutrell (2006-03-01): Instructions for use under Cygwin/Windows. + - Felix Lawrence (2009-08-21): Added support for importing Mathematica lists and floats with exponents. From 52a657ab127c65a294b5747777cd6fd6ae830ede Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Tue, 28 Nov 2023 09:47:36 -0800 Subject: [PATCH 069/145] build/bin/sage-bootstrap-python: Restore pwd checking - for WSL --- build/bin/sage-bootstrap-python | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/build/bin/sage-bootstrap-python b/build/bin/sage-bootstrap-python index 53cdae3a515..2b185a8f43d 100755 --- a/build/bin/sage-bootstrap-python +++ b/build/bin/sage-bootstrap-python @@ -36,7 +36,9 @@ SAGE_ORIG_PATH=${NEW_PATH%%':'} # a defect of sage_bootstrap on macOS regarding SSL URLs. # Trac #30177: Also check for hashlib.sha1 to guard against broken python2 -# from old homebrew installations. +# from old homebrew installations. Also check whether the current directory +# is accessible by this python; this is to guard on WSL against Pythons +# installed somewhere else in Windows. # Trac #29285: Do not accept pythons that manipulate PATH, such as # the shims provided by pyenv. @@ -58,7 +60,7 @@ PYTHONS="python python3 python3.12 python3.11 python3.10 python3.9 python3.8 pyt for PY in $PYTHONS; do PYTHON="$(PATH="$SAGE_ORIG_PATH" command -v $PY)" if [ -n "$PYTHON" ]; then - if CHECK_PATH="$PATH" "$PYTHON" -c "import argparse; import urllib; from hashlib import sha1; from ssl import HAS_SNI; assert HAS_SNI; from os import environ; assert environ[\"PATH\"] == environ[\"CHECK_PATH\"];" 2>/dev/null; then + if CHECK_PATH="$PATH" "$PYTHON" -c "import argparse; import urllib; from hashlib import sha1; from ssl import HAS_SNI; assert HAS_SNI; from os import listdir, environ; listdir(\"$(pwd)\"); assert environ[\"PATH\"] == environ[\"CHECK_PATH\"];" 2>/dev/null; then exec "$PYTHON" "$@" fi fi @@ -67,7 +69,7 @@ done for PY in $PYTHONS; do PYTHON="$(PATH="$SAGE_ORIG_PATH" command -v $PY)" if [ -n "$PYTHON" ]; then - if CHECK_PATH="$PATH" "$PYTHON" -c "import argparse; import urllib; from hashlib import sha1; from os import environ; assert environ[\"PATH\"] == environ[\"CHECK_PATH\"];" 2>/dev/null; then + if CHECK_PATH="$PATH" "$PYTHON" -c "import argparse; import urllib; from hashlib import sha1; from os import listdir, environ; listdir(\"$(pwd)\"); assert environ[\"PATH\"] == environ[\"CHECK_PATH\"];" 2>/dev/null; then exec "$PYTHON" "$@" fi fi From d25284eb2f0554021ddbb7ef61e74bb69ee1492a Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Thu, 30 Nov 2023 22:31:34 -0800 Subject: [PATCH 070/145] sage -package create --pypi: If --source is not given, use --source=wheel if possible --- build/sage_bootstrap/app.py | 13 ++++++++++++- build/sage_bootstrap/cmdline.py | 2 +- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/build/sage_bootstrap/app.py b/build/sage_bootstrap/app.py index 8c17541a9b7..d61b3ce3241 100644 --- a/build/sage_bootstrap/app.py +++ b/build/sage_bootstrap/app.py @@ -273,7 +273,7 @@ def fix_checksum(self, package_name): update.fix_checksum() def create(self, package_name, version=None, tarball=None, pkg_type=None, upstream_url=None, - description=None, license=None, upstream_contact=None, pypi=False, source='normal'): + description=None, license=None, upstream_contact=None, pypi=False, source=None): """ Create a package @@ -288,6 +288,13 @@ def create(self, package_name, version=None, tarball=None, pkg_type=None, upstre if '-' in package_name: raise ValueError('package names must not contain dashes, use underscore instead') if pypi: + if source is None: + try: + source = 'wheel' + if not PyPiVersion(package_name, source='wheel').tarball.endswith('-none-any.whl'): + source = 'normal' + except PyPiError: + source = 'normal' pypi_version = PyPiVersion(package_name, source=source) if source == 'normal': if not tarball: @@ -312,6 +319,10 @@ def create(self, package_name, version=None, tarball=None, pkg_type=None, upstre license = pypi_version.license if not upstream_contact: upstream_contact = pypi_version.package_url + if upstream_url and not tarball: + tarball = upstream_url.rpartition('/')[2] + if tarball and source is None: + source = 'normal' if tarball and not pkg_type: # If we set a tarball, also make sure to create a "type" file, # so that subsequent operations (downloading of tarballs) work. diff --git a/build/sage_bootstrap/cmdline.py b/build/sage_bootstrap/cmdline.py index 3ea6b9b7cb8..cb125161560 100644 --- a/build/sage_bootstrap/cmdline.py +++ b/build/sage_bootstrap/cmdline.py @@ -319,7 +319,7 @@ def make_parser(): 'package_name', default=None, type=str, help='Package name.') parser_create.add_argument( - '--source', type=str, default='normal', help='Package source (one of normal, wheel, script, pip)') + '--source', type=str, default=None, help='Package source (one of normal, wheel, script, pip; default depends on provided arguments)') parser_create.add_argument( '--version', type=str, default=None, help='Package version') parser_create.add_argument( From af414b66285f3284125c8b07f77bdce927b3bb2d Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Thu, 30 Nov 2023 23:13:51 -0800 Subject: [PATCH 071/145] build/pkgs/six: Change to a wheel package --- build/pkgs/six/checksums.ini | 10 +++++----- build/pkgs/six/dependencies | 2 +- build/pkgs/six/spkg-install.in | 3 --- 3 files changed, 6 insertions(+), 9 deletions(-) delete mode 100644 build/pkgs/six/spkg-install.in diff --git a/build/pkgs/six/checksums.ini b/build/pkgs/six/checksums.ini index b7226d114b5..a0614f6049b 100644 --- a/build/pkgs/six/checksums.ini +++ b/build/pkgs/six/checksums.ini @@ -1,5 +1,5 @@ -tarball=six-VERSION.tar.gz -sha1=06fa0bb50f2a4e2917fd14c21e9d2d5508ce0163 -md5=a7c927740e4964dd29b72cebfc1429bb -cksum=1693137720 -upstream_url=https://pypi.io/packages/source/s/six/six-VERSION.tar.gz +tarball=six-VERSION-py2.py3-none-any.whl +sha1=79e6f2e4f9e24898f1896df379871b9c9922f147 +md5=529d7fd7e14612ccde86417b4402d6f3 +cksum=2975792266 +upstream_url=https://pypi.io/packages/py2.py3/s/six/six-VERSION-py2.py3-none-any.whl diff --git a/build/pkgs/six/dependencies b/build/pkgs/six/dependencies index 47296a7bace..644ad35f773 100644 --- a/build/pkgs/six/dependencies +++ b/build/pkgs/six/dependencies @@ -1,4 +1,4 @@ - | $(PYTHON_TOOLCHAIN) $(PYTHON) + | pip $(PYTHON) ---------- All lines of this file are ignored except the first. diff --git a/build/pkgs/six/spkg-install.in b/build/pkgs/six/spkg-install.in deleted file mode 100644 index 058b1344dc2..00000000000 --- a/build/pkgs/six/spkg-install.in +++ /dev/null @@ -1,3 +0,0 @@ -cd src - -sdh_pip_install . From 6696177079095fe53b9a42e0c4a80c165cc6656a Mon Sep 17 00:00:00 2001 From: Kwankyu Lee Date: Sat, 2 Dec 2023 08:52:40 +0900 Subject: [PATCH 072/145] Build ReferenceTopBuilder for html --- src/sage_docbuild/builders.py | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/sage_docbuild/builders.py b/src/sage_docbuild/builders.py index 63aa1145154..3e205f30a5a 100644 --- a/src/sage_docbuild/builders.py +++ b/src/sage_docbuild/builders.py @@ -654,11 +654,11 @@ def _output_dir(self, type, lang=None): os.makedirs(d, exist_ok=True) return d - def pdf(self): + def html(self): """ - Build top-level document. + Build the top-level document. """ - super().pdf() + super().html() # We want to build master index file which lists all of the PDF file. # We modify the file index.html from the "reference_top" target, if it @@ -668,12 +668,8 @@ def pdf(self): reference_dir = os.path.join(SAGE_DOC, 'html', 'en', 'reference') output_dir = self._output_dir('html') - # Check if the top reference index.html exists. - try: - with open(os.path.join(reference_dir, 'index.html')) as f: - html = f.read() - except FileNotFoundError: - return + with open(os.path.join(reference_dir, 'index.html')) as f: + html = f.read() # Install in output_dir a symlink to the directory containing static files. # Prefer relative path for symlinks. From c7f576e567808f9fe81b5b1aa1d95159045cce88 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 2 Dec 2023 11:03:25 -0800 Subject: [PATCH 073/145] build/pkgs/flit_core: Switch to wheel package --- build/pkgs/flit_core/checksums.ini | 10 +++++----- build/pkgs/flit_core/spkg-install.in | 3 --- 2 files changed, 5 insertions(+), 8 deletions(-) delete mode 100644 build/pkgs/flit_core/spkg-install.in diff --git a/build/pkgs/flit_core/checksums.ini b/build/pkgs/flit_core/checksums.ini index cf7f0bb2b55..b93e9200816 100644 --- a/build/pkgs/flit_core/checksums.ini +++ b/build/pkgs/flit_core/checksums.ini @@ -1,5 +1,5 @@ -tarball=flit_core-VERSION.tar.gz -sha1=05d6d7a3df5bdbd9df1b37a65662e5dbe94f23fd -md5=3bc52f1952b9a78361114147da63c35b -cksum=1703912415 -upstream_url=https://pypi.io/packages/source/f/flit_core/flit_core-VERSION.tar.gz +tarball=flit_core-VERSION-py3-none-any.whl +sha1=cf044db53e986d0735ad708cce9eba0b71684168 +md5=c817750ae741d8f720b173a30f7b2085 +cksum=1810686358 +upstream_url=https://pypi.io/packages/py3/f/flit_core/flit_core-VERSION-py3-none-any.whl diff --git a/build/pkgs/flit_core/spkg-install.in b/build/pkgs/flit_core/spkg-install.in deleted file mode 100644 index 8d6f80f4cc7..00000000000 --- a/build/pkgs/flit_core/spkg-install.in +++ /dev/null @@ -1,3 +0,0 @@ -cd src -# We use --no-deps to suppress a warning regarding tomli. -sdh_pip_install --no-deps . From f2fb2e0e2f8de4cfdeb8731f5da8dff822872a62 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 2 Dec 2023 11:13:33 -0800 Subject: [PATCH 074/145] build/pkgs/packaging: Switch to wheel package --- build/pkgs/packaging/SPKG.rst | 9 +++++++++ build/pkgs/packaging/checksums.ini | 10 +++++----- build/pkgs/packaging/dependencies | 2 +- build/pkgs/packaging/spkg-install.in | 1 - 4 files changed, 15 insertions(+), 7 deletions(-) delete mode 100644 build/pkgs/packaging/spkg-install.in diff --git a/build/pkgs/packaging/SPKG.rst b/build/pkgs/packaging/SPKG.rst index c9333698503..753be5162eb 100644 --- a/build/pkgs/packaging/SPKG.rst +++ b/build/pkgs/packaging/SPKG.rst @@ -5,3 +5,12 @@ Description ----------- Core utilities for Python packages + +License +------- + +Upstream Contact +---------------- + +https://pypi.org/project/packaging/ + diff --git a/build/pkgs/packaging/checksums.ini b/build/pkgs/packaging/checksums.ini index 7d9afce62d3..3ee369817f0 100644 --- a/build/pkgs/packaging/checksums.ini +++ b/build/pkgs/packaging/checksums.ini @@ -1,5 +1,5 @@ -tarball=packaging-VERSION.tar.gz -sha1=603cbd6e3416f1f4b6c0f924216f96fe67d9f6da -md5=d54eeff8c7ca86980528f4132f258d54 -cksum=307392791 -upstream_url=https://pypi.io/packages/source/p/packaging/packaging-VERSION.tar.gz +tarball=packaging-VERSION-py3-none-any.whl +sha1=d3fb436d835b252ea884a5d172d7265220127f95 +md5=f6e9c6af858bd34eff07b407d3f650a1 +cksum=3531019080 +upstream_url=https://pypi.io/packages/py3/p/packaging/packaging-VERSION-py3-none-any.whl diff --git a/build/pkgs/packaging/dependencies b/build/pkgs/packaging/dependencies index b63b7e33635..644ad35f773 100644 --- a/build/pkgs/packaging/dependencies +++ b/build/pkgs/packaging/dependencies @@ -1,4 +1,4 @@ - | flit_core pip $(PYTHON) + | pip $(PYTHON) ---------- All lines of this file are ignored except the first. diff --git a/build/pkgs/packaging/spkg-install.in b/build/pkgs/packaging/spkg-install.in deleted file mode 100644 index dd9cb64a082..00000000000 --- a/build/pkgs/packaging/spkg-install.in +++ /dev/null @@ -1 +0,0 @@ -cd src && sdh_pip_install --build-isolation . From 3e832d85d1660f1dfe7130079d5ae1f82dae4137 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 2 Dec 2023 11:18:08 -0800 Subject: [PATCH 075/145] build/pkgs/tomli: Switch to wheel package --- build/pkgs/tomli/checksums.ini | 10 +++++----- build/pkgs/tomli/dependencies | 2 +- build/pkgs/tomli/spkg-install.in | 2 -- 3 files changed, 6 insertions(+), 8 deletions(-) delete mode 100644 build/pkgs/tomli/spkg-install.in diff --git a/build/pkgs/tomli/checksums.ini b/build/pkgs/tomli/checksums.ini index c8642848d7f..f2edcb641cb 100644 --- a/build/pkgs/tomli/checksums.ini +++ b/build/pkgs/tomli/checksums.ini @@ -1,5 +1,5 @@ -tarball=tomli-VERSION.tar.gz -sha1=3eae299137c59d6d6d30be01417366c57dd1adf5 -md5=d4341621d423a7ca6822e23d6d52bb9a -cksum=1285168803 -upstream_url=https://pypi.io/packages/source/t/tomli/tomli-VERSION.tar.gz +tarball=tomli-VERSION-py3-none-any.whl +sha1=5bfc83c14bc54e6193a0d50a50c16a88eda0c4fa +md5=a8a774971c6d046cf1c87cd801dd158f +cksum=891457836 +upstream_url=https://pypi.io/packages/py3/t/tomli/tomli-VERSION-py3-none-any.whl diff --git a/build/pkgs/tomli/dependencies b/build/pkgs/tomli/dependencies index 992761d1f11..644ad35f773 100644 --- a/build/pkgs/tomli/dependencies +++ b/build/pkgs/tomli/dependencies @@ -1,4 +1,4 @@ - | pip flit_core $(PYTHON) + | pip $(PYTHON) ---------- All lines of this file are ignored except the first. diff --git a/build/pkgs/tomli/spkg-install.in b/build/pkgs/tomli/spkg-install.in deleted file mode 100644 index 37ac1a53437..00000000000 --- a/build/pkgs/tomli/spkg-install.in +++ /dev/null @@ -1,2 +0,0 @@ -cd src -sdh_pip_install . From 53fa74ae132392b47c49f3668c92b8ff2668632b Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 2 Dec 2023 11:21:02 -0800 Subject: [PATCH 076/145] build/pkgs/pyparsing: Switch to wheel package --- build/pkgs/pyparsing/SPKG.rst | 3 +-- build/pkgs/pyparsing/checksums.ini | 10 +++++----- build/pkgs/pyparsing/dependencies | 2 +- build/pkgs/pyparsing/spkg-install.in | 3 --- 4 files changed, 7 insertions(+), 11 deletions(-) delete mode 100644 build/pkgs/pyparsing/spkg-install.in diff --git a/build/pkgs/pyparsing/SPKG.rst b/build/pkgs/pyparsing/SPKG.rst index 0b765140901..21635bcae2b 100644 --- a/build/pkgs/pyparsing/SPKG.rst +++ b/build/pkgs/pyparsing/SPKG.rst @@ -15,6 +15,5 @@ MIT License Upstream Contact ---------------- -- Author: Paul McGuire -- Home page: http://pyparsing.wikispaces.com +https://pypi.org/project/pyparsing/ diff --git a/build/pkgs/pyparsing/checksums.ini b/build/pkgs/pyparsing/checksums.ini index 1c6d7b9b36b..a6e8820e3c3 100644 --- a/build/pkgs/pyparsing/checksums.ini +++ b/build/pkgs/pyparsing/checksums.ini @@ -1,5 +1,5 @@ -tarball=pyparsing-VERSION.tar.gz -sha1=2e9cf056c36c132f15476dfdd50449d48b48f6a2 -md5=bb8c8c6b8015ca5887ae2c37917ee82e -cksum=513345755 -upstream_url=https://files.pythonhosted.org/packages/source/p/pyparsing/pyparsing-VERSION.tar.gz +tarball=pyparsing-VERSION-py3-none-any.whl +sha1=c44cd9476ad90a48af0f27d8f7966136b2a93fc6 +md5=314b4874edfbc558e02f89d371043e9f +cksum=3947575213 +upstream_url=https://pypi.io/packages/py3/p/pyparsing/pyparsing-VERSION-py3-none-any.whl diff --git a/build/pkgs/pyparsing/dependencies b/build/pkgs/pyparsing/dependencies index 287adef3710..644ad35f773 100644 --- a/build/pkgs/pyparsing/dependencies +++ b/build/pkgs/pyparsing/dependencies @@ -1,4 +1,4 @@ - | pip wheel flit_core $(PYTHON) + | pip $(PYTHON) ---------- All lines of this file are ignored except the first. diff --git a/build/pkgs/pyparsing/spkg-install.in b/build/pkgs/pyparsing/spkg-install.in deleted file mode 100644 index 058b1344dc2..00000000000 --- a/build/pkgs/pyparsing/spkg-install.in +++ /dev/null @@ -1,3 +0,0 @@ -cd src - -sdh_pip_install . From 3be82636c4a1b3226dfac960861753f633079e92 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 2 Dec 2023 11:31:57 -0800 Subject: [PATCH 077/145] build/pkgs/typing_extensions: Switch to wheel package, update to 4.8.0 --- build/pkgs/typing_extensions/SPKG.rst | 4 ++-- build/pkgs/typing_extensions/checksums.ini | 10 +++++----- build/pkgs/typing_extensions/dependencies | 2 +- build/pkgs/typing_extensions/package-version.txt | 2 +- build/pkgs/typing_extensions/spkg-install.in | 2 -- 5 files changed, 9 insertions(+), 11 deletions(-) delete mode 100644 build/pkgs/typing_extensions/spkg-install.in diff --git a/build/pkgs/typing_extensions/SPKG.rst b/build/pkgs/typing_extensions/SPKG.rst index da23c19d36d..861399b66b5 100644 --- a/build/pkgs/typing_extensions/SPKG.rst +++ b/build/pkgs/typing_extensions/SPKG.rst @@ -1,10 +1,10 @@ -typing_extensions: Backported and Experimental Type Hints for Python 3.5+ +typing_extensions: Backported and Experimental Type Hints for Python 3.8+ ========================================================================= Description ----------- -Backported and Experimental Type Hints for Python 3.5+ +Backported and Experimental Type Hints for Python 3.8+ License ------- diff --git a/build/pkgs/typing_extensions/checksums.ini b/build/pkgs/typing_extensions/checksums.ini index 449824b887b..babfa059d5c 100644 --- a/build/pkgs/typing_extensions/checksums.ini +++ b/build/pkgs/typing_extensions/checksums.ini @@ -1,5 +1,5 @@ -tarball=typing_extensions-VERSION.tar.gz -sha1=ef61789c91d5e9de37c5960c1e6f904e029fbba3 -md5=06e7fff4b1d51f8dc6f49b16e71de54e -cksum=3833864103 -upstream_url=https://pypi.io/packages/source/t/typing_extensions/typing_extensions-VERSION.tar.gz +tarball=typing_extensions-VERSION-py3-none-any.whl +sha1=84d6a73b5a5d303c9187a861d5eedd50da42e7a3 +md5=9c84e613da80ced7a5e86329ec75dc6c +cksum=2951292774 +upstream_url=https://pypi.io/packages/py3/t/typing_extensions/typing_extensions-VERSION-py3-none-any.whl diff --git a/build/pkgs/typing_extensions/dependencies b/build/pkgs/typing_extensions/dependencies index e0e94942dba..644ad35f773 100644 --- a/build/pkgs/typing_extensions/dependencies +++ b/build/pkgs/typing_extensions/dependencies @@ -1,4 +1,4 @@ - | flit_core $(PYTHON) + | pip $(PYTHON) ---------- All lines of this file are ignored except the first. diff --git a/build/pkgs/typing_extensions/package-version.txt b/build/pkgs/typing_extensions/package-version.txt index 7c66fca5791..88f181192c4 100644 --- a/build/pkgs/typing_extensions/package-version.txt +++ b/build/pkgs/typing_extensions/package-version.txt @@ -1 +1 @@ -4.7.1 +4.8.0 diff --git a/build/pkgs/typing_extensions/spkg-install.in b/build/pkgs/typing_extensions/spkg-install.in deleted file mode 100644 index 37ac1a53437..00000000000 --- a/build/pkgs/typing_extensions/spkg-install.in +++ /dev/null @@ -1,2 +0,0 @@ -cd src -sdh_pip_install . From 033715f15a3238c78db23e8c73aa3a223a72eece Mon Sep 17 00:00:00 2001 From: Aman Date: Mon, 4 Dec 2023 05:44:52 +0530 Subject: [PATCH 078/145] made changes to the documentaiton of developer in python3 print --- src/doc/en/developer/coding_basics.rst | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/doc/en/developer/coding_basics.rst b/src/doc/en/developer/coding_basics.rst index 4821dabfd68..330d35921ed 100644 --- a/src/doc/en/developer/coding_basics.rst +++ b/src/doc/en/developer/coding_basics.rst @@ -1039,14 +1039,9 @@ written. The :ref:`doctest fixer ` uses tab stops at columns 48, 56, 64, ... for these tags. -- **Python3 print:** Python3 syntax for print must be used in Sage - code and doctests. If you use an old-style print in doctests, it - will raise a SyntaxError:: - - sage: print "not like that" - Traceback (most recent call last): - ... - SyntaxError: ... +- **Python3 print:** In SageMath code and doctests, adhere to Python 3 + syntax for the print function. Use parentheses as follows::: + sage: print("but like this") but like this From 95dcb398b5687f5379cf68bfc95f79ce32d0fe4a Mon Sep 17 00:00:00 2001 From: Kwankyu Lee Date: Mon, 4 Dec 2023 13:30:08 +0900 Subject: [PATCH 079/145] Add binder badge to README.md --- README.md | 47 +++++++++++++++++++++++++++-------------------- 1 file changed, 27 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 495365af6eb..ace1fca2d6a 100644 --- a/README.md +++ b/README.md @@ -1,27 +1,20 @@ +
+ "Creating a Viable Open Source Alternative to + Magma, Maple, Mathematica, and MATLAB" +
-# Sage: Open Source Mathematical Software +# -> "Creating a Viable Open Source Alternative to -> Magma, Maple, Mathematica, and MATLAB" - -> Copyright (C) 2005-2023 The Sage Development Team - -https://www.sagemath.org - -[Sage Documentation](https://doc.sagemath.org/html/en/index.html) - -The Sage Library is free software released under the -GNU General Public Licence GPLv2+, and included packages -have [compatible software licenses](./COPYING.txt). -[Over 800 people](https://www.sagemath.org/development-map.html) -have contributed code to Sage. In many cases, documentation -for modules and functions list the authors. +Sage is open source mathematical software released under the GNU General Public +Licence GPLv2+, and includes packages that have [compatible software licenses](./COPYING.txt). +[People all around the globe](https://www.sagemath.org/development-map.html) have contributed to the +development of Sage. [Full documentation](https://doc.sagemath.org/html/en/index.html) is available online. Table of Contents ----------------- @@ -44,6 +37,12 @@ Table of Contents Getting Started --------------- +Those who are impatient may use the Binder badge + +[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/sagemath/sage-binder-env/master) + +for an instant computing environment with Sage. Otherwise read on. + The [Sage Installation Guide](https://doc.sagemath.org/html/en/installation/index.html) provides a decision tree that guides you to the type of installation that will work best for you. This includes building from source, @@ -81,7 +80,7 @@ The preferred way to run Sage on Windows is using the [Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/faq), a.k.a. WSL, which allows you to install a standard Linux distribution such as Ubuntu within your Windows. Make sure you allocate WSL sufficient RAM; 5GB is known to work, while -2GB might be not enough for building Sage from source. +2GB might be not enough for building Sage from source. Then all instructions for installation in Linux apply. As an alternative, you can also run Linux on Windows using Docker ([see @@ -428,7 +427,7 @@ in the Installation Guide. or JupyterLab installation, as described in [section "Launching SageMath"](https://doc.sagemath.org/html/en/installation/launching.html) in the installation manual. - + Alternative Installation using PyPI --------------- @@ -436,10 +435,10 @@ For installation of `sage` in python using `pip` you need to install `sagemath-s $ python3 -m pip install sage_conf $ ls $(sage-config SAGE_SPKG_WHEELS) - $ python3 -m pip install $(sage-config SAGE_SPKG_WHEELS)/*.whl + $ python3 -m pip install $(sage-config SAGE_SPKG_WHEELS)/*.whl $ python3 -m pip install sagemath-standard -You need to install `sage_conf`, a wheelhouse of various python packages. You can list the wheels using `ls $(sage-config SAGE_SPKG_WHEELS)`. After manual installation of these wheels, you can install the sage library, `sagemath-standard`. +You need to install `sage_conf`, a wheelhouse of various python packages. You can list the wheels using `ls $(sage-config SAGE_SPKG_WHEELS)`. After manual installation of these wheels, you can install the sage library, `sagemath-standard`. **NOTE:** You can find `sage` and `sagemath` pip packages but with these packages, you will encounter `ModuleNotFoundError`. @@ -647,3 +646,11 @@ Sources are in unmodified (as far as possible) tarballs in the information, patches, and build scripts are in the accompanying `build/pkgs/` directory. This directory is part of the Sage git repository. + +

+ Copyright (C) 2005-2023 The Sage Development Team +

+

+ https://www.sagemath.org +

+ From d0b3ebef89a4699352d1d150e5a92c55801b97c3 Mon Sep 17 00:00:00 2001 From: Kwankyu Lee Date: Mon, 4 Dec 2023 13:53:26 +0900 Subject: [PATCH 080/145] Edit some phrases --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ace1fca2d6a..9c7702c432e 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ Those who are impatient may use the Binder badge [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/sagemath/sage-binder-env/master) -for an instant computing environment with Sage. Otherwise read on. +to build and launch a Sage computing environment with no local installation. Otherwise read on. The [Sage Installation Guide](https://doc.sagemath.org/html/en/installation/index.html) provides a decision tree that guides you to the type of installation From 07a6fbc6e5775655208176ad36f4497ad39c5b81 Mon Sep 17 00:00:00 2001 From: Kwankyu Lee Date: Mon, 4 Dec 2023 21:13:53 +0900 Subject: [PATCH 081/145] Add other badges too --- README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 9c7702c432e..8b365f07bc5 100644 --- a/README.md +++ b/README.md @@ -37,11 +37,13 @@ Table of Contents Getting Started --------------- -Those who are impatient may use the Binder badge +Those who are impatient may use prebuilt Sage available online from any of -[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/sagemath/sage-binder-env/master) +[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/sagemath/sage-binder-env/master +)   [![Gitpod Ready-to-Code](https://img.shields.io/badge/Gitpod-Ready--to--Code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/sagemath/sage/tree/master +)   [![Open in GitHub Codespaces](https://img.shields.io/badge/Open_in_GitHub_Codespaces-black?logo=github)](https://codespaces.new/sagemath/sage/tree/master) -to build and launch a Sage computing environment with no local installation. Otherwise read on. +without local installation. Otherwise read on. The [Sage Installation Guide](https://doc.sagemath.org/html/en/installation/index.html) provides a decision tree that guides you to the type of installation From aa1e99249a51ca708a3c931b72f7b52bcde49f71 Mon Sep 17 00:00:00 2001 From: Viraj Paradkar Date: Mon, 4 Dec 2023 18:09:22 +0530 Subject: [PATCH 082/145] Issue No. #36817: Corrected the typo in documentation Updated documentation to correct grammatical error in the description of PermutationGroup, changing 'method' to 'methods'. --- src/sage/groups/perm_gps/permgroup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sage/groups/perm_gps/permgroup.py b/src/sage/groups/perm_gps/permgroup.py index b0083394cb0..00c484ea386 100644 --- a/src/sage/groups/perm_gps/permgroup.py +++ b/src/sage/groups/perm_gps/permgroup.py @@ -29,7 +29,7 @@ Index of methods ---------------- -Here are the method of a :func:`PermutationGroup` +Here are the methods of a :func:`PermutationGroup` {METHODS_OF_PermutationGroup_generic} From c7670d0ee314947f26bdc4bb9a23fc40f2c57445 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= Date: Sat, 25 Nov 2023 16:12:04 -0300 Subject: [PATCH 083/145] Do not fail when `java` is available but `jmol` is not. If java is not available, sagemath will fallback to tachyon gracefully. When java is available, sagemath will assume jmol is available and error if not. This commit fixes the issue by implementing a method `is_jmol_available()` to replace `is_jvm_available()`. --- src/sage/interfaces/jmoldata.py | 44 +++++++++++++++++++- src/sage/plot/plot3d/base.pyx | 2 +- src/sage/repl/rich_output/backend_ipython.py | 2 +- 3 files changed, 44 insertions(+), 4 deletions(-) diff --git a/src/sage/interfaces/jmoldata.py b/src/sage/interfaces/jmoldata.py index a68e53e2d85..55c07255b74 100644 --- a/src/sage/interfaces/jmoldata.py +++ b/src/sage/interfaces/jmoldata.py @@ -71,6 +71,47 @@ def is_jvm_available(self): java_version_number = int(re.sub(r'.*version "(0\.|1\.)?(\d*)[\s\S]*', r'\2', version, flags=re.S)) return java_version_number >= 7 + def jmolpath(self): + """ + Return the path to the jar file. + + EXAMPLES:: + + sage: from sage.interfaces.jmoldata import JmolData + sage: JData = JmolData() + sage: JData.jmolpath() + '.../JmolData.jar' + + """ + jmolpath = os.path.join(JMOL_DIR, "JmolData.jar") + + if sys.platform == 'cygwin': + import cygwin + jmolpath = cygwin.cygpath(jmolpath, 'w') + + return jmolpath + + def is_jmol_available(self): + """ + Returns True if jmol is available and False if not. + + EXAMPLES: + + Check that it returns a boolean:: + + sage: from sage.interfaces.jmoldata import JmolData + sage: JData = JmolData() + sage: type(JData.is_jmol_available()) + <... 'bool'> + """ + if not os.path.isfile(self.jmolpath()): + return False + + if not self.is_jvm_available(): + return False + + return True + def export_image(self, targetfile, datafile, #name (path) of data file Jmol can read or script file telling it what to read or load @@ -154,12 +195,11 @@ def export_image(self, sage: archive.close() """ # Set up paths, file names and scripts - jmolpath = os.path.join(JMOL_DIR, "JmolData.jar") + jmolpath = self.jmolpath() target_native = targetfile if sys.platform == 'cygwin': import cygwin - jmolpath = cygwin.cygpath(jmolpath, 'w') target_native = cygwin.cygpath(target_native, 'w') if datafile_cmd != 'script': datafile = cygwin.cygpath(datafile, 'w') diff --git a/src/sage/plot/plot3d/base.pyx b/src/sage/plot/plot3d/base.pyx index 253f152130c..7588cde2e27 100644 --- a/src/sage/plot/plot3d/base.pyx +++ b/src/sage/plot/plot3d/base.pyx @@ -278,7 +278,7 @@ cdef class Graphics3d(SageObject): T.export_jmol(scene_zip, **opts) from sage.interfaces.jmoldata import JmolData jdata = JmolData() - if not jdata.is_jvm_available(): + if not jdata.is_jmol_available(): # We can only use JMol to generate preview if a jvm is installed from sage.repl.rich_output.output_graphics import OutputImagePng tachyon = self._rich_repr_tachyon(OutputImagePng, **opts) diff --git a/src/sage/repl/rich_output/backend_ipython.py b/src/sage/repl/rich_output/backend_ipython.py index 69e63b76d60..10ccdc0c2c8 100644 --- a/src/sage/repl/rich_output/backend_ipython.py +++ b/src/sage/repl/rich_output/backend_ipython.py @@ -369,7 +369,7 @@ def launch_jmol(self, output_jmol, plain_text): from sage.doctest import DOCTEST_MODE from sage.interfaces.jmoldata import JmolData jdata = JmolData() - if not jdata.is_jvm_available() and not DOCTEST_MODE: + if not jdata.is_jmol_available() and not DOCTEST_MODE: raise RuntimeError('jmol cannot run, no suitable java version found') launch_script = output_jmol.launch_script_filename() jmol_cmd = 'jmol' From ce9780e2940495cf006e5779d3123f6028495683 Mon Sep 17 00:00:00 2001 From: Aman Date: Tue, 5 Dec 2023 19:33:21 +0530 Subject: [PATCH 084/145] removed ':' from end of the line in python3 print in developer documentation --- src/doc/en/developer/coding_basics.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/doc/en/developer/coding_basics.rst b/src/doc/en/developer/coding_basics.rst index 330d35921ed..88bfdfd436a 100644 --- a/src/doc/en/developer/coding_basics.rst +++ b/src/doc/en/developer/coding_basics.rst @@ -1040,8 +1040,7 @@ written. tab stops at columns 48, 56, 64, ... for these tags. - **Python3 print:** In SageMath code and doctests, adhere to Python 3 - syntax for the print function. Use parentheses as follows::: - + syntax for the print function. Use parentheses as follows:: sage: print("but like this") but like this From ec28623443d413d49b4bf59d5b916b184f61682e Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Tue, 5 Dec 2023 18:05:17 -0800 Subject: [PATCH 085/145] build/make/Makefile.in: Update documentation of PYTHON_TOOLCHAIN --- build/make/Makefile.in | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/build/make/Makefile.in b/build/make/Makefile.in index 6031ae7fa2a..ebf5117ee11 100644 --- a/build/make/Makefile.in +++ b/build/make/Makefile.in @@ -322,9 +322,8 @@ toolchain-deps: all-toolchain: base-toolchain +$(MAKE_REC) toolchain-deps -# All packages needed as a prerequisite to install other Python packages with -# pip or which are otherwise used by the Python build tools; these should be -# given as a prerequisite to any pip-installed packages +# Shorthand for a list of packages sufficient for building and installing +# typical Python packages from source. Wheel packages only need pip. PYTHON_TOOLCHAIN = setuptools pip setuptools_scm wheel setuptools_wheel # Trac #32056: Avoid installed setuptools leaking into the build of python3 by uninstalling it. From 818468af83560668beb2d2c7b5b57b7e5ec749c2 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Tue, 5 Dec 2023 18:08:08 -0800 Subject: [PATCH 086/145] build/sage_bootstrap/{app,cmdline}.py: Suggested edits --- build/sage_bootstrap/app.py | 5 +++-- build/sage_bootstrap/cmdline.py | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/build/sage_bootstrap/app.py b/build/sage_bootstrap/app.py index d61b3ce3241..11600bf1b53 100644 --- a/build/sage_bootstrap/app.py +++ b/build/sage_bootstrap/app.py @@ -290,8 +290,9 @@ def create(self, package_name, version=None, tarball=None, pkg_type=None, upstre if pypi: if source is None: try: - source = 'wheel' - if not PyPiVersion(package_name, source='wheel').tarball.endswith('-none-any.whl'): + if PyPiVersion(package_name, source='wheel').tarball.endswith('-none-any.whl'): + source = 'wheel' + else: source = 'normal' except PyPiError: source = 'normal' diff --git a/build/sage_bootstrap/cmdline.py b/build/sage_bootstrap/cmdline.py index cb125161560..1b84cbf6461 100644 --- a/build/sage_bootstrap/cmdline.py +++ b/build/sage_bootstrap/cmdline.py @@ -319,7 +319,7 @@ def make_parser(): 'package_name', default=None, type=str, help='Package name.') parser_create.add_argument( - '--source', type=str, default=None, help='Package source (one of normal, wheel, script, pip; default depends on provided arguments)') + '--source', type=str, default=None, help='Package source (one of normal, wheel, script, pip); default depends on provided arguments') parser_create.add_argument( '--version', type=str, default=None, help='Package version') parser_create.add_argument( From 92ad155fa6ee9c6fc7af7bedfeaa533544077019 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Tue, 5 Dec 2023 22:54:38 -0800 Subject: [PATCH 087/145] src/sage/schemes/elliptic_curves/mod_poly.py: Fix pycodestyle E305 --- src/sage/schemes/elliptic_curves/mod_poly.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/sage/schemes/elliptic_curves/mod_poly.py b/src/sage/schemes/elliptic_curves/mod_poly.py index cb8cd703f69..21926e14c8e 100644 --- a/src/sage/schemes/elliptic_curves/mod_poly.py +++ b/src/sage/schemes/elliptic_curves/mod_poly.py @@ -24,6 +24,7 @@ _cache_bound = 100 _cache = dict() + def classical_modular_polynomial(l, j=None): r""" Return the classical modular polynomial `\Phi_\ell`, either as a @@ -143,6 +144,7 @@ def classical_modular_polynomial(l, j=None): # and simply evaluating it. return classical_modular_polynomial(l)(j, Y) + def _set_cache_bound(bnd): r""" Internal helper function to allow setting the caching cutoff for @@ -164,4 +166,5 @@ def _set_cache_bound(bnd): global _cache_bound _cache_bound = bnd + classical_modular_polynomial.set_cache_bound = _set_cache_bound From a75e4d9a458ecc8f917d16879348f03ce135432d Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Tue, 5 Dec 2023 23:16:58 -0800 Subject: [PATCH 088/145] build/pkgs/ipython: Update to 8.18.1 --- build/pkgs/ipython/checksums.ini | 6 +++--- build/pkgs/ipython/package-version.txt | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build/pkgs/ipython/checksums.ini b/build/pkgs/ipython/checksums.ini index 3b0a8df72dd..cf6feff95e3 100644 --- a/build/pkgs/ipython/checksums.ini +++ b/build/pkgs/ipython/checksums.ini @@ -1,5 +1,5 @@ tarball=ipython-VERSION.tar.gz -sha1=62afbe2e62e713ee89bfe5303809bdcd2affb2a3 -md5=ac2ff5bad97aa09befdf7f0f27323699 -cksum=413345511 +sha1=4b5ab06a1b5e1a3285ac91d7dac9a22d18898a31 +md5=b56b71635168357dc94ac384b0a78f0c +cksum=1043636334 upstream_url=https://pypi.io/packages/source/i/ipython/ipython-VERSION.tar.gz diff --git a/build/pkgs/ipython/package-version.txt b/build/pkgs/ipython/package-version.txt index 86487fdd0f7..5e460d892fa 100644 --- a/build/pkgs/ipython/package-version.txt +++ b/build/pkgs/ipython/package-version.txt @@ -1 +1 @@ -8.17.2 +8.18.1 From f7c6b13cf413e970c106d18906ffe9159c827448 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Tue, 5 Dec 2023 23:18:01 -0800 Subject: [PATCH 089/145] build/pkgs/backcall: Remove --- build/pkgs/backcall/SPKG.rst | 7 ------- build/pkgs/backcall/checksums.ini | 5 ----- build/pkgs/backcall/dependencies | 4 ---- build/pkgs/backcall/distros/conda.txt | 1 - build/pkgs/backcall/distros/gentoo.txt | 1 - build/pkgs/backcall/distros/macports.txt | 1 - build/pkgs/backcall/distros/repology.txt | 1 - build/pkgs/backcall/distros/void.txt | 1 - build/pkgs/backcall/install-requires.txt | 1 - build/pkgs/backcall/package-version.txt | 1 - build/pkgs/backcall/spkg-configure.m4 | 1 - build/pkgs/backcall/spkg-install.in | 3 --- build/pkgs/backcall/type | 1 - 13 files changed, 28 deletions(-) delete mode 100644 build/pkgs/backcall/SPKG.rst delete mode 100644 build/pkgs/backcall/checksums.ini delete mode 100644 build/pkgs/backcall/dependencies delete mode 100644 build/pkgs/backcall/distros/conda.txt delete mode 100644 build/pkgs/backcall/distros/gentoo.txt delete mode 100644 build/pkgs/backcall/distros/macports.txt delete mode 100644 build/pkgs/backcall/distros/repology.txt delete mode 100644 build/pkgs/backcall/distros/void.txt delete mode 100644 build/pkgs/backcall/install-requires.txt delete mode 100644 build/pkgs/backcall/package-version.txt delete mode 100644 build/pkgs/backcall/spkg-configure.m4 delete mode 100644 build/pkgs/backcall/spkg-install.in delete mode 100644 build/pkgs/backcall/type diff --git a/build/pkgs/backcall/SPKG.rst b/build/pkgs/backcall/SPKG.rst deleted file mode 100644 index 4bf8d11ad80..00000000000 --- a/build/pkgs/backcall/SPKG.rst +++ /dev/null @@ -1,7 +0,0 @@ -backcall: Specifications for callback functions -=============================================== - -Description ------------ - -Specifications for callback functions passed in to an API diff --git a/build/pkgs/backcall/checksums.ini b/build/pkgs/backcall/checksums.ini deleted file mode 100644 index a5818261d7c..00000000000 --- a/build/pkgs/backcall/checksums.ini +++ /dev/null @@ -1,5 +0,0 @@ -tarball=backcall-VERSION.tar.gz -sha1=5bc62d540af1534f23560c0c32aac1e129518cd5 -md5=1f4c9a370c78743406296f48e56e8821 -cksum=3815916908 -upstream_url=https://pypi.io/packages/source/b/backcall/backcall-VERSION.tar.gz diff --git a/build/pkgs/backcall/dependencies b/build/pkgs/backcall/dependencies deleted file mode 100644 index f863a25db11..00000000000 --- a/build/pkgs/backcall/dependencies +++ /dev/null @@ -1,4 +0,0 @@ - | $(PYTHON_TOOLCHAIN) flit_core $(PYTHON) - ----------- -All lines of this file are ignored except the first. diff --git a/build/pkgs/backcall/distros/conda.txt b/build/pkgs/backcall/distros/conda.txt deleted file mode 100644 index e46b94d67c6..00000000000 --- a/build/pkgs/backcall/distros/conda.txt +++ /dev/null @@ -1 +0,0 @@ -backcall diff --git a/build/pkgs/backcall/distros/gentoo.txt b/build/pkgs/backcall/distros/gentoo.txt deleted file mode 100644 index 266a222c558..00000000000 --- a/build/pkgs/backcall/distros/gentoo.txt +++ /dev/null @@ -1 +0,0 @@ -dev-python/backcall diff --git a/build/pkgs/backcall/distros/macports.txt b/build/pkgs/backcall/distros/macports.txt deleted file mode 100644 index 252a039ffee..00000000000 --- a/build/pkgs/backcall/distros/macports.txt +++ /dev/null @@ -1 +0,0 @@ -py-backcall diff --git a/build/pkgs/backcall/distros/repology.txt b/build/pkgs/backcall/distros/repology.txt deleted file mode 100644 index e31cc54d2ee..00000000000 --- a/build/pkgs/backcall/distros/repology.txt +++ /dev/null @@ -1 +0,0 @@ -python:backcall diff --git a/build/pkgs/backcall/distros/void.txt b/build/pkgs/backcall/distros/void.txt deleted file mode 100644 index 8338506e588..00000000000 --- a/build/pkgs/backcall/distros/void.txt +++ /dev/null @@ -1 +0,0 @@ -python3-backcall diff --git a/build/pkgs/backcall/install-requires.txt b/build/pkgs/backcall/install-requires.txt deleted file mode 100644 index 077e71c1e38..00000000000 --- a/build/pkgs/backcall/install-requires.txt +++ /dev/null @@ -1 +0,0 @@ -backcall >=0.1.0 diff --git a/build/pkgs/backcall/package-version.txt b/build/pkgs/backcall/package-version.txt deleted file mode 100644 index 0ea3a944b39..00000000000 --- a/build/pkgs/backcall/package-version.txt +++ /dev/null @@ -1 +0,0 @@ -0.2.0 diff --git a/build/pkgs/backcall/spkg-configure.m4 b/build/pkgs/backcall/spkg-configure.m4 deleted file mode 100644 index d6b11c49884..00000000000 --- a/build/pkgs/backcall/spkg-configure.m4 +++ /dev/null @@ -1 +0,0 @@ -SAGE_SPKG_CONFIGURE([backcall], [SAGE_PYTHON_PACKAGE_CHECK([backcall])]) diff --git a/build/pkgs/backcall/spkg-install.in b/build/pkgs/backcall/spkg-install.in deleted file mode 100644 index 058b1344dc2..00000000000 --- a/build/pkgs/backcall/spkg-install.in +++ /dev/null @@ -1,3 +0,0 @@ -cd src - -sdh_pip_install . diff --git a/build/pkgs/backcall/type b/build/pkgs/backcall/type deleted file mode 100644 index a6a7b9cd726..00000000000 --- a/build/pkgs/backcall/type +++ /dev/null @@ -1 +0,0 @@ -standard From effefec1c741d591009689fade3da8cf741c0b20 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Tue, 5 Dec 2023 23:18:24 -0800 Subject: [PATCH 090/145] build/pkgs/ipython: Remove backcall, appnope from dependencies --- build/pkgs/ipython/dependencies | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/pkgs/ipython/dependencies b/build/pkgs/ipython/dependencies index b00056b1a63..0109d63972d 100644 --- a/build/pkgs/ipython/dependencies +++ b/build/pkgs/ipython/dependencies @@ -1,4 +1,4 @@ -tornado pyzmq pickleshare traitlets decorator wcwidth prompt_toolkit pygments pexpect appnope backcall jedi stack_data exceptiongroup | $(PYTHON_TOOLCHAIN) $(PYTHON) +tornado pyzmq pickleshare traitlets decorator wcwidth prompt_toolkit pygments pexpect jedi stack_data exceptiongroup | $(PYTHON_TOOLCHAIN) $(PYTHON) ---------- All lines of this file are ignored except the first. From 97ed967fc7b31434f83d8eae3a306350456b840f Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Tue, 5 Dec 2023 23:19:43 -0800 Subject: [PATCH 091/145] build/pkgs/ipykernel: Update to 6.27.1 --- build/pkgs/ipykernel/checksums.ini | 6 +++--- build/pkgs/ipykernel/package-version.txt | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build/pkgs/ipykernel/checksums.ini b/build/pkgs/ipykernel/checksums.ini index 3eaa681a507..1dc395313d6 100644 --- a/build/pkgs/ipykernel/checksums.ini +++ b/build/pkgs/ipykernel/checksums.ini @@ -1,5 +1,5 @@ tarball=ipykernel-VERSION.tar.gz -sha1=88c5159bb5caba780383f00fceebb4cce80f96b5 -md5=9a5a3ded6795afecfe55c74f9f77307d -cksum=3205929883 +sha1=3465b4aa523705e930f295b5c549924e376a02e2 +md5=f48666313b1ddf7b796b9a58805ba71b +cksum=2919090600 upstream_url=https://pypi.io/packages/source/i/ipykernel/ipykernel-VERSION.tar.gz diff --git a/build/pkgs/ipykernel/package-version.txt b/build/pkgs/ipykernel/package-version.txt index 9cd1a39f656..72d6521b91a 100644 --- a/build/pkgs/ipykernel/package-version.txt +++ b/build/pkgs/ipykernel/package-version.txt @@ -1 +1 @@ -6.27.0 +6.27.1 From 2bf26c3e55c581decf9cb7542938625fc8306b43 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Tue, 5 Dec 2023 23:22:10 -0800 Subject: [PATCH 092/145] build/pkgs/traitlets: Update to 5.14.0 --- build/pkgs/traitlets/checksums.ini | 6 +++--- build/pkgs/traitlets/package-version.txt | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build/pkgs/traitlets/checksums.ini b/build/pkgs/traitlets/checksums.ini index fb0575fb4db..711eb90d8f5 100644 --- a/build/pkgs/traitlets/checksums.ini +++ b/build/pkgs/traitlets/checksums.ini @@ -1,5 +1,5 @@ tarball=traitlets-VERSION.tar.gz -sha1=7dffc7781492e43a88dad84c925c0acfbc370943 -md5=58e13c21997e7cc01dda3765c9731f95 -cksum=1487040947 +sha1=9f4cb2a04ffba7029ad67bbec3d39a23e9095db2 +md5=63c6bb056dec2a062a854d90fa6b4933 +cksum=2387245107 upstream_url=https://pypi.io/packages/source/t/traitlets/traitlets-VERSION.tar.gz diff --git a/build/pkgs/traitlets/package-version.txt b/build/pkgs/traitlets/package-version.txt index 26f30f79ccc..0a70cf03ca9 100644 --- a/build/pkgs/traitlets/package-version.txt +++ b/build/pkgs/traitlets/package-version.txt @@ -1 +1 @@ -5.13.0 +5.14.0 From d8b9458e0b215b5180f6e6b575ca5f7393b6233c Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Tue, 5 Dec 2023 23:23:04 -0800 Subject: [PATCH 093/145] build/pkgs/tornado: Update to 6.4 --- build/pkgs/tornado/checksums.ini | 6 +++--- build/pkgs/tornado/package-version.txt | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build/pkgs/tornado/checksums.ini b/build/pkgs/tornado/checksums.ini index 46e14d34d98..08508eba5d2 100644 --- a/build/pkgs/tornado/checksums.ini +++ b/build/pkgs/tornado/checksums.ini @@ -1,5 +1,5 @@ tarball=tornado-VERSION.tar.gz -sha1=de0ef2eb77e7ca1ba1210bd02d56d9494b413cd7 -md5=e5fca0b30397bbdfe1f5e8e49e6cacf9 -cksum=327419258 +sha1=5b4036313660a74034186ac63b10d244ca9444b8 +md5=460b467761e5ff74202b5bf8054c8116 +cksum=3932629794 upstream_url=https://pypi.io/packages/source/t/tornado/tornado-VERSION.tar.gz diff --git a/build/pkgs/tornado/package-version.txt b/build/pkgs/tornado/package-version.txt index 7849b73dc74..c596943a9f0 100644 --- a/build/pkgs/tornado/package-version.txt +++ b/build/pkgs/tornado/package-version.txt @@ -1 +1 @@ -6.3.3 +6.4 From 280658453e527dfbbc90003aa9f3a074bddc3492 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Tue, 5 Dec 2023 23:24:22 -0800 Subject: [PATCH 094/145] build/pkgs/pexpect: Update to 4.9.0 --- build/pkgs/pexpect/checksums.ini | 6 +++--- build/pkgs/pexpect/package-version.txt | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build/pkgs/pexpect/checksums.ini b/build/pkgs/pexpect/checksums.ini index d973aacf784..d69bd7db960 100644 --- a/build/pkgs/pexpect/checksums.ini +++ b/build/pkgs/pexpect/checksums.ini @@ -1,5 +1,5 @@ tarball=pexpect-VERSION.tar.gz -sha1=3f6c41a4a72dc802f3431f5d2367a4259f9b1813 -md5=b260eb284efc19489466b804ff53c59b -cksum=966265148 +sha1=5bff9230c419eecbf701059f104e74a3f3a1b208 +md5=f48d48325ee7f1221add0396ea9e2f14 +cksum=2367435032 upstream_url=https://codeload.github.com/pexpect/pexpect/tar.gz/VERSION diff --git a/build/pkgs/pexpect/package-version.txt b/build/pkgs/pexpect/package-version.txt index 88f181192c4..6ed7776bf32 100644 --- a/build/pkgs/pexpect/package-version.txt +++ b/build/pkgs/pexpect/package-version.txt @@ -1 +1 @@ -4.8.0 +4.9.0 From 21c6bcf207df4c47f3f3f502b039a75dc4e9872e Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Wed, 6 Dec 2023 10:56:43 -0800 Subject: [PATCH 095/145] README.md: Update section on macOS arm64 --- README.md | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 495365af6eb..af75e0d411e 100644 --- a/README.md +++ b/README.md @@ -90,26 +90,13 @@ below](#sagemath-docker-images)) or other virtualization solutions. [macOS] Preparing the Platform ------------------------------ -If your Mac uses the Apple Silicon (M1, M2, arm64) architecture: - -- If you set up your Mac by transferring files from an older Mac, make sure +- If your Mac uses the Apple Silicon (M1, M2, M3; arm64) architecture and + you set up your Mac by transferring files from an older Mac, make sure that the directory ``/usr/local`` does not contain an old copy of Homebrew (or other software) for the x86_64 architecture that you may have copied over. Note that Homebrew for the M1 is installed in ``/opt/homebrew``, not ``/usr/local``. -- If you wish to use conda, please see the [section on - conda](https://doc.sagemath.org/html/en/installation/conda.html) in the Sage - Installation Manual for guidance. - -- Otherwise, using Homebrew ("the missing package manager for macOS") from - https://brew.sh/ required because it provides a version of ``gfortran`` with - necessary changes for this platform that are not in a released upstream - version of GCC. (The ``gfortran`` package that comes with the Sage - distribution is not suitable for the M1/M2.) - -If your Mac uses the Intel (x86_64) architecture: - - If you wish to use conda, please see the [section on conda](https://doc.sagemath.org/html/en/installation/conda.html) in the Sage Installation Manual for guidance. From 5fd53f6895622932ae055fef7e851cec41942a3d Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Wed, 6 Dec 2023 17:19:57 -0800 Subject: [PATCH 096/145] build/pkgs/pexpect: Fix upstream_url, simplify spkg-install.in --- build/pkgs/pexpect/checksums.ini | 2 +- build/pkgs/pexpect/spkg-install.in | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/build/pkgs/pexpect/checksums.ini b/build/pkgs/pexpect/checksums.ini index d69bd7db960..e4c530a042d 100644 --- a/build/pkgs/pexpect/checksums.ini +++ b/build/pkgs/pexpect/checksums.ini @@ -2,4 +2,4 @@ tarball=pexpect-VERSION.tar.gz sha1=5bff9230c419eecbf701059f104e74a3f3a1b208 md5=f48d48325ee7f1221add0396ea9e2f14 cksum=2367435032 -upstream_url=https://codeload.github.com/pexpect/pexpect/tar.gz/VERSION +upstream_url=https://pypi.io/packages/source/p/pexpect/pexpect-VERSION.tar.gz diff --git a/build/pkgs/pexpect/spkg-install.in b/build/pkgs/pexpect/spkg-install.in index f3ac6c942f6..37ac1a53437 100644 --- a/build/pkgs/pexpect/spkg-install.in +++ b/build/pkgs/pexpect/spkg-install.in @@ -1,8 +1,2 @@ cd src - sdh_pip_install . - -if [ $? -ne 0 ]; then - echo "Error installing pexpect" - exit 1 -fi From e903fcebea340a7c2871458e8575b32a73fb9eac Mon Sep 17 00:00:00 2001 From: Dima Pasechnik Date: Thu, 7 Dec 2023 12:26:19 +0000 Subject: [PATCH 097/145] fixed mismatch between TOC and actual titles --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index af75e0d411e..06823a025e4 100644 --- a/README.md +++ b/README.md @@ -28,8 +28,8 @@ Table of Contents * [Getting Started](#getting-started) * [Supported Platforms](#supported-platforms) -* [\[Windows\] Preparing the Platform Libraries](#windows-preparing-the-platform) -* [\[macOS\] Preparing the Platform Libraries](#macos-preparing-the-platform) +* [\[Windows\] Preparing the Platform](#windows-preparing-the-platform) +* [\[macOS\] Preparing the Platform](#macos-preparing-the-platform) * [Instructions to Build from Source](#instructions-to-build-from-source) * [SageMath Docker Images](#sagemath-docker-images) * [Troubleshooting](#troubleshooting) From b885876e76e4c2d78d17ecee61b4f473337358a0 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Wed, 22 Nov 2023 13:09:29 -0800 Subject: [PATCH 098/145] build/pkgs/numpy: Update to 1.26.2 --- build/pkgs/numpy/checksums.ini | 6 +++--- build/pkgs/numpy/package-version.txt | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build/pkgs/numpy/checksums.ini b/build/pkgs/numpy/checksums.ini index 67c13061038..c43b105998a 100644 --- a/build/pkgs/numpy/checksums.ini +++ b/build/pkgs/numpy/checksums.ini @@ -1,5 +1,5 @@ tarball=numpy-VERSION.tar.gz -sha1=00f8e85fae2e2ccf8afa78e8da3a058831230ef1 -md5=2d770f4c281d405b690c4bcb3dbe99e2 -cksum=1663231076 +sha1=1b83822015ba736ae3f998aa60d14a32b3974765 +md5=8f6446a32e47953a03f8fe8533e21e98 +cksum=1710925615 upstream_url=https://pypi.io/packages/source/n/numpy/numpy-VERSION.tar.gz diff --git a/build/pkgs/numpy/package-version.txt b/build/pkgs/numpy/package-version.txt index dd43a143f02..c7c3f3333e1 100644 --- a/build/pkgs/numpy/package-version.txt +++ b/build/pkgs/numpy/package-version.txt @@ -1 +1 @@ -1.26.1 +1.26.2 From 05676972a32b0fbcd1a9cf7c9ec9752c17e4c4af Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Wed, 22 Nov 2023 13:09:49 -0800 Subject: [PATCH 099/145] build/pkgs/scipy: Update to 1.11.4 --- build/pkgs/scipy/checksums.ini | 6 +++--- build/pkgs/scipy/package-version.txt | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build/pkgs/scipy/checksums.ini b/build/pkgs/scipy/checksums.ini index a02413e57cd..ea7f7c2ca2f 100644 --- a/build/pkgs/scipy/checksums.ini +++ b/build/pkgs/scipy/checksums.ini @@ -1,5 +1,5 @@ tarball=scipy-VERSION.tar.gz -sha1=15905a54347bfbeb32f804bd7fa968b2d47881cc -md5=9f618e66c4b12b702793cdfd2b7b3847 -cksum=3174598552 +sha1=f9b4b1da51cbc6232989775c4edbfd8770923630 +md5=0e8eea0f7c4fe7d8102366230c96d66d +cksum=3652718229 upstream_url=https://pypi.io/packages/source/s/scipy/scipy-VERSION.tar.gz diff --git a/build/pkgs/scipy/package-version.txt b/build/pkgs/scipy/package-version.txt index 0a5af26df3f..3d0e62313ce 100644 --- a/build/pkgs/scipy/package-version.txt +++ b/build/pkgs/scipy/package-version.txt @@ -1 +1 @@ -1.11.3 +1.11.4 From cde01257f28031993dd34c29dc44634eb8ff16bc Mon Sep 17 00:00:00 2001 From: Dima Pasechnik Date: Thu, 7 Dec 2023 23:03:19 +0000 Subject: [PATCH 100/145] update qepcad to B 1.74 We removed 'B' from the version number to accommodate the tarfile name from Debian --- build/pkgs/qepcad/SPKG.rst | 11 +- build/pkgs/qepcad/checksums.ini | 10 +- build/pkgs/qepcad/package-version.txt | 2 +- .../qepcad/patches/qepcad-B-destructor.patch | 41 +- build/pkgs/qepcad/patches/qepcad-B-gcc6.patch | 21 +- .../pkgs/qepcad/patches/qepcad-B-parens.patch | 88 +- .../pkgs/qepcad/patches/qepcad-B-return.patch | 39 +- .../pkgs/qepcad/patches/qepcad-B-signed.patch | 115 ++- .../pkgs/qepcad/patches/qepcad-B-syntax.patch | 17 +- build/pkgs/qepcad/patches/qepcad-B-tty.patch | 20 +- .../pkgs/qepcad/patches/qepcad-B-uninit.patch | 207 ++--- .../pkgs/qepcad/patches/qepcad-B-unused.patch | 806 +++++++++--------- 12 files changed, 767 insertions(+), 610 deletions(-) diff --git a/build/pkgs/qepcad/SPKG.rst b/build/pkgs/qepcad/SPKG.rst index fa8ef06fb7c..6800372bc56 100644 --- a/build/pkgs/qepcad/SPKG.rst +++ b/build/pkgs/qepcad/SPKG.rst @@ -30,13 +30,4 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. Upstream Contact ---------------- -- Website: http://www.usna.edu/CS/qepcadweb/B/QEPCAD.html -- Alternative location (sometimes more up-to-date): - - https://www.usna.edu/Users/cs/wcbrown/qepcad/B/QEPCAD.html - -Special Update/Build Instructions ---------------------------------- - -One might need to set MAKE to "make -j1" fo this to be built -successfully. + https://github.com/chriswestbrown/qepcad diff --git a/build/pkgs/qepcad/checksums.ini b/build/pkgs/qepcad/checksums.ini index 5ab616658b0..6a614100808 100644 --- a/build/pkgs/qepcad/checksums.ini +++ b/build/pkgs/qepcad/checksums.ini @@ -1,5 +1,5 @@ -tarball=qepcad-VERSION.tar.gz -sha1=7de9ff3a7ce61e751d91fe5e74079a706174e4fa -md5=61ebb23f407a72cee6142a3b144dea06 -cksum=2428332890 -upstream_url=http://www.usna.edu/Users/cs/wcbrown/qepcad/INSTALL/qepcad-VERSION.tar.gz +tarball=qepcad-VERSION.tar.xz +sha1=3c482a88bf552cea6702e4db6a3d17e4b7549eb6 +md5=7d3f85d253473f6d90d83033ff22820d +cksum=2757536071 +upstream_url=http://deb.debian.org/debian/pool/main/q/qepcad/qepcad_VERSION+ds.orig.tar.xz diff --git a/build/pkgs/qepcad/package-version.txt b/build/pkgs/qepcad/package-version.txt index b477f38083e..bc8a6589c98 100644 --- a/build/pkgs/qepcad/package-version.txt +++ b/build/pkgs/qepcad/package-version.txt @@ -1 +1 @@ -B.1.72 +1.74 diff --git a/build/pkgs/qepcad/patches/qepcad-B-destructor.patch b/build/pkgs/qepcad/patches/qepcad-B-destructor.patch index 2809a0af004..6591e2eecfa 100644 --- a/build/pkgs/qepcad/patches/qepcad-B-destructor.patch +++ b/build/pkgs/qepcad/patches/qepcad-B-destructor.patch @@ -1,6 +1,11 @@ ---- a/extensions/rend/Rend_Sample.cc.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/extensions/rend/Rend_Sample.cc 2018-08-29 20:07:27.087257552 -0600 -@@ -40,11 +40,6 @@ Rend_Sample_1DS::Rend_Sample_1DS(Word C, +Description: Fix abstract base classes with non-virtual destructors. +Origin: https://src.fedoraproject.org/rpms/qepcad-B/blob/91dd25b/f/qepcad-B-destructor.patch +Forwarded: https://github.com/chriswestbrown/qepcad/pull/2 +Last-Update: 2021-06-23 + +--- a/extensions/rend/Rend_Sample.cc ++++ b/extensions/rend/Rend_Sample.cc +@@ -40,11 +40,6 @@ } @@ -12,7 +17,7 @@ /************************************************************* ** Refines I to 2^k or less, and returns binary rational ** middle of interval. -@@ -112,13 +107,6 @@ Rend_Sample_1DO::Rend_Sample_1DO(Rend_Ce +@@ -112,13 +107,6 @@ L.W = NIL; } @@ -26,7 +31,7 @@ Word Rend_Sample_1DO::coordinate(int k) { Word e,j1,j2,J,kp = k; -@@ -178,11 +166,6 @@ Rend_Sample_2DS::Rend_Sample_2DS(Word C) +@@ -178,11 +166,6 @@ } @@ -38,7 +43,7 @@ /************************************************************* ** Refines I to 2^k or less, and returns binary rational ** lower endpoint. -@@ -237,11 +220,6 @@ Rend_Sample_2DC::Rend_Sample_2DC(Word C, +@@ -237,11 +220,6 @@ } @@ -50,7 +55,7 @@ Word Rend_Sample_2DC::coordinate(int k) { return L.W; -@@ -265,11 +243,6 @@ Rend_Sample_BR::Rend_Sample_BR(Word a) +@@ -265,11 +243,6 @@ N.W = a; } @@ -62,9 +67,9 @@ Word Rend_Sample_BR::coordinate(int k) { return N.W; ---- a/extensions/rend/Rend_Sample.h.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/extensions/rend/Rend_Sample.h 2018-08-29 20:07:27.087257552 -0600 -@@ -32,7 +32,7 @@ class Rend_Sample +--- a/extensions/rend/Rend_Sample.h ++++ b/extensions/rend/Rend_Sample.h +@@ -32,7 +32,7 @@ virtual Word coordinate(int k) = 0; virtual Word round(int k,int roundup) { return this -> coordinate(k); } @@ -73,7 +78,7 @@ }; class Rend_Sample_1DS : public Rend_Sample -@@ -49,7 +49,6 @@ private: +@@ -49,7 +49,6 @@ gcmemloc A,I; public: Rend_Sample_1DS(Word C, Word P); @@ -81,7 +86,7 @@ virtual Word coordinate(int k); virtual Word round(int k, int roundup); Word weakcompare(Word R); -@@ -66,7 +65,6 @@ public: +@@ -66,7 +65,6 @@ gcmemloc L; public: Rend_Sample_1DO(Rend_Cell *dad); @@ -89,7 +94,7 @@ virtual Word coordinate(int k); }; -@@ -86,7 +84,6 @@ private: +@@ -86,7 +84,6 @@ gcmemloc A,I; public: Rend_Sample_2DS(Word C); @@ -97,7 +102,7 @@ virtual Word coordinate(int k); }; -@@ -101,7 +98,6 @@ public: +@@ -101,7 +98,6 @@ gcmemloc L; public: Rend_Sample_2DC(Word C,Word P); @@ -105,7 +110,7 @@ virtual Word coordinate(int k); void add_point(Word p); void clear_points(); -@@ -116,7 +112,6 @@ private: +@@ -116,7 +112,6 @@ gcmemloc N; public: Rend_Sample_BR(Word a); @@ -113,9 +118,9 @@ virtual Word coordinate(int k); }; ---- a/plot2d/plot.cc.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/plot2d/plot.cc 2018-08-29 20:07:27.086257553 -0600 -@@ -37,6 +37,7 @@ class CADELT +--- a/plot2d/plot.cc ++++ b/plot2d/plot.cc +@@ -37,6 +37,7 @@ public: virtual bool read(istream &in) = 0; virtual void glRend(const CADColors &C) = 0; diff --git a/build/pkgs/qepcad/patches/qepcad-B-gcc6.patch b/build/pkgs/qepcad/patches/qepcad-B-gcc6.patch index 2caed816ca7..f9846cb9829 100644 --- a/build/pkgs/qepcad/patches/qepcad-B-gcc6.patch +++ b/build/pkgs/qepcad/patches/qepcad-B-gcc6.patch @@ -1,6 +1,11 @@ ---- a/plot2d/plot.cc.orig 2018-08-29 20:10:06.396075816 -0600 -+++ b/plot2d/plot.cc 2018-08-29 20:11:48.982924732 -0600 -@@ -276,7 +276,7 @@ bool SNoverSR::read(istream &in) +Description: Adapt to GCC 6 +Origin: https://src.fedoraproject.org/rpms/qepcad-B/blob/91dd25b/f/qepcad-B-gcc6.patch +Forwarded: https://github.com/chriswestbrown/qepcad/pull/2 +Last-Update: 2021-06-23 + +--- a/plot2d/plot.cc ++++ b/plot2d/plot.cc +@@ -276,7 +276,7 @@ V.resize(N); for(int i = 0; i < N; i++) in >> V[i]; @@ -9,7 +14,7 @@ } void SNoverSR::glRend(const CADColors &C) -@@ -333,7 +333,7 @@ bool SRoverSR::read(istream &in) +@@ -333,7 +333,7 @@ } } @@ -18,7 +23,7 @@ } void SRoverSR::glRend(const CADColors &C) -@@ -351,7 +351,7 @@ bool SRoverSN::read(istream &in) +@@ -351,7 +351,7 @@ { in >> colorType >> a >> b.y; b.x = a.x; @@ -27,7 +32,7 @@ } void SRoverSN::glRend(const CADColors &C) -@@ -365,7 +365,8 @@ void SRoverSN::glRend(const CADColors &C +@@ -365,7 +365,8 @@ bool SNoverSN::read(istream &in) { @@ -37,7 +42,7 @@ } void SNoverSN::glRend(const CADColors &C) -@@ -380,7 +381,8 @@ void SNoverSN::glRend(const CADColors &C +@@ -380,7 +381,8 @@ bool SN::read(istream &in) { @@ -47,7 +52,7 @@ } void SN::glRend(const CADColors &C) -@@ -394,7 +396,8 @@ void SN::glRend(const CADColors &C) +@@ -394,7 +396,8 @@ bool SR::read(istream &in) { diff --git a/build/pkgs/qepcad/patches/qepcad-B-parens.patch b/build/pkgs/qepcad/patches/qepcad-B-parens.patch index 1d881f7467b..4674bf7ef04 100644 --- a/build/pkgs/qepcad/patches/qepcad-B-parens.patch +++ b/build/pkgs/qepcad/patches/qepcad-B-parens.patch @@ -1,6 +1,23 @@ ---- a/extensions/adj2d/truthbytop/BOUNDARY2D.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/extensions/adj2d/truthbytop/BOUNDARY2D.c 2018-08-29 20:07:50.511232206 -0600 -@@ -106,7 +106,7 @@ Step6: /* Split cell list by dimension. +Description: Add parentheses to disambiguate mixed boolean operators. +Origin: https://src.fedoraproject.org/rpms/qepcad-B/blob/60ceecd/f/qepcad-B-parens.patch +Forwarded: https://github.com/chriswestbrown/qepcad/pull/2 +Last-Update: 2021-06-23 + +--- a/extensions/adj2d/truthbytop/BOUNDARY2D.c ++++ b/extensions/adj2d/truthbytop/BOUNDARY2D.c +@@ -38,9 +38,9 @@ + while(S_c != NIL && RED(S_c) != NIL) + { + Word c1 = FIRST(S_c), c2 = SECOND(S_c), c3 = THIRD(S_c); +- if (LELTI(c1,TRUTH) == TRUE && LELTI(c3,TRUTH) == FALSE ++ if ((LELTI(c1,TRUTH) == TRUE && LELTI(c3,TRUTH) == FALSE) + || +- LELTI(c1,TRUTH) == FALSE && LELTI(c3,TRUTH) == TRUE) ++ (LELTI(c1,TRUTH) == FALSE && LELTI(c3,TRUTH) == TRUE)) + { + SLELTI(c2,TRUTH,TRUE); + SLELTI(c2,HOWTV,TOPINF); +@@ -106,7 +106,7 @@ tc++; else fc++; } @@ -9,9 +26,9 @@ GNEWLABEL(v,TRUE,G); else GNEWLABEL(v,FALSE,G); } ---- a/extensions/lift2D/IBPRRIOAP.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/extensions/lift2D/IBPRRIOAP.c 2018-08-29 20:07:50.510232207 -0600 -@@ -95,7 +95,7 @@ Step3: /* Isolate the roots of B(alpha,y +--- a/extensions/lift2D/IBPRRIOAP.c ++++ b/extensions/lift2D/IBPRRIOAP.c +@@ -95,7 +95,7 @@ goto Return; } /* get trend of first root */ @@ -20,9 +37,9 @@ t1 = -1; else t1 = 1; ---- a/extensions/lift2D/modIBPRRIOAP.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/extensions/lift2D/modIBPRRIOAP.c 2018-08-29 20:07:50.510232207 -0600 -@@ -97,7 +97,7 @@ Step3: /* Isolate the roots of B(alpha,y +--- a/extensions/lift2D/modIBPRRIOAP.c ++++ b/extensions/lift2D/modIBPRRIOAP.c +@@ -97,7 +97,7 @@ goto Return; } /* get trend of first root */ @@ -31,9 +48,9 @@ t1 = -1; else t1 = 1; ---- a/source/db/convenientstreams.h.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/source/db/convenientstreams.h 2018-08-29 20:07:50.511232206 -0600 -@@ -31,7 +31,7 @@ public: +--- a/source/db/convenientstreams.h ++++ b/source/db/convenientstreams.h +@@ -31,7 +31,7 @@ string s = ""; char c = in.get(); if (opt == skipleadingws) @@ -42,20 +59,29 @@ // States : 0 = normal, 1 = in comment, 2 = just read a backslash int state = 0; do { ---- a/source/db/SINGULAR.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/source/db/SINGULAR.c 2018-08-29 20:07:50.511232206 -0600 -@@ -58,7 +58,7 @@ void SingularServer::reportStats(ostream +@@ -44,7 +44,7 @@ + if (state == 0 && c == '\\') { state = 2; continue; } + s += c; + state = 0; +- }while(c = in.get()); ++ }while((c = in.get())); + str(s); + } + }; +--- a/source/db/SINGULAR.c ++++ b/source/db/SINGULAR.c +@@ -58,7 +58,7 @@ char peekNonWS(istream &in) { - char c; while((c = in.peek()) && c == ' ' || c == '\t' || c == '\n') in.get(); return c; -+ char c; while(c = in.peek() && (c == ' ' || c == '\t' || c == '\n')) in.get(); return c; ++ char c; while((c = in.peek()) && (c == ' ' || c == '\t' || c == '\n')) in.get(); return c; } ---- a/source/proj/GROUPSAMEPJ.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/source/proj/GROUPSAMEPJ.c 2018-08-29 20:07:50.511232206 -0600 -@@ -46,7 +46,7 @@ BDigit PRJPNTEQUAL(Word A, Word B) +--- a/source/proj/GROUPSAMEPJ.c ++++ b/source/proj/GROUPSAMEPJ.c +@@ -46,7 +46,7 @@ Word KR = LIST2(SECOND(aK),LIST2(1,1)); Word sL = AFSIGN(aM,aI,AFPEMV(1,aM,G,KL)); Word sR = AFSIGN(aM,aI,AFPEMV(1,aM,G,KR)); @@ -64,7 +90,7 @@ } /* One primitive, the other not */ -@@ -75,10 +75,10 @@ Step1: /* Group. */ +@@ -75,10 +75,10 @@ { ADV(Jt,&J2,&Jt); Jt2 = LELTI(J2,PO_POLY); @@ -79,9 +105,9 @@ { SLELTI(J2,PO_PARENT,CONC(LELTI(J2,PO_PARENT),LELTI(J1,PO_PARENT))); t = 1; ---- a/source/proj/PROJMCECmod.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/source/proj/PROJMCECmod.c 2018-08-29 20:07:50.511232206 -0600 -@@ -67,7 +67,7 @@ Step1: /* Obtain coefficients. */ +--- a/source/proj/PROJMCECmod.c ++++ b/source/proj/PROJMCECmod.c +@@ -67,7 +67,7 @@ t = 1; } /* If r = 2 OR r-1 is in free variable space, the leading coefficient is always enough! */ @@ -90,7 +116,7 @@ || (experimentalExtensionFlag && qfrCheckNonNullified(r,Ap1,GVNA.W,GVNQFF.W,GVVL.W)) ) t = 0; -@@ -101,7 +101,7 @@ Step1: /* Obtain coefficients. */ +@@ -101,7 +101,7 @@ tf = tf || (Q == FULLDE || Q == FULLDA); /* Test 3: in free variable space when the PCMZERROR option is used */ @@ -99,9 +125,9 @@ /* Test 4: has no common zero with the system of all other coefficients */ if (!tf) ---- a/source/proj/PROJMCmod.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/source/proj/PROJMCmod.c 2018-08-29 20:07:50.511232206 -0600 -@@ -57,7 +57,7 @@ Step1: /* Obtain coefficients. */ +--- a/source/proj/PROJMCmod.c ++++ b/source/proj/PROJMCmod.c +@@ -57,7 +57,7 @@ t = 1; } /* If r = 2 OR r-1 is in free variable space, the leading coefficient is always enough! */ @@ -110,7 +136,7 @@ || (experimentalExtensionFlag && qfrCheckNonNullified(r,Ap1,GVNA.W,GVNQFF.W,GVVL.W)) ) t = 0; -@@ -91,7 +91,7 @@ Step1: /* Obtain coefficients. */ +@@ -91,7 +91,7 @@ tf = tf || (Q == FULLDE || Q == FULLDA); /* Test 3: in free variable space when the PCMZERROR option is used */ @@ -119,9 +145,9 @@ /* Test 4: has no common zero with the system of all other coefficients */ if (!tf) ---- a/source/ticad/INITPCAD.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/source/ticad/INITPCAD.c 2018-08-29 20:07:50.511232206 -0600 -@@ -14,7 +14,7 @@ Word QepcadCls::INITPCAD() +--- a/source/ticad/INITPCAD.c ++++ b/source/ticad/INITPCAD.c +@@ -14,7 +14,7 @@ Word D, tv; Step0: /* Determine truth value! */ diff --git a/build/pkgs/qepcad/patches/qepcad-B-return.patch b/build/pkgs/qepcad/patches/qepcad-B-return.patch index 04a243a9b72..0d25636bdc6 100644 --- a/build/pkgs/qepcad/patches/qepcad-B-return.patch +++ b/build/pkgs/qepcad/patches/qepcad-B-return.patch @@ -1,6 +1,11 @@ ---- a/extensions/sfext/formula/FTYPEINFO.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/extensions/sfext/formula/FTYPEINFO.c 2018-08-29 20:06:48.870298902 -0600 -@@ -23,6 +23,6 @@ Word FTYPEINFO(Word A) +Description: Fix a non-void function where control can fall off the end. +Origin: https://src.fedoraproject.org/rpms/qepcad-B/blob/91dd25b/f/qepcad-B-return.patch +Forwarded: https://github.com/chriswestbrown/qepcad/pull/2 +Last-Update: 2021-06-23 + +--- a/extensions/sfext/formula/FTYPEINFO.c ++++ b/extensions/sfext/formula/FTYPEINFO.c +@@ -23,6 +23,6 @@ return TRUE; if (FIRST(A) == FALSE) return FALSE; @@ -8,20 +13,9 @@ + FAIL("FTYPEINFO","Unknown formula type!"); } ---- a/source/db/AFUPSFNDB.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/source/db/AFUPSFNDB.c 2018-08-29 20:06:48.871298901 -0600 -@@ -5,7 +5,7 @@ AFUPSFN with Database. - ======================================================================*/ - #include "qepcad.h" - --Word AFUPSFNDB(Word M, Word B, Word *t_, Word *Bt_, Word *F_) -+void AFUPSFNDB(Word M, Word B, Word *t_, Word *Bt_, Word *F_) - { - Word t,Bt,F; - ---- a/source/db/SingSacPolicy.h.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/source/db/SingSacPolicy.h 2018-08-29 20:06:48.872298900 -0600 -@@ -28,17 +28,17 @@ public: +--- a/source/db/SingSacPolicy.h ++++ b/source/db/SingSacPolicy.h +@@ -28,17 +28,17 @@ Word IPRES(Word r, Word A, Word B) { if (r > 2) @@ -43,14 +37,3 @@ } Word IPFACTGB(Word r, Word I, Word N) ---- a/source/qepcad.h.orig 2018-08-29 20:04:27.596451754 -0600 -+++ b/source/qepcad.h 2018-08-29 20:06:48.871298901 -0600 -@@ -34,7 +34,7 @@ Word AFPNIPDB(Word Mb, Word B); - void AFUPGCDB(Word M, Word A, Word B, Word *C_, Word *Ab_, Word *Bb_); - void AFUPLM(Word M, Word A, Word *L_, Word *P_); - void AFUPRWR(Word a, Word v, Word A, Word I); --Word AFUPSFNDB(Word M, Word B, Word *t_, Word *Bt_, Word *F_); -+void AFUPSFNDB(Word M, Word B, Word *t_, Word *Bt_, Word *F_); - Word APPEND(Word P, Word k, Word R); - void APPENDEC(Word P, Word k, Word R, Word *Ps_, Word *F_); - void ATOMFLWR(Word N, Word V, Word A); diff --git a/build/pkgs/qepcad/patches/qepcad-B-signed.patch b/build/pkgs/qepcad/patches/qepcad-B-signed.patch index 4a424aec3aa..c934d513cdf 100644 --- a/build/pkgs/qepcad/patches/qepcad-B-signed.patch +++ b/build/pkgs/qepcad/patches/qepcad-B-signed.patch @@ -1,6 +1,11 @@ ---- a/plot2d/plot.cc.orig 2018-08-29 20:07:27.086257553 -0600 -+++ b/plot2d/plot.cc 2018-08-29 20:08:10.014211101 -0600 -@@ -134,7 +134,7 @@ void* readdata(void *x) +Description: Fix some mixed signed/unsigned operations. +Origin: https://src.fedoraproject.org/rpms/qepcad-B/blob/60ceecd/f/qepcad-B-signed.patch +Forwarded: https://github.com/chriswestbrown/qepcad/pull/2 +Last-Update: 2021-06-23 + +--- a/plot2d/plot.cc ++++ b/plot2d/plot.cc +@@ -134,7 +134,7 @@ pthread_mutex_lock(&M); swap(CE,E); pthread_mutex_unlock(&M); @@ -9,7 +14,7 @@ E.clear(); } else if (c == 'E') { /******* Exit! *******************/ return 0; -@@ -155,7 +155,7 @@ void display() +@@ -155,7 +155,7 @@ { pthread_mutex_lock(&M); glClear(GL_COLOR_BUFFER_BIT); @@ -18,7 +23,7 @@ CE[i]->glRend(Colors); pthread_mutex_unlock(&M); glutSwapBuffers(); -@@ -286,7 +286,7 @@ void SNoverSR::glRend(const CADColors &C +@@ -286,7 +286,7 @@ // 128 or so points that can appear. C.glSetColor(colorType,'D'); glBegin(GL_LINE_STRIP); @@ -27,7 +32,7 @@ glVertex2(V[i]); glEnd(); } -@@ -328,7 +328,7 @@ bool SRoverSR::read(istream &in) +@@ -328,7 +328,7 @@ else { cerr << "Sector over sector in unknown format!" << endl; @@ -36,9 +41,9 @@ cerr << V[i] << endl; exit(1); } ---- a/source/db/SINGULAR.c.orig 2018-08-29 20:07:50.511232206 -0600 -+++ b/source/db/SINGULAR.c 2018-08-29 20:08:10.015211100 -0600 -@@ -67,7 +67,7 @@ Word readSingularPoly(Word r, Word V, is +--- a/source/db/SINGULAR.c ++++ b/source/db/SINGULAR.c +@@ -67,7 +67,7 @@ Word A, t; string s; in >> s; @@ -47,7 +52,7 @@ if (s[i] == '*') s[i] = ' '; s += ".\n"; istringstream si(s); -@@ -108,7 +108,7 @@ string WritePolyForSingular(Word r, Word +@@ -108,7 +108,7 @@ out = sout.str(); } // Put in * symbols @@ -56,18 +61,92 @@ if (out[i] == ' ' && out[i+1] != '+' && out[i+1] != '-' && out[i-1] != '+' && out[i-1] != '-' ) ---- a/source/saclib/gcword.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/source/saclib/gcword.c 2018-08-29 20:08:10.015211100 -0600 -@@ -30,7 +30,7 @@ void gcw_MARK(); +--- a/source/main/qepcadcls.c ++++ b/source/main/qepcadcls.c +@@ -60,7 +60,7 @@ + + void QepcadCls::UnsatCore::OrigAtom::clearTags() + { +- for(int i = 0; i < factors.size(); i++) ++ for(size_t i = 0; i < factors.size(); i++) + factors[i].clearTag(); } - static vector G; --static int lim = 10; -+static size_t lim = 10; +@@ -82,7 +82,7 @@ + } - void clean() + // set in factored form +- for(int k = 0; k < conjuncts.size(); k++) ++ for(int k = 0; (size_t)k < conjuncts.size(); k++) + { + OrigAtom &A = conjuncts[k]; + Word r = A.r; +@@ -205,7 +205,7 @@ + { + if (sign < 0) SWRITE("-"); + if (ICOMP(content,1) != 0) { IWRITE(content); } +- for(int i = 0; i < factors.size(); i++) ++ for(size_t i = 0; i < factors.size(); i++) + factors[i].WRITEFULL(V); + SWRITE(" "); + SWRITE(relopString(relop).c_str()); +@@ -218,7 +218,7 @@ + bool QepcadCls::UnsatCore::OrigAtom::isKnownFalse() { -@@ -62,7 +62,7 @@ void gcw_MARK() + int s = signToSigma(sign); +- for(int i = 0; i < factors.size(); i++) ++ for(size_t i = 0; i < factors.size(); i++) + { + int sf = (factors[i].exp % 2 == 1) ? factors[i].tag : T_square[factors[i].tag]; + s = T_prod[s][sf]; +@@ -235,7 +235,7 @@ + if (LELTI(C,HOWTV) == BYEQC) return; + + // Clear truth tags (i.e. set them all to UNDET) +- for(int i = 0; i < conjuncts.size(); i++) ++ for(size_t i = 0; i < conjuncts.size(); i++) + conjuncts[i].clearTags(); + + int k = LELTI(C,LEVEL); +@@ -252,7 +252,7 @@ + { + int s = FIRST(Si); + vector< pair > &V = appearsIn[pair(i,j)]; +- for(int h = 0; h < V.size(); h++) ++ for(size_t h = 0; h < V.size(); h++) + { + int a = V[h].first, b = V[h].second; + conjuncts[a].factors[b].tag = signToSigma(s); +@@ -262,7 +262,7 @@ + + // go through each input atomic formula to determine if it's known to be false + Word K = NIL; +- for(int i = 0; i < conjuncts.size(); i++) ++ for(int i = 0; (size_t)i < conjuncts.size(); i++) + { + if (conjuncts[i].isKnownFalse()) + { +@@ -280,7 +280,7 @@ + // Add equational constraints as size 1 sets. Recall, right now + // we adopt the expedient of making the unsat core include all + // equational constraints. +- for(int i = 0; i < conjuncts.size(); i++) ++ for(int i = 0; (size_t)i < conjuncts.size(); i++) + { + if (conjuncts[i].relop == EQOP) + MHSP = COMP(LIST1(i),MHSP); +--- a/source/saclib/gcword.c ++++ b/source/saclib/gcword.c +@@ -54,7 +54,7 @@ + void gcw_register(Word *p) + { + G.push_back(p); +- if (G.size() == lim) ++ if (G.size() == (size_t)lim) + clean(); + } + +@@ -62,7 +62,7 @@ { // SWRITE("gcw size is: ");IWRITE(G.size()); SWRITE("\n"); clean(); diff --git a/build/pkgs/qepcad/patches/qepcad-B-syntax.patch b/build/pkgs/qepcad/patches/qepcad-B-syntax.patch index 832cdbee4e3..078bacfa606 100644 --- a/build/pkgs/qepcad/patches/qepcad-B-syntax.patch +++ b/build/pkgs/qepcad/patches/qepcad-B-syntax.patch @@ -1,6 +1,11 @@ ---- a/source/main/BEGINQEPCAD.c.orig 2018-08-29 20:03:05.718540333 -0600 -+++ b/source/main/BEGINQEPCAD.c 2018-08-29 20:09:45.542106837 -0600 -@@ -53,7 +53,7 @@ void BEGINQEPCAD(int &argc, char**& argv +Description: Fix syntactically incorrect expressions. +Origin: https://src.fedoraproject.org/rpms/qepcad-B/blob/91dd25b/f/qepcad-B-syntax.patch +Forwarded: https://github.com/chriswestbrown/qepcad/pull/2 +Last-Update: 2021-06-23 + +--- a/source/main/BEGINQEPCAD.c ++++ b/source/main/BEGINQEPCAD.c +@@ -53,7 +53,7 @@ { int tmp = system("bash -c 'exit $(stty size | cut -d\" \" -f2)'"); tmp = WEXITSTATUS(tmp); @@ -9,9 +14,9 @@ cols = tmp; } ---- a/source/userint/USERINT.c.orig 2018-03-16 14:22:00.000000000 -0600 -+++ b/source/userint/USERINT.c 2018-08-29 20:09:45.543106835 -0600 -@@ -492,7 +492,7 @@ void VERTFILL2D(Word D) +--- a/source/userint/USERINT.c ++++ b/source/userint/USERINT.c +@@ -507,7 +507,7 @@ Word L, S, T, CB; /* GET 1D CAD STACK */ diff --git a/build/pkgs/qepcad/patches/qepcad-B-tty.patch b/build/pkgs/qepcad/patches/qepcad-B-tty.patch index 0bda2e973b8..9b67d25846c 100644 --- a/build/pkgs/qepcad/patches/qepcad-B-tty.patch +++ b/build/pkgs/qepcad/patches/qepcad-B-tty.patch @@ -1,5 +1,11 @@ ---- a/source/db/SINGULAR.c.orig 2018-08-29 20:10:06.406075801 -0600 -+++ b/source/db/SINGULAR.c 2018-08-29 20:11:02.229992773 -0600 +Description: Tell Singular not to steal the TTY +Origin: https://src.fedoraproject.org/rpms/qepcad-B/blob/91dd25b/f/qepcad-B-tty.patch +Bug: https://bugzilla.redhat.com/1257471 +Forwarded: https://github.com/chriswestbrown/qepcad/pull/2 +Last-Update: 2021-06-23 + +--- a/source/db/SINGULAR.c ++++ b/source/db/SINGULAR.c @@ -1,6 +1,7 @@ #include "SINGULAR.h" #include @@ -8,7 +14,7 @@ using namespace std; -@@ -15,6 +16,12 @@ SingularServer::SingularServer(string Si +@@ -15,6 +16,12 @@ if (childpid == 0) { intoSingular.setStdinToPipe(); outofSingular.setStdoutToPipe(); @@ -21,7 +27,7 @@ // Begin: Just for debug!! //system("/home/wcbrown/bin/Singular -q --no-warn --min-time=0.001 --ticks-per-sec=1000 | tee /tmp/SingOutLog"); -@@ -30,9 +37,10 @@ SingularServer::SingularServer(string Si +@@ -30,9 +37,10 @@ "--ticks-per-sec=1000", NULL); perror("SingularServer Constructor: Singular startup failed! (Set SINGULAR environment variable)"); @@ -33,9 +39,9 @@ } SingularServer::~SingularServer() ---- a/source/db/unnamedpipe.h.orig 2018-08-29 20:10:06.406075801 -0600 -+++ b/source/db/unnamedpipe.h 2018-08-29 20:11:02.229992773 -0600 -@@ -113,6 +113,7 @@ public: +--- a/source/db/unnamedpipe.h ++++ b/source/db/unnamedpipe.h +@@ -113,6 +113,7 @@ int fdout() { return fd[1]; } int setStdinToPipe() { return dup2(fdin(),fileno(stdin)); } int setStdoutToPipe() { return dup2(fdout(),fileno(stdout)); } diff --git a/build/pkgs/qepcad/patches/qepcad-B-uninit.patch b/build/pkgs/qepcad/patches/qepcad-B-uninit.patch index f78e4c2239a..e75cd6846cf 100644 --- a/build/pkgs/qepcad/patches/qepcad-B-uninit.patch +++ b/build/pkgs/qepcad/patches/qepcad-B-uninit.patch @@ -1,15 +1,30 @@ ---- a/cad2d/src/TICAD.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/cad2d/src/TICAD.c 2018-08-29 20:05:52.862359504 -0600 -@@ -43,6 +43,8 @@ Step2: /* Choose. */ - if (L == 0) { /* Init for 1D Sectors */ - L = LELTI(D,CHILD); - d = 1; } -+ else -+ d = 0; - - if (d == 1 && L != NIL) { /* Choose next 1D sectors */ - c = FIRST(L); -@@ -51,6 +53,7 @@ Step2: /* Choose. */ +Description: Fix use of uninitialized variables. +Origin: https://src.fedoraproject.org/rpms/qepcad-B/blob/60ceecd/f/qepcad-B-uninit.patch +Forwarded: https://github.com/chriswestbrown/qepcad/pull/2 +Last-Update: 2021-06-23 + +--- a/cad2d/src/CAD2D.c ++++ b/cad2d/src/CAD2D.c +@@ -23,6 +23,8 @@ + Word A,D,F,F_e,F_n,F_s,Fh,J,P,Q,Ths,f,i,r,t; + Word L; + Step1: /* Normalize. */ ++ t = -1; ++ F_e = F_n = F_s = NIL; + FIRST4(Fs,&r,&f,&Q,&Fh); + F = NORMQFF(Fh); + GVNQFF = F; +--- a/cad2d/src/TICAD.c ++++ b/cad2d/src/TICAD.c +@@ -30,6 +30,7 @@ + Step1: /* Initialize. */ + D = INITPCAD(); + L = 0; ++ d = 0; + + Step2: /* Choose. */ + GVPC = D; +@@ -51,6 +52,7 @@ else L = RED2(L); } else if (d == 1 && L == NIL) { /* Init for 1D sections */ @@ -17,9 +32,9 @@ d = 0; L = RED(LELTI(D,CHILD)); } ---- a/extensions/adj2d/oldadj/ACMADJ2D.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/extensions/adj2d/oldadj/ACMADJ2D.c 2018-08-29 20:05:52.864359502 -0600 -@@ -29,6 +29,7 @@ Step1: /* Get (A,I) defining c. */ +--- a/extensions/adj2d/oldadj/ACMADJ2D.c ++++ b/extensions/adj2d/oldadj/ACMADJ2D.c +@@ -29,6 +29,7 @@ FIRST2(Ip,&ip1,&ip2); i1 = RNLBRN(ip1); i2 = RNLBRN(ip2); @@ -27,9 +42,9 @@ Step2: /* Get sample points for c_l and c_r. */ i_l = RNLBRN(SPRLC(c_l)); ---- a/extensions/lift2D/modHIPRRID.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/extensions/lift2D/modHIPRRID.c 2018-08-29 20:05:52.864359502 -0600 -@@ -28,6 +28,7 @@ Step1: /* Compute a bound for the positi +--- a/extensions/lift2D/modHIPRRID.c ++++ b/extensions/lift2D/modHIPRRID.c +@@ -28,6 +28,7 @@ k = HIPPRB(n,A); Step2: /* Isolate the positive roots. */ @@ -37,9 +52,9 @@ if (k == NIL) { L1 = NIL; goto Step3; } ---- a/extensions/lift2D/modIBPRRIOAPSF.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/extensions/lift2D/modIBPRRIOAPSF.c 2018-08-29 20:05:52.863359503 -0600 -@@ -77,6 +77,7 @@ Step4: /* Isolate the real roots of eac +--- a/extensions/lift2D/modIBPRRIOAPSF.c ++++ b/extensions/lift2D/modIBPRRIOAPSF.c +@@ -77,6 +77,7 @@ Step5: /* Refine roots? */ if (k == NIL) goto Return; @@ -47,9 +62,9 @@ Ls = NIL; for(Lp = L; Lp != NIL; Lp = RED(Lp)) { ---- a/extensions/rend/WRITE_PS_INTERACTIVE.cc.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/extensions/rend/WRITE_PS_INTERACTIVE.cc 2018-08-29 20:05:52.863359503 -0600 -@@ -262,6 +262,8 @@ void WRITE_PS_INTERACTIVE(Rend_Cell &M, +--- a/extensions/rend/WRITE_PS_INTERACTIVE.cc ++++ b/extensions/rend/WRITE_PS_INTERACTIVE.cc +@@ -262,6 +262,8 @@ if (t == 'p') { SWRITE("Enter projetion factor by (level,index): "); p = LREAD(); } @@ -58,9 +73,9 @@ switch(c) { case 'x': // 1D Sectors ---- a/extensions/sfext/addpol/MINPFSETNSC.c.orig 2018-08-29 20:03:25.110519357 -0600 -+++ b/extensions/sfext/addpol/MINPFSETNSC.c 2018-08-29 20:05:52.865359501 -0600 -@@ -42,7 +42,7 @@ Word MINPFSETNSC(Word P,Word S,Word D,Wo +--- a/extensions/sfext/addpol/MINPFSETNSC.c ++++ b/extensions/sfext/addpol/MINPFSETNSC.c +@@ -42,7 +42,7 @@ Word x_s,js,Ls,O,Q,Q_i,Sp,Pp,i,Cp,*V,*Vp,**A,a,N,k,S_r,I,j,p; Step1: /* Initialization. */ @@ -69,9 +84,9 @@ Step2: /* Loop over each level in D. */ for(r = 1; r <= N; r++) { ---- a/extensions/sfext/espcad/PCAD2ESPCAD.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/extensions/sfext/espcad/PCAD2ESPCAD.c 2018-08-29 20:05:52.866359500 -0600 -@@ -44,6 +44,8 @@ Step2: /* Generate correct i-level signi +--- a/extensions/sfext/espcad/PCAD2ESPCAD.c ++++ b/extensions/sfext/espcad/PCAD2ESPCAD.c +@@ -44,6 +44,8 @@ P_i = RED(P_i); s = RED(s); } s = INV(ss); } @@ -80,9 +95,9 @@ Step3: /* Construct extended Sub-CAD cell structure. */ EDs = LIST8(C,A,LELTI(Ds,SC_INX),NIL,s,NIL,UNDET,UNDET); ---- a/extensions/sfext/extlang/SCAD2ESCAD.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/extensions/sfext/extlang/SCAD2ESCAD.c 2018-08-29 20:05:52.864359502 -0600 -@@ -27,6 +27,8 @@ Step2: /* Generate correct i-level signi +--- a/extensions/sfext/extlang/SCAD2ESCAD.c ++++ b/extensions/sfext/extlang/SCAD2ESCAD.c +@@ -27,6 +27,8 @@ P_i = RED(P_i); s = RED(s); } s = INV(ss); } @@ -91,9 +106,9 @@ Step3: /* Construct extended Sub-CAD cell structure. */ EDs = LIST7(C,A,LELTI(Ds,SC_INX),NIL,s,NIL,UNDET); ---- a/extensions/sfext/formula/FMAATOMREAD.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/extensions/sfext/formula/FMAATOMREAD.c 2018-08-29 20:05:52.865359501 -0600 -@@ -18,7 +18,7 @@ void FMAATOMREAD(Word Q, Word V, Word *F +--- a/extensions/sfext/formula/FMAATOMREAD.c ++++ b/extensions/sfext/formula/FMAATOMREAD.c +@@ -18,7 +18,7 @@ /* hide r,s,t; */ Step1: /* Read the left polynomial. */ @@ -102,7 +117,7 @@ IPEXPREAD(r,V,&P1,&t); if (t == 0) goto Return; Step2: /* Read the relational operator. */ -@@ -71,6 +71,7 @@ Word POLYINDEX(Word P, Word p, Word r, W +@@ -71,6 +71,7 @@ p = SECOND(p); /* Is p already in P? */ @@ -110,9 +125,9 @@ P_r = LELTI(P,r); *t = 0; for(Pp = P_r; Pp != NIL; Pp = RED(Pp)) { pp = FIRST(Pp); ---- a/extensions/sfext/formula/FMASMOOTH.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/extensions/sfext/formula/FMASMOOTH.c 2018-08-29 20:05:52.865359501 -0600 -@@ -16,6 +16,7 @@ Step1: /* Atoms and Constants. */ +--- a/extensions/sfext/formula/FMASMOOTH.c ++++ b/extensions/sfext/formula/FMASMOOTH.c +@@ -16,6 +16,7 @@ if (ISLIST(F1) || F1 == TRUE || F1 == FALSE) { G = F; goto Return; } @@ -120,9 +135,9 @@ Step2: /* AND's */ if (F1 == ANDOP) { ---- a/extensions/sfext/sfcons/SFC3.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/extensions/sfext/sfcons/SFC3.c 2018-08-29 20:05:52.865359501 -0600 -@@ -90,7 +90,7 @@ Step3: /* The normal language. */ +--- a/extensions/sfext/sfcons/SFC3.c ++++ b/extensions/sfext/sfcons/SFC3.c +@@ -90,7 +90,7 @@ switch(m) { case (0) : SF = NECCONDS(Lt,Lf,LA,Pp); break; case (1) : SF = NAIVESF(Lt,Lf,LA,Pp); break; @@ -131,9 +146,9 @@ Step4: /* Massage the formula. */ pflag = 1; ---- a/extensions/sfext/sfcons/SFC3f.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/extensions/sfext/sfcons/SFC3f.c 2018-08-29 20:05:52.865359501 -0600 -@@ -88,7 +88,7 @@ Step3: /* The normal language. */ +--- a/extensions/sfext/sfcons/SFC3f.c ++++ b/extensions/sfext/sfcons/SFC3f.c +@@ -88,7 +88,7 @@ switch(m) { case (0) : SF = NECCONDS(Lt,Lf,LA,Pp); break; case (1) : SF = NAIVESF(Lt,Lf,LA,Pp); break; @@ -142,9 +157,9 @@ Step4: /* Massage the formula. */ pflag = 1; ---- a/extensions/sfext/sfcons/SFC4.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/extensions/sfext/sfcons/SFC4.c 2018-08-29 20:05:52.865359501 -0600 -@@ -31,6 +31,7 @@ void QepcadCls::SFC4(Word D, Word P, Wor +--- a/extensions/sfext/sfcons/SFC4.c ++++ b/extensions/sfext/sfcons/SFC4.c +@@ -31,6 +31,7 @@ { Word t,SF,Dp,Pp,Lt,Lf,LA,Q,D1,P1,D0,P0,J0,i,Lp,pflag; char e,s,m,c; @@ -152,9 +167,9 @@ T1 = T2 = T3 = T4 = 0; F1 = 0; ---- a/extensions/sfext/sfcons/SFCFULLDf.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/extensions/sfext/sfcons/SFCFULLDf.c 2018-08-29 20:05:52.865359501 -0600 -@@ -52,6 +52,7 @@ Step2: /* Extended language. */ +--- a/extensions/sfext/sfcons/SFCFULLDf.c ++++ b/extensions/sfext/sfcons/SFCFULLDf.c +@@ -52,6 +52,7 @@ if (Lt == NIL && Lf == NIL) { SWRITE("No cells have truth values!\n"); @@ -162,9 +177,9 @@ goto Return; } t = ESPCADDOPFSUFF(Pp,LIST1(Dp)); LA = LISTOETAmod(Pp,n,t==NIL); ---- a/source/io/ATOMFRDR.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/source/io/ATOMFRDR.c 2018-08-29 20:05:52.866359500 -0600 -@@ -76,7 +76,7 @@ void ETFATOMRDR(Word V, Word P1, BDigit +--- a/source/io/ATOMFRDR.c ++++ b/source/io/ATOMFRDR.c +@@ -76,7 +76,7 @@ Word t, F, r, j, P2, P2p, r1, r2, a, P, s; Step1: /* Prepare */ @@ -173,9 +188,9 @@ Step2: /* Read "_root_" */ ---- a/source/io/CATTRNRDR.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/source/io/CATTRNRDR.c 2018-08-29 20:05:52.866359500 -0600 -@@ -39,7 +39,7 @@ Step2: /* Get the internal representatio +--- a/source/io/CATTRNRDR.c ++++ b/source/io/CATTRNRDR.c +@@ -39,7 +39,7 @@ goto Return; Step3: /* Error exit. */ @@ -184,9 +199,9 @@ Return: /* Prepare for return. */ *V_ = V; ---- a/source/io/DESIREDRDR.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/source/io/DESIREDRDR.c 2018-08-29 20:05:52.867359499 -0600 -@@ -15,6 +15,7 @@ void DESIREDRDR(Word *F_, Word *t_) +--- a/source/io/DESIREDRDR.c ++++ b/source/io/DESIREDRDR.c +@@ -15,6 +15,7 @@ /* hide C,C1,R,V1,V2,t; */ Step1: /* Atomic condition. */ @@ -194,9 +209,9 @@ t = 1; C = CREADB(); if (C == '[') goto Step2; BKSP(); ---- a/source/io/FREADR.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/source/io/FREADR.c 2018-08-29 20:05:52.866359500 -0600 -@@ -23,7 +23,7 @@ void FREADR(Word V, Word f, Word *Fs_, W +--- a/source/io/FREADR.c ++++ b/source/io/FREADR.c +@@ -23,7 +23,7 @@ /* hide C,i,q,r,t; */ Step1: /* Read quantifier list. */ @@ -205,9 +220,9 @@ for (i = f + 1; i <= r; i++) { C = CREADB(); ---- a/source/io/GREADR.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/source/io/GREADR.c 2018-08-29 20:05:52.867359499 -0600 -@@ -33,7 +33,7 @@ Step2: /* Read digits and convert. */ +--- a/source/io/GREADR.c ++++ b/source/io/GREADR.c +@@ -33,7 +33,7 @@ BKSP(); a = S * a; goto Return; Step3: /* Error. */ @@ -216,9 +231,9 @@ Return: /* Prepare for return. */ *a_ = a; ---- a/source/io/LGOPRDR.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/source/io/LGOPRDR.c 2018-08-29 20:05:52.866359500 -0600 -@@ -50,7 +50,7 @@ Step1: /* Read in. */ +--- a/source/io/LGOPRDR.c ++++ b/source/io/LGOPRDR.c +@@ -50,7 +50,7 @@ { SWRITE("Error LGOPRDR: Logic operator was expected.\n"); goto Step2; } Step2: /* Error exit. */ @@ -227,9 +242,9 @@ Return: /* Prepare for return. */ *p_ = p; ---- a/source/io/QFRDR.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/source/io/QFRDR.c 2018-08-29 20:05:52.867359499 -0600 -@@ -39,7 +39,7 @@ Step1: /* Read in. */ +--- a/source/io/QFRDR.c ++++ b/source/io/QFRDR.c +@@ -39,7 +39,7 @@ goto Return; Step2: /* Error exit. */ @@ -238,9 +253,9 @@ Return: /* Prepare for return. */ *q_ = q; ---- a/source/io/RLOPRDR.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/source/io/RLOPRDR.c 2018-08-29 20:05:52.866359500 -0600 -@@ -31,7 +31,7 @@ Step1: /* Read in. */ +--- a/source/io/RLOPRDR.c ++++ b/source/io/RLOPRDR.c +@@ -31,7 +31,7 @@ goto Return; Step2: /* Error exit. */ @@ -249,31 +264,31 @@ Return: /* Prepare for return. */ *p_ = p; ---- a/source/main/QEPCADauto.c.orig 2018-03-16 14:22:00.000000000 -0600 -+++ b/source/main/QEPCADauto.c 2018-08-29 20:05:52.867359499 -0600 -@@ -27,6 +27,8 @@ void QepcadCls::QEPCADauto(Word Fs, Word +--- a/source/main/QEPCADauto.c ++++ b/source/main/QEPCADauto.c +@@ -27,6 +27,8 @@ char c1,c2; /* Chris variables. */ Step1: /* Normalize. */ -+ t = 0; ++ t = -1; + F_e = F_n = F_s = NIL; FIRST4(Fs,&r,&f,&Q,&Fh); F = NORMQFF(Fh); if (GVUA != NIL) GVNA = NORMQFF(GVUA); ---- a/source/main/QEPCAD.c.orig 2018-03-16 14:22:00.000000000 -0600 -+++ b/source/main/QEPCAD.c 2018-08-29 20:05:52.867359499 -0600 -@@ -26,6 +26,8 @@ void QepcadCls::QEPCAD(Word Fs, Word *t_ +--- a/source/main/QEPCAD.c ++++ b/source/main/QEPCAD.c +@@ -26,6 +26,8 @@ Word Cs,Ps,Qs,Pps,Cps,Qps,SF; /* Chris variables. */ char c1,c2; /* Chris variables. */ Step1: /* Normalize. */ -+ t = 0; ++ t = -1; + F_e = F_n = F_s = NIL; FIRST4(Fs,&r,&f,&Q,&Fh); /*Int*/ PCNSTEP = 1; /*Int*/ if (INTERACT()) USERINT(LFS("Before Normalization"),'a'); ---- a/source/ticad/AFUPMPR.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/source/ticad/AFUPMPR.c 2018-08-29 20:05:52.867359499 -0600 -@@ -27,6 +27,7 @@ void AFUPMPR(Word M, Word I, Word B, Wor +--- a/source/ticad/AFUPMPR.c ++++ b/source/ticad/AFUPMPR.c +@@ -27,6 +27,7 @@ /* hide L1,Lp,j,jp,s,t,v,vp; */ Step1: /* Initialize. */ @@ -281,9 +296,9 @@ FIRST2(J,&a,&b); t = AFUPSR(M,I,B,b); if (t == 0) ---- a/source/ticad/SUBST.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/source/ticad/SUBST.c 2018-08-29 20:05:52.867359499 -0600 -@@ -24,6 +24,7 @@ Word QepcadCls::SUBST(Word c, Word k, Wo +--- a/source/ticad/SUBST.c ++++ b/source/ticad/SUBST.c +@@ -24,6 +24,7 @@ Word P,L,Sp,T1,T2,G,Q,f,i; Step1: /* Substitute. */ @@ -291,9 +306,9 @@ L = NIL; S = NIL; Bp = B; ---- a/source/ticad/SUBSTR.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/source/ticad/SUBSTR.c 2018-08-29 20:05:52.868359497 -0600 -@@ -24,6 +24,7 @@ Word QepcadCls::SUBSTR(Word c, Word k, W +--- a/source/ticad/SUBSTR.c ++++ b/source/ticad/SUBSTR.c +@@ -24,6 +24,7 @@ Word P,L,Q,T1,T2,Sp,G,f,i; Step1: /* Do it. */ @@ -301,9 +316,9 @@ L = NIL; S = NIL; Bp = B; ---- a/source/userint/PREQNCONSTL.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/source/userint/PREQNCONSTL.c 2018-08-29 20:05:52.868359497 -0600 -@@ -73,7 +73,7 @@ Return: /* Prepare for return. */ +--- a/source/userint/PREQNCONSTL.c ++++ b/source/userint/PREQNCONSTL.c +@@ -73,7 +73,7 @@ Word POLYLABEL(Word P, Word p, Word r, Word *t) { diff --git a/build/pkgs/qepcad/patches/qepcad-B-unused.patch b/build/pkgs/qepcad/patches/qepcad-B-unused.patch index b14ade83ae3..6224c1e3a74 100644 --- a/build/pkgs/qepcad/patches/qepcad-B-unused.patch +++ b/build/pkgs/qepcad/patches/qepcad-B-unused.patch @@ -1,5 +1,10 @@ ---- a/cad2d/src/CAD2D.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/cad2d/src/CAD2D.c 2018-08-29 20:10:06.394075819 -0600 +Description: Remove unused variables and static functions. +Origin: https://src.fedoraproject.org/rpms/qepcad-B/blob/60ceecd/f/qepcad-B-unused.patch +Forwarded: https://github.com/chriswestbrown/qepcad/pull/2 +Last-Update: 2021-06-23 + +--- a/cad2d/src/CAD2D.c ++++ b/cad2d/src/CAD2D.c @@ -20,8 +20,8 @@ void QepcadCls2D::CAD2D(Word Fs, Word *t_, Word *F_e_, Word *F_n_, Word *F_s_) @@ -9,9 +14,9 @@ + Word A,D,F,F_e,F_n,F_s,Fh,J,P,Q,f,i,r,t; + Step1: /* Normalize. */ - FIRST4(Fs,&r,&f,&Q,&Fh); - F = NORMQFF(Fh); -@@ -70,9 +70,7 @@ Word AllAdjs(QepcadCls2D &Q, Word D,Word + t = -1; + F_e = F_n = F_s = NIL; +@@ -72,9 +72,7 @@ Word printgraph(Word D, Word L) { @@ -22,9 +27,9 @@ SWRITE("graph: {\n"); ---- a/cad2d/src/CONSTRUCT.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/cad2d/src/CONSTRUCT.c 2018-08-29 20:10:06.395075818 -0600 -@@ -19,31 +19,10 @@ Construct a stack. +--- a/cad2d/src/CONSTRUCT.c ++++ b/cad2d/src/CONSTRUCT.c +@@ -19,31 +19,10 @@ ======================================================================*/ #include "cad2d.h" @@ -57,9 +62,9 @@ Step1: /* Extract the projection factors from their attribute lists. */ Word Ps = Ps_; ---- a/cad2d/src/PROJECT.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/cad2d/src/PROJECT.c 2018-08-29 20:10:06.395075818 -0600 -@@ -17,7 +17,7 @@ Projection Phase. +--- a/cad2d/src/PROJECT.c ++++ b/cad2d/src/PROJECT.c +@@ -17,7 +17,7 @@ void QepcadCls2D::PROJECT(Word r, Word A,Word *P_, Word *J_) { @@ -68,9 +73,9 @@ Step1: /* Initialize. */ P = LLCOPY(A); ---- a/cad2d/src/TICAD.c.orig 2018-08-29 20:05:52.862359504 -0600 -+++ b/cad2d/src/TICAD.c 2018-08-29 20:10:06.394075819 -0600 -@@ -24,7 +24,7 @@ Output +--- a/cad2d/src/TICAD.c ++++ b/cad2d/src/TICAD.c +@@ -24,7 +24,7 @@ Word QepcadCls2D::TICAD(Word Q,Word F,Word f,Word P,Word A) { @@ -79,9 +84,9 @@ Word L,d; Step1: /* Initialize. */ ---- a/extensions/adj2d/ADJ_2D1.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/extensions/adj2d/ADJ_2D1.c 2018-08-29 20:10:06.400075810 -0600 -@@ -16,6 +16,7 @@ Outputs +--- a/extensions/adj2d/ADJ_2D1.c ++++ b/extensions/adj2d/ADJ_2D1.c +@@ -16,6 +16,7 @@ #include "adj2D.h" #include "adj2D.h" /**************************************/ @@ -89,7 +94,7 @@ static FILE *OUTPUT; static void init() -@@ -30,6 +31,7 @@ static void uninit() +@@ -30,6 +31,7 @@ { fclose(OUTPUT); } @@ -97,9 +102,9 @@ /**************************************/ ---- a/extensions/adj2d/ADJ_2D1P2.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/extensions/adj2d/ADJ_2D1P2.c 2018-08-29 20:10:06.401075809 -0600 -@@ -9,7 +9,7 @@ void sa_send(const char* S); +--- a/extensions/adj2d/ADJ_2D1P2.c ++++ b/extensions/adj2d/ADJ_2D1P2.c +@@ -9,7 +9,7 @@ Word ADJ_2D1P2(Word U, Word V, Word w_l, Word B) { @@ -108,9 +113,9 @@ /*sa_send("[");*/ ---- a/extensions/adj2d/ADJ_2D.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/extensions/adj2d/ADJ_2D.c 2018-08-29 20:10:06.400075810 -0600 -@@ -17,12 +17,6 @@ Outputs +--- a/extensions/adj2d/ADJ_2D.c ++++ b/extensions/adj2d/ADJ_2D.c +@@ -17,12 +17,6 @@ ======================================================================*/ #include "adj2D.h" #include "adj2D.h" @@ -123,7 +128,7 @@ Word ADJ_2D(Word c, Word c_l, Word c_r, Word P, Word J) { -@@ -37,18 +31,3 @@ Word ADJ_2D(Word c, Word c_l, Word c_r, +@@ -37,18 +31,3 @@ return Sol; } @@ -142,9 +147,9 @@ - IWRITE(ADJ_D_Time); - SWRITE(" millseconds.\n"); -} ---- a/extensions/adj2d/ADJ_2D_PART.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/extensions/adj2d/ADJ_2D_PART.c 2018-08-29 20:10:06.401075809 -0600 -@@ -80,8 +80,3 @@ Step5: /* Clean up evidence of "shadow s +--- a/extensions/adj2d/ADJ_2D_PART.c ++++ b/extensions/adj2d/ADJ_2D_PART.c +@@ -80,8 +80,3 @@ Return: /* Prepare to return. */ return Sol; } @@ -153,9 +158,9 @@ -{ - -} ---- a/extensions/adj2d/oldadj/ACMADJ2D.c.orig 2018-08-29 20:05:52.864359502 -0600 -+++ b/extensions/adj2d/oldadj/ACMADJ2D.c 2018-08-29 20:10:06.400075810 -0600 -@@ -239,7 +239,7 @@ Step3: /* Make assignments. */ +--- a/extensions/adj2d/oldadj/ACMADJ2D.c ++++ b/extensions/adj2d/oldadj/ACMADJ2D.c +@@ -239,7 +239,7 @@ Word ASYS2(Word M, Word H, Word I, Word P2) { @@ -164,9 +169,9 @@ tH = -LBRNSIGN(IUPLBREVAL(M,FIRST(H))); tI = LBRNSIGN(IUPLBREVAL(M,SECOND(I))); ---- a/extensions/adj2d/P1.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/extensions/adj2d/P1.c 2018-08-29 20:10:06.401075809 -0600 -@@ -25,7 +25,7 @@ Notes: P1 has three main cases to deal w +--- a/extensions/adj2d/P1.c ++++ b/extensions/adj2d/P1.c +@@ -25,7 +25,7 @@ Word P1(Word U, Word V, Word W, Word v_l, Word B) { @@ -175,9 +180,9 @@ Sol = NIL; As = NIL; ---- a/extensions/adj2d/P3.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/extensions/adj2d/P3.c 2018-08-29 20:10:06.401075809 -0600 -@@ -29,7 +29,7 @@ Note: Program 3 is the first called, an +--- a/extensions/adj2d/P3.c ++++ b/extensions/adj2d/P3.c +@@ -29,7 +29,7 @@ Word P3(Word U, Word V, Word W, Word v_l, Word B) { @@ -186,9 +191,9 @@ Step1: /* Special Case: No adjacencies to determine. */ if (U == NIL && W == NIL) ---- a/extensions/adj2d/P4.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/extensions/adj2d/P4.c 2018-08-29 20:10:06.400075810 -0600 -@@ -25,7 +25,7 @@ Notes: Program 4 tries to find solutions +--- a/extensions/adj2d/P4.c ++++ b/extensions/adj2d/P4.c +@@ -25,7 +25,7 @@ Word P4(Word U, Word V, Word W, Word v_l, Word B) { @@ -197,9 +202,9 @@ Step1: /* Loop. */ J = LIST2(B,AD2D_N_In); Sol = NIL; As = NIL; ---- a/extensions/adj2d/sac_ext/IUPTSII.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/extensions/adj2d/sac_ext/IUPTSII.c 2018-08-29 20:10:06.401075809 -0600 -@@ -14,7 +14,7 @@ Outputs +--- a/extensions/adj2d/sac_ext/IUPTSII.c ++++ b/extensions/adj2d/sac_ext/IUPTSII.c +@@ -14,7 +14,7 @@ Word IUPTSII(Word A, Word I) { @@ -208,9 +213,9 @@ Step1: /* One-point interval. */ FIRST2(I,&i1,&i2); ---- a/extensions/adj2d/truthbytop/ADJ2DITOEL.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/extensions/adj2d/truthbytop/ADJ2DITOEL.c 2018-08-29 20:10:06.400075810 -0600 -@@ -27,7 +27,7 @@ int bc(int a, int b) +--- a/extensions/adj2d/truthbytop/ADJ2DITOEL.c ++++ b/extensions/adj2d/truthbytop/ADJ2DITOEL.c +@@ -27,7 +27,7 @@ Word ADJ2DITOEL(Word L, Word c1, Word c0) { @@ -219,9 +224,9 @@ Step1: /* Initialize & Special Case. */ E = NIL; ---- a/extensions/adj2d/truthbytop/GRAPHMODULE.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/extensions/adj2d/truthbytop/GRAPHMODULE.c 2018-08-29 20:10:06.400075810 -0600 -@@ -61,9 +61,9 @@ Return: /* Prepare to return. */ +--- a/extensions/adj2d/truthbytop/GRAPHMODULE.c ++++ b/extensions/adj2d/truthbytop/GRAPHMODULE.c +@@ -61,9 +61,9 @@ Word GSTACKHANDLE(Word i, Word G_) { @@ -234,7 +239,7 @@ if (G == NIL || FIRST(FIRST(G)) != i) h = NIL; else -@@ -74,7 +74,7 @@ Word GSTACKHANDLE(Word i, Word G_) +@@ -74,7 +74,7 @@ Word GVERTEXHANDLE(Word v, Word G_) { @@ -243,9 +248,9 @@ FIRST2(v,&i,&j); h = GSTACKHANDLE(i,G_); ---- a/extensions/lift2D/IBPRRIOAPSF.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/extensions/lift2D/IBPRRIOAPSF.c 2018-08-29 20:10:06.399075811 -0600 -@@ -30,8 +30,8 @@ Outputs +--- a/extensions/lift2D/IBPRRIOAPSF.c ++++ b/extensions/lift2D/IBPRRIOAPSF.c +@@ -30,8 +30,8 @@ void IBPRRIOAPSF(Word M, Word I, Word B, BDigit p,BDigit k, Word *J_, Word *L_) { @@ -256,8 +261,8 @@ Step1: /* Convert the minimal polynomial to a software interval polynomial. */ ---- a/extensions/lift2D/LIFTSRD2D.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/extensions/lift2D/LIFTSRD2D.c 2018-08-29 20:10:06.399075811 -0600 +--- a/extensions/lift2D/LIFTSRD2D.c ++++ b/extensions/lift2D/LIFTSRD2D.c @@ -14,7 +14,7 @@ Word LIFTSRD2D(Word c, Word D, Word P, Word L) @@ -267,7 +272,7 @@ Word M,I,P2,Rp,t,R,Rs,Rt,SP,r,k,c1,c2,prev,Sp,sor,next,s2,nextc,X; Word DL,Rps,pf,a,b,e,temp,count,J; Word R_L; -@@ -113,7 +113,6 @@ if (PCVERBOSE) { SWRITE("Tried up to pre +@@ -113,7 +113,6 @@ /* Go through the neighboring stacks! */ /**************************************/ i = 0; @@ -275,7 +280,7 @@ /* LIMITATION OF CURRENT IMPLEMENTATION make sure the larger stack is to the right */ -@@ -127,7 +126,6 @@ if (PCVERBOSE) { SWRITE("Tried up to pre +@@ -127,7 +126,6 @@ for(S = NIL; S_R != NIL; ) { /******* BIG LOOP!!!! **********/ @@ -283,7 +288,7 @@ c_R = FIRST(S_R); if (LELTI(c_R,MULSUB) != NIL && FIRST(FIRST(LELTI(c_R,MULSUB))) == J) -@@ -153,7 +151,6 @@ if (PCVERBOSE) { SWRITE("Tried up to pre +@@ -153,7 +151,6 @@ NOTDET, LELTI(c_R,DEGSUB),LELTI(c_R,MULSUB)); S = COMP(cp,S); @@ -291,9 +296,9 @@ if (RED(S_L) == NIL && RED(S_R) != NIL) S_R = RED(S_R); else { ---- a/extensions/lift2D/LIFTSRR2D.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/extensions/lift2D/LIFTSRR2D.c 2018-08-29 20:10:06.400075810 -0600 -@@ -38,7 +38,7 @@ void debWRITEINTERVAL(Word I) { +--- a/extensions/lift2D/LIFTSRR2D.c ++++ b/extensions/lift2D/LIFTSRR2D.c +@@ -38,7 +38,7 @@ Word LIFTSRR2D(Word c, Word D, Word P) { @@ -302,7 +307,7 @@ Word M,I,P2,Rp,t,R,Rs,Rt,SP,r,k,c1,c2,prev,Sp,sor,next,s2,nextc,X; Word OC, OT,count; -@@ -108,7 +108,6 @@ Word LIFTSRR2D(Word c, Word D, Word P) +@@ -108,7 +108,6 @@ /* Go through the neighboring stacks! */ /**************************************/ i = 0; @@ -310,7 +315,7 @@ for(S = NIL; S_L != NIL; S_L = RED(S_L), S_R = RED(S_R)) { c_L = FIRST(S_L); -@@ -133,8 +132,7 @@ Word LIFTSRR2D(Word c, Word D, Word P) +@@ -133,8 +132,7 @@ CCONC(LELTI(c,INDX),LIST1(i)),COMP(FIRST(LELTI(c_L,SIGNPF)),LELTI(c,SIGNPF)), NOTDET, LELTI(c_L,DEGSUB),LELTI(c_L,MULSUB)); @@ -320,9 +325,9 @@ else { /************************************************************ ---- a/extensions/lift2D/modHIPRRID.c.orig 2018-08-29 20:05:52.864359502 -0600 -+++ b/extensions/lift2D/modHIPRRID.c 2018-08-29 20:10:06.400075810 -0600 -@@ -22,7 +22,7 @@ void modHIPRRID(BDigit n, interval *A, W +--- a/extensions/lift2D/modHIPRRID.c ++++ b/extensions/lift2D/modHIPRRID.c +@@ -22,7 +22,7 @@ { BDigit k,s,t; interval *B,*C; @@ -331,9 +336,9 @@ Step1: /* Compute a bound for the positive roots. */ k = HIPPRB(n,A); ---- a/extensions/lift2D/modHIPRRISD.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/extensions/lift2D/modHIPRRISD.c 2018-08-29 20:10:06.399075811 -0600 -@@ -23,7 +23,7 @@ Outputs +--- a/extensions/lift2D/modHIPRRISD.c ++++ b/extensions/lift2D/modHIPRRISD.c +@@ -23,7 +23,7 @@ Word modHIPRRISD(BDigit n, interval *A, Word a, Word b) { @@ -342,9 +347,9 @@ Word c,L,L1,L2; interval *B,*C,J; ---- a/extensions/lift2D/modIBPRRIOAPSF.c.orig 2018-08-29 20:05:52.863359503 -0600 -+++ b/extensions/lift2D/modIBPRRIOAPSF.c 2018-08-29 20:10:06.399075811 -0600 -@@ -31,8 +31,8 @@ Outputs +--- a/extensions/lift2D/modIBPRRIOAPSF.c ++++ b/extensions/lift2D/modIBPRRIOAPSF.c +@@ -31,8 +31,8 @@ void modIBPRRIOAPSF(Word M, Word I, Word B, Word p, Word k, BDigit *J_, BDigit *L_) { @@ -355,9 +360,9 @@ Step1: /* Convert the minimal polynomial to a software interval polynomial. */ ---- a/extensions/newadj/HAP2.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/extensions/newadj/HAP2.c 2018-08-29 20:10:06.406075801 -0600 -@@ -18,7 +18,7 @@ Outputs +--- a/extensions/newadj/HAP2.c ++++ b/extensions/newadj/HAP2.c +@@ -18,7 +18,7 @@ Word HAP2(Word U, Word V, Word w_l, Word B) { @@ -366,9 +371,9 @@ Sol = NIL; S = NIL; ---- a/extensions/newadj/HATEST.c.orig 2018-08-29 20:03:25.111519356 -0600 -+++ b/extensions/newadj/HATEST.c 2018-08-29 20:10:06.406075801 -0600 -@@ -111,13 +111,11 @@ Sample point coordinate write. +--- a/extensions/newadj/HATEST.c ++++ b/extensions/newadj/HATEST.c +@@ -111,13 +111,11 @@ void SAMPLECWR(Word c) { @@ -383,7 +388,7 @@ Step2: /* Extended representation. */ if (ISPRIMIT(s)) goto Step3; -@@ -160,7 +158,7 @@ Algebraic number field elements list wri +@@ -160,7 +158,7 @@ void strippedAFLWR(Word M,Word I,Word N,Word a,Word A) { @@ -392,7 +397,7 @@ /* hide i; */ Step1: /* Write. */ -@@ -196,7 +194,7 @@ Side effects +@@ -196,7 +194,7 @@ void ANDWRITExx(Word M, Word I, Word n) { @@ -401,8 +406,8 @@ Word a,a1,a2,b,b1,b2,d,d1,d2,e,f,m; Word N; ---- a/extensions/rend/CH_VIEW_WIN.cc.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/extensions/rend/CH_VIEW_WIN.cc 2018-08-29 20:10:06.397075815 -0600 +--- a/extensions/rend/CH_VIEW_WIN.cc ++++ b/extensions/rend/CH_VIEW_WIN.cc @@ -4,7 +4,7 @@ Word CH_VIEW_WIN(Rend_Cell &M, Rend_Win &W, Word Xs, Word Xt, Word Ys,Word Yt, Word e, Word P) @@ -412,9 +417,9 @@ mx = LBRNP2PROD( LBRNSUM(W.x.W,W.X.W) , -1 ); my = LBRNP2PROD( LBRNSUM(W.y.W,W.Y.W) , -1 ); ---- a/extensions/rend/PLOT_2D_CAD.cc.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/extensions/rend/PLOT_2D_CAD.cc 2018-08-29 20:10:06.397075815 -0600 -@@ -42,9 +42,8 @@ void PLOT_2D_CAD(Word D, Word P, Word J, +--- a/extensions/rend/PLOT_2D_CAD.cc ++++ b/extensions/rend/PLOT_2D_CAD.cc +@@ -42,9 +42,8 @@ { char c; Word N; @@ -426,9 +431,9 @@ longtostring(getpid(),FIFO_NAME+11); int t = 1, first = 1; int wcount = 0; ---- a/extensions/rend/Rend_Cell.cc.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/extensions/rend/Rend_Cell.cc 2018-08-29 20:10:06.398075813 -0600 -@@ -183,7 +183,7 @@ Word Rend_Cell::description(Rend_Win &W) +--- a/extensions/rend/Rend_Cell.cc ++++ b/extensions/rend/Rend_Cell.cc +@@ -183,7 +183,7 @@ *************************************************************/ void Rend_Cell::out_descrip(Rend_Win &W,ostream &out,Mapper &M) { @@ -437,7 +442,7 @@ int px = 8; int py = 8; -@@ -310,7 +310,7 @@ void Rend_Cell::out_descrip(Rend_Win &W, +@@ -310,7 +310,7 @@ *************************************************************/ void Rend_Cell::out_descrip_ps(Rend_Win &W,ostream &out, Mapper &M) { @@ -446,7 +451,7 @@ p = 12; switch (level) { case 0 : -@@ -382,7 +382,7 @@ void Rend_Cell::out_descrip_ps(Rend_Win +@@ -382,7 +382,7 @@ *************************************************************/ void Rend_Cell::out_descrip_ps_color(Rend_Win &W,ostream &out, Mapper &M) { @@ -455,7 +460,7 @@ p = 12; switch (level) { case 0 : -@@ -475,7 +475,7 @@ void Rend_Cell::out_descrip_ps_color(Ren +@@ -475,7 +475,7 @@ *************************************************************/ void Rend_Cell::out_descrip_ps_raji(Rend_Win &W,ostream &out, Mapper &M) { @@ -464,7 +469,7 @@ p = 12; switch (level) { case 0 : -@@ -511,7 +511,7 @@ void Rend_Cell::out_descrip_ps_raji(Rend +@@ -511,7 +511,7 @@ *************************************************************/ void Rend_Cell::out_descrip_ps_standard(Rend_Win &W,ostream &out, Mapper &M) { @@ -473,9 +478,9 @@ p = 12; switch (level) { case 0 : ---- a/extensions/rend/Rend_Sample.cc.orig 2018-08-29 20:07:27.087257552 -0600 -+++ b/extensions/rend/Rend_Sample.cc 2018-08-29 20:10:06.396075816 -0600 -@@ -46,7 +46,7 @@ Rend_Sample_1DS::Rend_Sample_1DS(Word C, +--- a/extensions/rend/Rend_Sample.cc ++++ b/extensions/rend/Rend_Sample.cc +@@ -46,7 +46,7 @@ *************************************************************/ Word Rend_Sample_1DS::coordinate(int k) { @@ -484,7 +489,7 @@ P = A.W; J = I.W; -@@ -64,7 +64,7 @@ Step2: /* Save interval refinement and r +@@ -64,7 +64,7 @@ Word Rend_Sample_1DS::round(int k, int roundup) { @@ -493,7 +498,7 @@ P = A.W; J = I.W; -@@ -109,7 +109,7 @@ Rend_Sample_1DO::Rend_Sample_1DO(Rend_Ce +@@ -109,7 +109,7 @@ Word Rend_Sample_1DO::coordinate(int k) { @@ -502,7 +507,7 @@ do { j1 = l -> sample -> round(kp,1); j2 = r -> sample -> round(kp,0); -@@ -132,8 +132,8 @@ Word Rend_Sample_1DO::coordinate(int k) +@@ -132,8 +132,8 @@ *************************************************************/ Rend_Sample_2DS::Rend_Sample_2DS(Word C) { @@ -513,7 +518,7 @@ //-- Set A to the minpol of sample point, and I to isolating int --/ T = LELTI( C , SAMPLE ); -@@ -172,7 +172,7 @@ Rend_Sample_2DS::Rend_Sample_2DS(Word C) +@@ -172,7 +172,7 @@ *************************************************************/ Word Rend_Sample_2DS::coordinate(int k) { @@ -522,9 +527,9 @@ Step1: /* Initialize and decide if refinement is even necessary. */ ---- a/extensions/rend/WRITE_PS_INTERACTIVE.cc.orig 2018-08-29 20:05:52.863359503 -0600 -+++ b/extensions/rend/WRITE_PS_INTERACTIVE.cc 2018-08-29 20:10:06.399075811 -0600 -@@ -190,8 +190,8 @@ void WRITE_PS_INTERACTIVE(Rend_Cell &M, +--- a/extensions/rend/WRITE_PS_INTERACTIVE.cc ++++ b/extensions/rend/WRITE_PS_INTERACTIVE.cc +@@ -190,8 +190,8 @@ **********************************************************/ case 'a': { @@ -535,9 +540,9 @@ SWRITE("Provide an origin: "); qein() >> Ox >> Oy; OX = IEEELBRN(Ox); ---- a/extensions/sfext/addpol/BPOLSETS.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/extensions/sfext/addpol/BPOLSETS.c 2018-08-29 20:10:06.405075803 -0600 -@@ -24,7 +24,7 @@ Outputs +--- a/extensions/sfext/addpol/BPOLSETS.c ++++ b/extensions/sfext/addpol/BPOLSETS.c +@@ -24,7 +24,7 @@ void BPOLSETS(Word L_, Word D, Word P, Word *T_, Word *N_) { @@ -546,9 +551,9 @@ S_T,S_L,s_c,c,i,Tb,Tp; Step1: /* Initialization. */ ---- a/extensions/sfext/addpol/CFLCELLLIST.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/extensions/sfext/addpol/CFLCELLLIST.c 2018-08-29 20:10:06.405075803 -0600 -@@ -21,8 +21,7 @@ static Word comp(Word A, Word B); +--- a/extensions/sfext/addpol/CFLCELLLIST.c ++++ b/extensions/sfext/addpol/CFLCELLLIST.c +@@ -21,8 +21,7 @@ Word CFLCELLLIST(Word L_D) { @@ -558,9 +563,9 @@ Step1: /* Initialize. */ C = NIL; ---- a/extensions/sfext/addpol/CLEAN_BIGLOOP.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/extensions/sfext/addpol/CLEAN_BIGLOOP.c 2018-08-29 20:10:06.405075803 -0600 -@@ -15,8 +15,8 @@ Inputs +--- a/extensions/sfext/addpol/CLEAN_BIGLOOP.c ++++ b/extensions/sfext/addpol/CLEAN_BIGLOOP.c +@@ -15,8 +15,8 @@ void QepcadCls::CLEAN_BIGLOOP(Word Jb, Word Pb, Word P0, Word D0, Word N, Word *P_, Word *D_) { @@ -571,9 +576,9 @@ Word inum,tm,temp; Step1: /* Initialize. */ ---- a/extensions/sfext/addpol/KCONST.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/extensions/sfext/addpol/KCONST.c 2018-08-29 20:10:06.405075803 -0600 -@@ -53,8 +53,7 @@ static Word S1_EMPTY(Word S1) +--- a/extensions/sfext/addpol/KCONST.c ++++ b/extensions/sfext/addpol/KCONST.c +@@ -53,8 +53,7 @@ static Word S2_IN(Word o, Word S2) { @@ -583,7 +588,7 @@ if ( EQUAL(FIRST(FIRST(S2)),o) ) return (1); } return (0); -@@ -79,30 +78,6 @@ static Word S2_EMPTY(Word S2) +@@ -79,30 +78,6 @@ return ( (S2 == NIL) ); } @@ -614,7 +619,7 @@ /*--------- List of derivative factor indices. --------*/ static Word LIST_OF_DI(Word o, Word J, Word P) -@@ -132,7 +107,7 @@ return (L); +@@ -132,7 +107,7 @@ void KCONST(Word J, Word P, Word G, Word *K_, Word *KT_) { @@ -623,9 +628,9 @@ /* Initialization. */ S1 = NIL; S2 = NIL; ---- a/extensions/sfext/addpol/MINPFSETNSC.c.orig 2018-08-29 20:05:52.865359501 -0600 -+++ b/extensions/sfext/addpol/MINPFSETNSC.c 2018-08-29 20:10:06.405075803 -0600 -@@ -38,8 +38,8 @@ static Word comp1(Word a,Word b) { +--- a/extensions/sfext/addpol/MINPFSETNSC.c ++++ b/extensions/sfext/addpol/MINPFSETNSC.c +@@ -38,8 +38,8 @@ Word MINPFSETNSC(Word P,Word S,Word D,Word K) { @@ -636,9 +641,9 @@ Step1: /* Initialization. */ C = NIL; Sltr = NIL; S_r = NIL; Pltr = NIL; N = LENGTH(K); ---- a/extensions/sfext/addpol/STRIPPED_BIGLOOP.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/extensions/sfext/addpol/STRIPPED_BIGLOOP.c 2018-08-29 20:10:06.405075803 -0600 -@@ -15,8 +15,8 @@ Inputs +--- a/extensions/sfext/addpol/STRIPPED_BIGLOOP.c ++++ b/extensions/sfext/addpol/STRIPPED_BIGLOOP.c +@@ -15,8 +15,8 @@ void QepcadCls::STRIPPED_BIGLOOP(Word Jb, Word Pb, Word P0, Word D0, Word N, Word *P_, Word *D_) { @@ -649,9 +654,9 @@ Word inum,tm,tt; Step1: /* Initialize. */ ---- a/extensions/sfext/crcads/CSORCELL.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/extensions/sfext/crcads/CSORCELL.c 2018-08-29 20:10:06.405075803 -0600 -@@ -19,7 +19,7 @@ Side Effects +--- a/extensions/sfext/crcads/CSORCELL.c ++++ b/extensions/sfext/crcads/CSORCELL.c +@@ -19,7 +19,7 @@ void QepcadCls::CSORCELLTR(Word c, Word Pp, Word PpO, Word PpN) { @@ -660,9 +665,9 @@ k = LELTI(c,LEVEL); ---- a/extensions/sfext/crcads/CSORCELL_MOD.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/extensions/sfext/crcads/CSORCELL_MOD.c 2018-08-29 20:10:06.406075801 -0600 -@@ -25,8 +25,8 @@ static Word LLPFZC(Word c,Word P); +--- a/extensions/sfext/crcads/CSORCELL_MOD.c ++++ b/extensions/sfext/crcads/CSORCELL_MOD.c +@@ -25,8 +25,8 @@ void QepcadCls::CSORCELLTR_MOD(Word c, Word Pp, Word PpO, Word PpN, Word P) { @@ -673,9 +678,9 @@ Step0: k = LELTI(c,LEVEL); ---- a/extensions/sfext/crcads/LISTOFCWTV.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/extensions/sfext/crcads/LISTOFCWTV.c 2018-08-29 20:10:06.406075801 -0600 -@@ -14,7 +14,7 @@ Outputs +--- a/extensions/sfext/crcads/LISTOFCWTV.c ++++ b/extensions/sfext/crcads/LISTOFCWTV.c +@@ -14,7 +14,7 @@ void LISTOFCWTV(Word C, Word *Lt_, Word *Lf_) { @@ -684,9 +689,9 @@ Step1: /* If C is undetermined recurse on the children. */ t = LELTI(C,TRUTH); ---- a/extensions/sfext/espcad/ESPCADLSNC.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/extensions/sfext/espcad/ESPCADLSNC.c 2018-08-29 20:10:06.406075801 -0600 -@@ -97,7 +97,7 @@ Output +--- a/extensions/sfext/espcad/ESPCADLSNC.c ++++ b/extensions/sfext/espcad/ESPCADLSNC.c +@@ -97,7 +97,7 @@ Word ESPCADCTLSNC(Word c1,Word c2,Word c3,Word i,Word P) { @@ -695,7 +700,7 @@ Step1: /* Initialize. */ if (LELTI(c1,SC_TMPM) == LELTI(c2,SC_TMPM) && -@@ -106,7 +106,6 @@ Step1: /* Initialize. */ +@@ -106,7 +106,6 @@ goto Return; } S1 = LELTI(c1,SC_SIGN); S2 = LELTI(c2,SC_SIGN); @@ -703,9 +708,9 @@ Step2: /* Figure out which polynomials are zero in c2. */ for(n = 0, Sp1 = S1, Sp2 = S2, T = NIL; n < LENGTH(S1); n++) { ---- a/extensions/sfext/formula/FMAATOMREAD.c.orig 2018-08-29 20:05:52.865359501 -0600 -+++ b/extensions/sfext/formula/FMAATOMREAD.c 2018-08-29 20:10:06.403075806 -0600 -@@ -13,9 +13,9 @@ Word POLYINDEX(Word P, Word p, Word r, W +--- a/extensions/sfext/formula/FMAATOMREAD.c ++++ b/extensions/sfext/formula/FMAATOMREAD.c +@@ -13,9 +13,9 @@ void FMAATOMREAD(Word Q, Word V, Word *F_, Word *t_) { @@ -717,9 +722,9 @@ Step1: /* Read the left polynomial. */ t = 1; r = LENGTH(V); F = NIL; ---- a/extensions/sfext/formula/FMACELLEVAL.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/extensions/sfext/formula/FMACELLEVAL.c 2018-08-29 20:10:06.404075804 -0600 -@@ -15,7 +15,7 @@ Outputs +--- a/extensions/sfext/formula/FMACELLEVAL.c ++++ b/extensions/sfext/formula/FMACELLEVAL.c +@@ -15,7 +15,7 @@ Word FMACELLEVAL(Word F, Word C, Word P) { @@ -728,9 +733,9 @@ switch(FIRST(F)) { ---- a/extensions/sfext/formula/FMAPOLLIST.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/extensions/sfext/formula/FMAPOLLIST.c 2018-08-29 20:10:06.404075804 -0600 -@@ -19,7 +19,7 @@ static Word subprog(Word F); +--- a/extensions/sfext/formula/FMAPOLLIST.c ++++ b/extensions/sfext/formula/FMAPOLLIST.c +@@ -19,7 +19,7 @@ Word FMAPOLLIST(Word F, Word P) { @@ -739,9 +744,9 @@ Q = NIL; L = subprog(F); ---- a/extensions/sfext/formula/FMATRYDISTRIBUTE.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/extensions/sfext/formula/FMATRYDISTRIBUTE.c 2018-08-29 20:10:06.404075804 -0600 -@@ -45,7 +45,7 @@ Fp: the conjunction of C and F. The fun +--- a/extensions/sfext/formula/FMATRYDISTRIBUTE.c ++++ b/extensions/sfext/formula/FMATRYDISTRIBUTE.c +@@ -45,7 +45,7 @@ Word FMADISTRIBUTE(Word F, Word C) { @@ -750,7 +755,7 @@ f = FIRST(F); switch(f) -@@ -59,7 +59,6 @@ Word FMADISTRIBUTE(Word F, Word C) +@@ -59,7 +59,6 @@ L = NIL; for(Fp = CINV(RED(F)); Fp != NIL; Fp = RED(Fp)) { @@ -758,9 +763,9 @@ gp = FMADISTRIBUTE(FIRST(Fp),C); L = COMP(gp,L); } ---- a/extensions/sfext/formula/FMAWRITE.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/extensions/sfext/formula/FMAWRITE.c 2018-08-29 20:10:06.404075804 -0600 -@@ -8,7 +8,7 @@ ForMulA write. +--- a/extensions/sfext/formula/FMAWRITE.c ++++ b/extensions/sfext/formula/FMAWRITE.c +@@ -8,7 +8,7 @@ void FMAWRITE(Word F, Word P, Word V) { @@ -769,9 +774,9 @@ switch(FTYPEINFO(F)) { ---- a/extensions/sfext/formula/FMAWRITELATEX.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/extensions/sfext/formula/FMAWRITELATEX.c 2018-08-29 20:10:06.404075804 -0600 -@@ -8,7 +8,7 @@ ForMulA write. +--- a/extensions/sfext/formula/FMAWRITELATEX.c ++++ b/extensions/sfext/formula/FMAWRITELATEX.c +@@ -8,7 +8,7 @@ void FMAWRITELATEX(Word F, Word P, Word V) { @@ -780,7 +785,7 @@ switch(FTYPEINFO(F)) { -@@ -62,7 +62,7 @@ void FMAWRITELATEX(Word F, Word P, Word +@@ -62,7 +62,7 @@ void FMAWRITELATEXp(Word F, Word P, Word V, Word flag) { @@ -789,9 +794,9 @@ switch(FTYPEINFO(F)) { ---- a/extensions/sfext/formula/FMAWRITENEWLINE.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/extensions/sfext/formula/FMAWRITENEWLINE.c 2018-08-29 20:10:06.404075804 -0600 -@@ -10,7 +10,7 @@ ForMulA write. +--- a/extensions/sfext/formula/FMAWRITENEWLINE.c ++++ b/extensions/sfext/formula/FMAWRITENEWLINE.c +@@ -10,7 +10,7 @@ void FMAWRITENEWLINE(Word F, Word P, Word V, Word n) { @@ -800,7 +805,7 @@ switch(FTYPEINFO(F)) { -@@ -65,7 +65,7 @@ void FMAWRITENEWLINE(Word F, Word P, Wor +@@ -65,7 +65,7 @@ void FMAWRITENEWLINEp(Word F, Word P, Word V, Word flag) { @@ -809,9 +814,9 @@ switch(FTYPEINFO(F)) { ---- a/extensions/sfext/formula/FMAWRITEp.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/extensions/sfext/formula/FMAWRITEp.c 2018-08-29 20:10:06.404075804 -0600 -@@ -9,7 +9,7 @@ ForMulA write. +--- a/extensions/sfext/formula/FMAWRITEp.c ++++ b/extensions/sfext/formula/FMAWRITEp.c +@@ -9,7 +9,7 @@ void FMAWRITEp(Word F, Word P, Word V, Word flag) { @@ -820,9 +825,9 @@ switch(FTYPEINFO(F)) { ---- a/extensions/sfext/formula/FMAWRITEQEIN.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/extensions/sfext/formula/FMAWRITEQEIN.c 2018-08-29 20:10:06.404075804 -0600 -@@ -7,7 +7,7 @@ ForMulA write. +--- a/extensions/sfext/formula/FMAWRITEQEIN.c ++++ b/extensions/sfext/formula/FMAWRITEQEIN.c +@@ -7,7 +7,7 @@ void FMAWRITEQEIN(Word F, Word P, Word V) { @@ -831,9 +836,9 @@ Step1: /* Get list of polynomials. */ Q = FMAPOLLIST(F,P); ---- a/extensions/sfext/minhit/MINHITSETSRDR.c.orig 2018-08-29 20:03:25.109519358 -0600 -+++ b/extensions/sfext/minhit/MINHITSETSRDR.c 2018-08-29 20:10:06.402075807 -0600 -@@ -27,7 +27,7 @@ Note: The point is that not only sortin +--- a/extensions/sfext/minhit/MINHITSETSRDR.c ++++ b/extensions/sfext/minhit/MINHITSETSRDR.c +@@ -27,7 +27,7 @@ static Word comp(Word a, Word b) __pure; static Word comp(Word a, Word b) { @@ -842,9 +847,9 @@ ap = a; bp = b; t = BDCOMP(LENGTH(ap),LENGTH(bp)); while ((t == 0) && (bp != NIL) && (ap != NIL)) { ---- a/extensions/sfext/pcadst/CADFPCAD.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/extensions/sfext/pcadst/CADFPCAD.c 2018-08-29 20:10:06.402075807 -0600 -@@ -21,7 +21,7 @@ Outputs +--- a/extensions/sfext/pcadst/CADFPCAD.c ++++ b/extensions/sfext/pcadst/CADFPCAD.c +@@ -21,7 +21,7 @@ Word CADFPCAD(Word D, Word P, Word S, Word I, Word Pb) { @@ -853,9 +858,9 @@ Word Mb,mb; Step1: /* Is D the root cell? */ ---- a/extensions/sfext/pcadst/CADFPCADWI.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/extensions/sfext/pcadst/CADFPCADWI.c 2018-08-29 20:10:06.401075809 -0600 -@@ -22,7 +22,7 @@ Outputs +--- a/extensions/sfext/pcadst/CADFPCADWI.c ++++ b/extensions/sfext/pcadst/CADFPCADWI.c +@@ -22,7 +22,7 @@ Word CADFPCADWI(Word D, Word P, Word S, Word I, Word Pb) { @@ -864,9 +869,9 @@ Word Mb,mb; Step1: /* Is D the root cell? */ ---- a/extensions/sfext/pcadst/CCADCONEXT.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/extensions/sfext/pcadst/CCADCONEXT.c 2018-08-29 20:10:06.402075807 -0600 -@@ -21,7 +21,7 @@ Outputs +--- a/extensions/sfext/pcadst/CCADCONEXT.c ++++ b/extensions/sfext/pcadst/CCADCONEXT.c +@@ -21,7 +21,7 @@ void CCADCONEXT(Word n, Word P, Word C, Word *Ps_, Word *Cs_, Word *N_) { @@ -875,9 +880,9 @@ Word t; ---- a/extensions/sfext/pcadst/CCADCONmod.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/extensions/sfext/pcadst/CCADCONmod.c 2018-08-29 20:10:06.402075807 -0600 -@@ -22,7 +22,7 @@ Outputs +--- a/extensions/sfext/pcadst/CCADCONmod.c ++++ b/extensions/sfext/pcadst/CCADCONmod.c +@@ -22,7 +22,7 @@ void CCADCONmod(Word n, Word P, Word C, Word *Ps_, Word *Cs_) { @@ -886,9 +891,9 @@ Step1: /* Set Ps to the empty projection list, and Cs to the full original CAD C. */ ---- a/extensions/sfext/pcadst/LTFOCALWTV.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/extensions/sfext/pcadst/LTFOCALWTV.c 2018-08-29 20:10:06.402075807 -0600 -@@ -16,7 +16,7 @@ Outputs +--- a/extensions/sfext/pcadst/LTFOCALWTV.c ++++ b/extensions/sfext/pcadst/LTFOCALWTV.c +@@ -16,7 +16,7 @@ void LTFOCALWTV(Word C, Word n, Word *Lt_, Word *Lf_) { @@ -897,9 +902,9 @@ Step1: /* If C is undetermined recurse on the children. */ t = LELTI(C,SC_CDTV); ---- a/extensions/sfext/pcadst/LTFOCWTV.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/extensions/sfext/pcadst/LTFOCWTV.c 2018-08-29 20:10:06.402075807 -0600 -@@ -15,7 +15,7 @@ Outputs +--- a/extensions/sfext/pcadst/LTFOCWTV.c ++++ b/extensions/sfext/pcadst/LTFOCWTV.c +@@ -15,7 +15,7 @@ void LTFOCWTV(Word C, Word *Lt_, Word *Lf_) { @@ -908,9 +913,9 @@ Step1: /* If C is undetermined recurse on the children. */ t = LELTI(C,SC_CDTV); ---- a/extensions/sfext/pcadst/PCADSCANL.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/extensions/sfext/pcadst/PCADSCANL.c 2018-08-29 20:10:06.402075807 -0600 -@@ -18,7 +18,7 @@ Outputs +--- a/extensions/sfext/pcadst/PCADSCANL.c ++++ b/extensions/sfext/pcadst/PCADSCANL.c +@@ -18,7 +18,7 @@ Word PCADSCANL(Word Cs, Word i) { @@ -919,8 +924,8 @@ Step1: /* Get list of children. */ CC = LELTI(Cs,SC_CDTV); ---- a/extensions/sfext/pcadst/PCADWRITE.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/extensions/sfext/pcadst/PCADWRITE.c 2018-08-29 20:10:06.402075807 -0600 +--- a/extensions/sfext/pcadst/PCADWRITE.c ++++ b/extensions/sfext/pcadst/PCADWRITE.c @@ -7,7 +7,7 @@ void PCADWRITE(Word Cs, Word Ps) @@ -930,9 +935,9 @@ Step1: /* */ I = PCADCINDEX(Cs); ---- a/extensions/sfext/pcadst/SCADDSCON.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/extensions/sfext/pcadst/SCADDSCON.c 2018-08-29 20:10:06.401075809 -0600 -@@ -30,7 +30,7 @@ example, would be bad. +--- a/extensions/sfext/pcadst/SCADDSCON.c ++++ b/extensions/sfext/pcadst/SCADDSCON.c +@@ -30,7 +30,7 @@ Word SCADDSCON(Word C, Word A, Word n) { @@ -941,9 +946,9 @@ Step1: /* Construct a preliminary version of Cs, with all but the child list filled in. */ ---- a/extensions/sfext/pcadst/SIMPLE_CAD_INFO.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/extensions/sfext/pcadst/SIMPLE_CAD_INFO.c 2018-08-29 20:10:06.401075809 -0600 -@@ -6,7 +6,7 @@ n : the level +--- a/extensions/sfext/pcadst/SIMPLE_CAD_INFO.c ++++ b/extensions/sfext/pcadst/SIMPLE_CAD_INFO.c +@@ -6,7 +6,7 @@ void SIMPLE_CAD_INFO(Word D, Word P, Word n, Word flag) { @@ -952,9 +957,9 @@ Step1: /* Check for the trivial cases. */ switch( DOPFSUFF(P,LIST1(D)) ) { ---- a/extensions/sfext/projpf/PPFLPROJ.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/extensions/sfext/projpf/PPFLPROJ.c 2018-08-29 20:10:06.403075806 -0600 -@@ -17,11 +17,10 @@ Side Effects +--- a/extensions/sfext/projpf/PPFLPROJ.c ++++ b/extensions/sfext/projpf/PPFLPROJ.c +@@ -17,11 +17,10 @@ void PPFLPROJ(Word L, Word i, Word P) { @@ -967,9 +972,9 @@ while(A != NIL) { ADV(A,&p,&A); ---- a/extensions/sfext/sfcons/CYLIMPFORM.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/extensions/sfext/sfcons/CYLIMPFORM.c 2018-08-29 20:10:06.403075806 -0600 -@@ -9,7 +9,7 @@ A : a list of atoms from which to constr +--- a/extensions/sfext/sfcons/CYLIMPFORM.c ++++ b/extensions/sfext/sfcons/CYLIMPFORM.c +@@ -9,7 +9,7 @@ Word CYLIMPFORM(Word C, Word P, Word k, Word A) { @@ -978,9 +983,9 @@ Step1: /* Set L to a list of all (k-1)-level cells over which there are k-level cells with SC_TMPM of TRUE. */ ---- a/extensions/sfext/sfcons/GEOTEST.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/extensions/sfext/sfcons/GEOTEST.c 2018-08-29 20:10:06.403075806 -0600 -@@ -101,7 +101,7 @@ Word GEOMERGE(Word c,Word G,Word P) +--- a/extensions/sfext/sfcons/GEOTEST.c ++++ b/extensions/sfext/sfcons/GEOTEST.c +@@ -101,7 +101,7 @@ Word GEOFIT(Word c,Word G,Word P) { @@ -989,7 +994,7 @@ FIRST5(G,&Q,&C_Q,&Ap,&R,&T); FIRST5(c,&Qp,&C_Qp,&App,&Rp,&Tp); Tp = SINTER(Tp,T); -@@ -128,8 +128,8 @@ Word GEOFIT(Word c,Word G,Word P) +@@ -128,8 +128,8 @@ Word GEOTEST(Word C,Word P,Word k,Word A) { @@ -1000,9 +1005,9 @@ Step1: /* Set L to a list of all (k-1)-level cells over which there are k-level cells with SC_TMPM of TRUE. */ ---- a/extensions/sfext/sfcons/SFC2.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/extensions/sfext/sfcons/SFC2.c 2018-08-29 20:10:06.402075807 -0600 -@@ -5,7 +5,7 @@ Solution formula construction version 2 +--- a/extensions/sfext/sfcons/SFC2.c ++++ b/extensions/sfext/sfcons/SFC2.c +@@ -5,7 +5,7 @@ void QepcadCls::SFC2(Word D, Word P, Word J, Word n, Word sfm) { @@ -1011,9 +1016,9 @@ Step1: /* Space is either empty or R^n. */ t = DOPFSUFF(P,LIST1(D)); ---- a/extensions/sfext/sfcons/SFC4.c.orig 2018-08-29 20:05:52.865359501 -0600 -+++ b/extensions/sfext/sfcons/SFC4.c 2018-08-29 20:10:06.403075806 -0600 -@@ -29,7 +29,7 @@ static Word F1; /* Flag indicating that +--- a/extensions/sfext/sfcons/SFC4.c ++++ b/extensions/sfext/sfcons/SFC4.c +@@ -29,7 +29,7 @@ void QepcadCls::SFC4(Word D, Word P, Word J, Word n, Word L) { @@ -1022,9 +1027,9 @@ char e,s,m,c; e = s = m = c = '\0'; T1 = T2 = T3 = T4 = 0; ---- a/extensions/sfext/sfcons/SFCFULLD.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/extensions/sfext/sfcons/SFCFULLD.c 2018-08-29 20:10:06.403075806 -0600 -@@ -19,8 +19,7 @@ static Word PLISTOETAmod(Word p,Word B,W +--- a/extensions/sfext/sfcons/SFCFULLD.c ++++ b/extensions/sfext/sfcons/SFCFULLD.c +@@ -19,8 +19,7 @@ void QepcadCls::SFCFULLD(Word D, Word P, Word J, Word n) { @@ -1034,9 +1039,9 @@ Step1: /* Space is either empty or R^n. */ t = DOPFSUFF_FULLD(P,LIST1(D)); ---- a/extensions/sfext/sfcons/SFCFULLDf.c.orig 2018-08-29 20:05:52.865359501 -0600 -+++ b/extensions/sfext/sfcons/SFCFULLDf.c 2018-08-29 20:10:06.403075806 -0600 -@@ -19,8 +19,7 @@ static Word PLISTOETAmod(Word p,Word B,W +--- a/extensions/sfext/sfcons/SFCFULLDf.c ++++ b/extensions/sfext/sfcons/SFCFULLDf.c +@@ -19,8 +19,7 @@ Word QepcadCls::SFCFULLDf(Word D, Word P, Word J, Word n) { @@ -1046,9 +1051,9 @@ Step1: /* Space is either empty or R^n. */ t = DOPFSUFF_FULLD(P,LIST1(D)); ---- a/extensions/sfext/sfcons/SOLEXTINT.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/extensions/sfext/sfcons/SOLEXTINT.c 2018-08-29 20:10:06.403075806 -0600 -@@ -10,7 +10,7 @@ method to call and, of course, calls it. +--- a/extensions/sfext/sfcons/SOLEXTINT.c ++++ b/extensions/sfext/sfcons/SOLEXTINT.c +@@ -10,7 +10,7 @@ void QepcadCls::SOLEXTINT() { @@ -1057,9 +1062,9 @@ Step1: /* Initialization */ T = ACLOCK(); ---- a/extensions/sfext/sort/GMSDS.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/extensions/sfext/sort/GMSDS.c 2018-08-29 20:10:06.404075804 -0600 -@@ -19,7 +19,7 @@ static Word G23VSDS(Word *v,Word m,Word +--- a/extensions/sfext/sort/GMSDS.c ++++ b/extensions/sfext/sort/GMSDS.c +@@ -19,7 +19,7 @@ Word GMSDS(Word *A, Word m, Word (*C)(Word,Word)) { @@ -1068,9 +1073,9 @@ Step1: /* Split. */ m1 = m >> 1; ---- a/plot2d/plot.cc.orig 2018-08-29 20:08:10.014211101 -0600 -+++ b/plot2d/plot.cc 2018-08-29 20:10:06.396075816 -0600 -@@ -112,7 +112,6 @@ void* readdata(void *x) +--- a/plot2d/plot.cc ++++ b/plot2d/plot.cc +@@ -112,7 +112,6 @@ { vector E; istream &in = *inp; @@ -1078,9 +1083,9 @@ char c; do { while( in >> c ) ---- a/source/db/SINGULAR.c.orig 2018-08-29 20:08:10.015211100 -0600 -+++ b/source/db/SINGULAR.c 2018-08-29 20:10:06.406075801 -0600 -@@ -162,8 +162,6 @@ Return: /* Prepare for return. */ +--- a/source/db/SINGULAR.c ++++ b/source/db/SINGULAR.c +@@ -162,8 +162,6 @@ void SingularServer::IPFAC(Word r, Word P, Word *s_, Word *c_, Word *L_) { @@ -1089,7 +1094,7 @@ Word V = CreateVariableList(r); string out = WritePolyForSingular(r,P,V); -@@ -212,9 +210,6 @@ void SingularServer::IPFAC(Word r, Word +@@ -212,9 +210,6 @@ Word ct = IABSF(lcf); sn *= ISIGNF(lcf); @@ -1099,9 +1104,9 @@ // RETURN *s_ = sn; *c_ = ct; ---- a/source/db/unnamedpipe.h.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/source/db/unnamedpipe.h 2018-08-29 20:10:06.406075801 -0600 -@@ -118,7 +118,7 @@ public: +--- a/source/db/unnamedpipe.h ++++ b/source/db/unnamedpipe.h +@@ -118,7 +118,7 @@ if (openmask[0]) { close(fd[0]); openmask[0] = false; } } void closeOut() { @@ -1110,9 +1115,9 @@ if (_out) { delete _out; _out = 0; } if (openmask[1]) { // write(fd[1],ts,2); ---- a/source/io/DNFLWR.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/source/io/DNFLWR.c 2018-08-29 20:10:06.407075800 -0600 -@@ -13,7 +13,7 @@ Disjuctive Normal Form Label Write. +--- a/source/io/DNFLWR.c ++++ b/source/io/DNFLWR.c +@@ -13,7 +13,7 @@ void DNFLWR(Word N, Word V, Word F) { @@ -1121,9 +1126,9 @@ Step1: /* Classify the formula F. */ T = FIRST(F); ---- a/source/io/DNFWR.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/source/io/DNFWR.c 2018-08-29 20:10:06.408075798 -0600 -@@ -12,7 +12,7 @@ Disjunctive Normal Form Write. +--- a/source/io/DNFWR.c ++++ b/source/io/DNFWR.c +@@ -12,7 +12,7 @@ void DNFWR(Word V, Word F) { @@ -1132,9 +1137,9 @@ Step1: /* Classify the formula F. */ T = FIRST(F); ---- a/source/io/IPLLDWR.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/source/io/IPLLDWR.c 2018-08-29 20:10:06.407075800 -0600 -@@ -12,7 +12,7 @@ Integral Polynomial, List of Lists, Dist +--- a/source/io/IPLLDWR.c ++++ b/source/io/IPLLDWR.c +@@ -12,7 +12,7 @@ void IPLLDWR(Word V, Word A) { @@ -1143,9 +1148,9 @@ /* hide i,j,n,r; */ Step1: /* Write. */ ---- a/source/io/IPLLDWRMOD.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/source/io/IPLLDWRMOD.c 2018-08-29 20:10:06.407075800 -0600 -@@ -12,7 +12,7 @@ Integral Polynomial, List of Lists, Dist +--- a/source/io/IPLLDWRMOD.c ++++ b/source/io/IPLLDWRMOD.c +@@ -12,7 +12,7 @@ void IPLLDWRMOD(Word V, Word A) { @@ -1154,9 +1159,9 @@ /* hide i,j,n,r; */ Step1: /* Write. */ ---- a/source/io/PCADSWR.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/source/io/PCADSWR.c 2018-08-29 20:10:06.407075800 -0600 -@@ -11,7 +11,7 @@ Partial CAD signature write. +--- a/source/io/PCADSWR.c ++++ b/source/io/PCADSWR.c +@@ -11,7 +11,7 @@ void PCADSWR(Word c) { @@ -1165,9 +1170,9 @@ /* hide p; */ Step1: /* common. */ ---- a/source/io/PCADWR.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/source/io/PCADWR.c 2018-08-29 20:10:06.407075800 -0600 -@@ -11,7 +11,7 @@ Partial CAD write. +--- a/source/io/PCADWR.c ++++ b/source/io/PCADWR.c +@@ -11,7 +11,7 @@ void PCADWR(Word c) { @@ -1176,9 +1181,9 @@ /* hide p; */ Step1: /* common. */ ---- a/source/io/PRODWR.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/source/io/PRODWR.c 2018-08-29 20:10:06.407075800 -0600 -@@ -10,7 +10,8 @@ Product Write. +--- a/source/io/PRODWR.c ++++ b/source/io/PRODWR.c +@@ -10,7 +10,8 @@ void PRODWR(Word v) { @@ -1188,9 +1193,9 @@ /* hide i,j,n1; */ SWRITE("In \"PRODWR\"! This is dead code!\n"); exit(1); ---- a/source/io/SAMPLEWR.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/source/io/SAMPLEWR.c 2018-08-29 20:10:06.408075798 -0600 -@@ -55,8 +55,7 @@ Return: /* Prepare for return. */ +--- a/source/io/SAMPLEWR.c ++++ b/source/io/SAMPLEWR.c +@@ -55,8 +55,7 @@ void QepcadCls::SAMPLEWR(Word c) { @@ -1200,9 +1205,9 @@ s = LELTI(c,SAMPLE); k = LELTI(c,LEVEL); ---- a/source/main/CADautoConst.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/source/main/CADautoConst.c 2018-08-29 20:10:06.409075797 -0600 -@@ -16,11 +16,7 @@ been set to something other than NIL, th +--- a/source/main/CADautoConst.c ++++ b/source/main/CADautoConst.c +@@ -16,11 +16,7 @@ void QepcadCls::CADautoConst() { @@ -1215,9 +1220,9 @@ Step1: /* Normalize. */ FIRST4(GVF,&r,&f,&Q,&Fh); ---- a/source/main/INITCTRL.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/source/main/INITCTRL.c 2018-08-29 20:10:06.409075797 -0600 -@@ -7,12 +7,9 @@ Initialize Program/Trace Control. +--- a/source/main/INITCTRL.c ++++ b/source/main/INITCTRL.c +@@ -7,12 +7,9 @@ void INITCTRL() { @@ -1232,9 +1237,9 @@ Step2: /* Initialize Algorithm Trace Control Variables. */ TCPROJ = NIL; ---- a/source/main/INITIO.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/source/main/INITIO.c 2018-08-29 20:10:06.409075797 -0600 -@@ -14,8 +14,6 @@ void OutputContextInit(ostream&); +--- a/source/main/INITIO.c ++++ b/source/main/INITIO.c +@@ -14,8 +14,6 @@ void INITIO() { @@ -1243,9 +1248,9 @@ Step1: /* Initialize Input. */ if (isatty(0)) InputContextInit(*(new readlineIstream())); ---- a/source/main/INITSTAT.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/source/main/INITSTAT.c 2018-08-29 20:10:06.409075797 -0600 -@@ -7,10 +7,6 @@ Initialize Statistics. +--- a/source/main/INITSTAT.c ++++ b/source/main/INITSTAT.c +@@ -7,10 +7,6 @@ void INITSTAT() { @@ -1256,9 +1261,20 @@ Step5: /* Statistics on Databases. */ TMDBMNG = 0; TMDBSAV = 0; ---- a/source/main/QEPCADauto.c.orig 2018-08-29 20:05:52.867359499 -0600 -+++ b/source/main/QEPCADauto.c 2018-08-29 20:10:06.409075797 -0600 -@@ -20,11 +20,8 @@ Quantifier Elimination by Partial Cylind +--- a/source/main/PRINTBANNER.c ++++ b/source/main/PRINTBANNER.c +@@ -12,7 +12,7 @@ + static const char* versdate = "Thu Feb 25 14:48:53 EST 2021"; + + void setversline() { +- int j; ++ /* int j; */ + SWRITE(" Version B "); + SWRITE(version); + SWRITE(", "); +--- a/source/main/QEPCADauto.c ++++ b/source/main/QEPCADauto.c +@@ -20,11 +20,8 @@ void QepcadCls::QEPCADauto(Word Fs, Word *t_, Word *F_e_, Word *F_n_, Word *F_s_) { @@ -1271,10 +1287,10 @@ + /* hide t; */ Step1: /* Normalize. */ - t = 0; ---- a/source/main/QEPCAD.c.orig 2018-08-29 20:05:52.867359499 -0600 -+++ b/source/main/QEPCAD.c 2018-08-29 20:10:06.409075797 -0600 -@@ -22,9 +22,6 @@ void QepcadCls::QEPCAD(Word Fs, Word *t_ + t = -1; +--- a/source/main/QEPCAD.c ++++ b/source/main/QEPCAD.c +@@ -22,9 +22,6 @@ { Word A,D,F,F_e,F_n,F_s,Fh,J,P,Q,Ths,f,i,r,t, T; /* hide Ths,i,t; */ @@ -1282,11 +1298,37 @@ - Word Cs,Ps,Qs,Pps,Cps,Qps,SF; /* Chris variables. */ - char c1,c2; /* Chris variables. */ Step1: /* Normalize. */ - t = 0; + t = -1; F_e = F_n = F_s = NIL; ---- a/source/proj/ECLEVEL.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/source/proj/ECLEVEL.c 2018-08-29 20:10:06.408075798 -0600 -@@ -14,10 +14,9 @@ Output +--- a/source/main/qepcadcls.c ++++ b/source/main/qepcadcls.c +@@ -87,7 +87,6 @@ + OrigAtom &A = conjuncts[k]; + Word r = A.r; + Word P = A.P; +- Word sigma = A.relop; + Word s, c, L; + IPFACDB(r,P,&s,&c,&L); // FACTOR + if (ISIGNF(c)<= 0) { FAIL("QepcadCls::UnsatCore::prepareForLift","Unexpected non-positive sign!"); } +@@ -154,6 +153,7 @@ + /*GEOP*/{NOOP,LEOP,EQOP,LEOP,GEOP,ALOP,GEOP,ALOP}, + /*ALOP*/{NOOP,ALOP,EQOP,ALOP,ALOP,ALOP,ALOP,ALOP} + }; ++#if 0 + static + short T_sum[8][8] = { + //______|NOOP_LTOP_EQOP_LEOP_GTOP_NEOP_GEOP_ALOP +@@ -166,6 +166,7 @@ + /*GEOP*/{NOOP,ALOP,GEOP,ALOP,GTOP,ALOP,GEOP,ALOP}, + /*ALOP*/{NOOP,ALOP,ALOP,ALOP,ALOP,ALOP,ALOP,ALOP} + }; ++#endif + + inline int signToSigma(int s) { return s < 0 ? LTOP : (s == 0 ? EQOP : GTOP); } + +--- a/source/proj/ECLEVEL.c ++++ b/source/proj/ECLEVEL.c +@@ -14,10 +14,9 @@ Word ECLEVEL(Word L) { @@ -1298,9 +1340,9 @@ k = 0; Step2: /* Loop. */ ---- a/source/proj/PROJCO.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/source/proj/PROJCO.c 2018-08-29 20:10:06.408075798 -0600 -@@ -15,7 +15,7 @@ Collins' projection. +--- a/source/proj/PROJCO.c ++++ b/source/proj/PROJCO.c +@@ -15,7 +15,7 @@ Word QepcadCls::PROJCO(Word r, Word A) { @@ -1309,9 +1351,9 @@ Rpp,Rs2,S1,Sp1,T,W,ap1,b,d,i,i1,i2,k,t; Step1: /* $r = 2$. */ ---- a/source/proj/PROJECTauto.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/source/proj/PROJECTauto.c 2018-08-29 20:10:06.408075798 -0600 -@@ -17,7 +17,7 @@ Projection Phase. +--- a/source/proj/PROJECTauto.c ++++ b/source/proj/PROJECTauto.c +@@ -17,7 +17,7 @@ void QepcadCls::PROJECTauto(Word r, Word A, Word *P_, Word *J_) { @@ -1320,9 +1362,9 @@ Step1: /* Initialize. */ P = LLCOPY(A); ---- a/source/proj/PROJECT.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/source/proj/PROJECT.c 2018-08-29 20:10:06.408075798 -0600 -@@ -19,7 +19,7 @@ Projection Phase. +--- a/source/proj/PROJECT.c ++++ b/source/proj/PROJECT.c +@@ -19,7 +19,7 @@ void QepcadCls::PROJECT(Word r, Word A, Word *P_, Word *J_) { @@ -1331,9 +1373,9 @@ Step1: /* Initialize. */ P = LLCOPY(A); ---- a/source/proj/PROJMCECmod.c.orig 2018-08-29 20:07:50.511232206 -0600 -+++ b/source/proj/PROJMCECmod.c 2018-08-29 20:10:06.408075798 -0600 -@@ -18,8 +18,8 @@ not propogate! +--- a/source/proj/PROJMCECmod.c ++++ b/source/proj/PROJMCECmod.c +@@ -18,8 +18,8 @@ Word QepcadCls::PROJMCECmod(Word r, Word A) { @@ -1344,9 +1386,9 @@ Step0: /* Obtain pivot constraint: If pivot is not all of level k, we can't use it! */ C = LELTI(GVPIVOT,r); ---- a/source/proj/PROJMCmod.c.orig 2018-08-29 20:07:50.511232206 -0600 -+++ b/source/proj/PROJMCmod.c 2018-08-29 20:10:06.409075797 -0600 -@@ -20,8 +20,8 @@ using namespace std; +--- a/source/proj/PROJMCmod.c ++++ b/source/proj/PROJMCmod.c +@@ -20,8 +20,8 @@ Word QepcadCls::PROJMCmod(Word r, Word A) { @@ -1357,9 +1399,9 @@ Step1: /* Obtain coefficients. */ P = NIL; ---- a/source/proj/PROJMCx.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/source/proj/PROJMCx.c 2018-08-29 20:10:06.408075798 -0600 -@@ -15,7 +15,7 @@ McCallum's projection excluding leading +--- a/source/proj/PROJMCx.c ++++ b/source/proj/PROJMCx.c +@@ -15,7 +15,7 @@ Word QepcadCls::PROJMCx(Word r, Word A) { @@ -1368,9 +1410,9 @@ Step1: /* Obtain coefficients. */ P = NIL; ---- a/source/saclib/GCSI.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/source/saclib/GCSI.c 2018-08-29 20:10:06.408075798 -0600 -@@ -23,10 +23,9 @@ extern void gcw_MARK(); +--- a/source/saclib/GCSI.c ++++ b/source/saclib/GCSI.c +@@ -23,10 +23,9 @@ void GCSI(Word s, char *EACSTACK) { @@ -1383,9 +1425,9 @@ Step1: /* Setup. */ if (GCM == 1) { ---- a/source/sysolve/EVALSYS.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/source/sysolve/EVALSYS.c 2018-08-29 20:10:06.407075800 -0600 -@@ -20,7 +20,7 @@ Outputs: +--- a/source/sysolve/EVALSYS.c ++++ b/source/sysolve/EVALSYS.c +@@ -20,7 +20,7 @@ Word EVALSYS(Word S, BDigit t, Word R) { @@ -1394,9 +1436,9 @@ Step1: /* Construct the skelaton of L, the answer. */ r = LENGTH(S); ---- a/source/sysolve/SYSSOLVE.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/source/sysolve/SYSSOLVE.c 2018-08-29 20:10:06.407075800 -0600 -@@ -21,7 +21,7 @@ Output +--- a/source/sysolve/SYSSOLVE.c ++++ b/source/sysolve/SYSSOLVE.c +@@ -21,7 +21,7 @@ Word SYSSOLVECAD(BDigit r, Word L, Word A, Word Vp, QepcadCls &Q) { @@ -1405,9 +1447,9 @@ /* Set variable list */ if (LENGTH(Vp) < r) { ---- a/source/sysolve/VERIFYCONSTSIGN.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/source/sysolve/VERIFYCONSTSIGN.c 2018-08-29 20:10:06.406075801 -0600 -@@ -78,7 +78,7 @@ BDigit VERIFYPOSITIVITY(Word A, BDigit r +--- a/source/sysolve/VERIFYCONSTSIGN.c ++++ b/source/sysolve/VERIFYCONSTSIGN.c +@@ -78,7 +78,7 @@ else if (FIRST(A) != IROOT) { /* atomic formula is "P_A T_A 0", where P_A is of level k_A. */ @@ -1416,9 +1458,9 @@ FIRST3(A,&T_A,&P_A,&k_A); if (r != k_A) { goto Return; } ---- a/source/ticad/ACCCVBC.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/source/ticad/ACCCVBC.c 2018-08-29 20:10:06.411075794 -0600 -@@ -28,7 +28,7 @@ static Word SECTIONPOLS(Word k, Word c, +--- a/source/ticad/ACCCVBC.c ++++ b/source/ticad/ACCCVBC.c +@@ -28,7 +28,7 @@ Word QepcadCls::ACCCVBC(Word k, Word c, Word M, Word B1, Word b, Word* B1h) { @@ -1427,7 +1469,7 @@ Step1: /* Initialization **********************************************/ a = NIL; /* this is the pseudo-sample point we're building up *******/ -@@ -44,7 +44,6 @@ Step1: /* Initialization *************** +@@ -44,7 +44,6 @@ Step2: /* Loop over each level from 1 to k ****************************/ for(i = 1; i <= k; i++) { I_i = LELTI(IV,i); @@ -1435,7 +1477,7 @@ c_i = LELTI(LELTI(c_i,CHILD),I_i); Step3: /* c_i is a section over a 0-dimensional cell ******************/ -@@ -108,11 +107,10 @@ L : the list of all k-level polynomials +@@ -108,11 +107,10 @@ ======================================================================*/ static Word SECTIONPOLS(Word k, Word c, Word P) { @@ -1449,9 +1491,9 @@ i = FIRST(FIRST(M)); L = COMP(LELTI(P_k,i),L); } return L; ---- a/source/ticad/ACCCVBCR.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/source/ticad/ACCCVBCR.c 2018-08-29 20:10:06.409075797 -0600 -@@ -25,7 +25,7 @@ static Word SECTIONPOLS(Word k, Word c, +--- a/source/ticad/ACCCVBCR.c ++++ b/source/ticad/ACCCVBCR.c +@@ -25,7 +25,7 @@ Word QepcadCls::ACCCVBCR(Word k, Word c, Word B1, Word b, Word* B1h) { @@ -1460,7 +1502,7 @@ Step1: /* Initialization **********************************************/ a = NIL; /* this is the pseudo-sample point we're building up *******/ -@@ -41,7 +41,6 @@ Step2: /* Loop over each level from 1 to +@@ -41,7 +41,6 @@ c_i = GVPC; for(i = 1; i <= k; i++) { I_i = LELTI(IV,i); @@ -1468,7 +1510,7 @@ c_i = LELTI(LELTI(c_i,CHILD),I_i); Step3: /* c_i is a section over a 0-dimensional cell ******************/ -@@ -99,11 +98,10 @@ L : the list of all k-level polynomials +@@ -99,11 +98,10 @@ ======================================================================*/ static Word SECTIONPOLS(Word k, Word c, Word P) { @@ -1482,9 +1524,9 @@ i = FIRST(FIRST(M)); L = COMP(LELTI(P_k,i),L); } return L; ---- a/source/ticad/APEQC.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/source/ticad/APEQC.c 2018-08-29 20:10:06.410075795 -0600 -@@ -21,7 +21,7 @@ Effect +--- a/source/ticad/APEQC.c ++++ b/source/ticad/APEQC.c +@@ -21,7 +21,7 @@ void QepcadCls::APEQC(Word c, Word k, Word P) { @@ -1493,9 +1535,9 @@ Step1: /* Get (k+1)-level equational constraints, if none, return. */ E = LELTI(GVEQNCONST,k+1); ---- a/source/ticad/CONSTRUCT.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/source/ticad/CONSTRUCT.c 2018-08-29 20:10:06.411075794 -0600 -@@ -24,8 +24,7 @@ Word IUPSBRRI(Word B, BDigit k); +--- a/source/ticad/CONSTRUCT.c ++++ b/source/ticad/CONSTRUCT.c +@@ -24,8 +24,7 @@ void QepcadCls::CONSTRUCT(Word c, Word k, Word f, Word Ps_, Word As) { BDigit p,t,Ths; @@ -1505,7 +1547,7 @@ Step0: /* Root cell. */ if (k == 0) { CONSTRUCT1(c,k,f,Ps_,As); goto Return; } -@@ -36,9 +35,7 @@ Step1: /* Extract the projection factors +@@ -36,9 +35,7 @@ for(Word Pt = CINV(Ps_); Pt != NIL; Pt = RED(Pt)) { Word Pt1 = FIRST(Pt); @@ -1516,7 +1558,7 @@ Ps = COMP(LELTI(Pt1,PO_POLY),Ps); } -@@ -242,9 +239,8 @@ BDigit C1COMP(Word A, Word B) +@@ -242,9 +239,8 @@ /* Root cell. */ void QepcadCls::CONSTRUCT1(Word c, Word k, Word f, Word Ps_, Word As) { @@ -1528,7 +1570,7 @@ Step1: /* Extract the projection factors from their attribute lists. */ Ps = NIL; /* Basis for real-root isolation - i.e. the polynomials */ -@@ -390,7 +386,7 @@ Word IUPSBRRIIR(Word t_B, BDigit p, BDig +@@ -390,7 +386,7 @@ if (Li == 0) { fail = true; goto Return; } for(BDigit t = (n%2==1 ? 1 : -1); Li != NIL; t *= -1, Li = RED(Li)) { @@ -1537,9 +1579,9 @@ Word J = SIPIR(C[i],I,t,k); L = COMP(LIST3(i,J,t),L); } ---- a/source/ticad/EC1.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/source/ticad/EC1.c 2018-08-29 20:10:06.411075794 -0600 -@@ -15,7 +15,7 @@ Establish Children of the root. +--- a/source/ticad/EC1.c ++++ b/source/ticad/EC1.c +@@ -15,7 +15,7 @@ void EC1(Word c, Word L, Word Bs) { @@ -1548,7 +1590,7 @@ /* hide kp,xp; */ Word T; -@@ -58,7 +58,6 @@ Step4: /* First section. */ +@@ -58,7 +58,6 @@ Step5: /* Check if there are more roots. */ if (Lp == NIL) goto Step9; @@ -1556,9 +1598,9 @@ Step6: /* Next sector. */ ADV(Lp,&Lp1,&Lp); ---- a/source/ticad/EC.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/source/ticad/EC.c 2018-08-29 20:10:06.410075795 -0600 -@@ -16,7 +16,7 @@ Establish Children. +--- a/source/ticad/EC.c ++++ b/source/ticad/EC.c +@@ -16,7 +16,7 @@ void EC(Word c, Word L, Word E, Word Bs) { @@ -1567,7 +1609,7 @@ /* hide kp,xp; */ Word T; -@@ -52,7 +52,6 @@ Step4: /* First section. */ +@@ -52,7 +52,6 @@ Step5: /* Check if there are more roots. */ if (Lp == NIL) goto Step9; @@ -1575,9 +1617,9 @@ Step6: /* Next sector. */ ADV2(Lp,&I,&B,&Lp); FIRST2(I,&l,&r); ---- a/source/ticad/ECR.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/source/ticad/ECR.c 2018-08-29 20:10:06.410075795 -0600 -@@ -16,7 +16,7 @@ Establish Children on a rational sample +--- a/source/ticad/ECR.c ++++ b/source/ticad/ECR.c +@@ -16,7 +16,7 @@ void ECR(Word c, Word L, Word E, Word Bs) { @@ -1586,7 +1628,7 @@ /* hide kp,xp; */ Word T; -@@ -55,7 +55,6 @@ Step4: /* First section. */ +@@ -55,7 +55,6 @@ Step5: /* Check if there are more roots. */ if (Lp == NIL) goto Step9; @@ -1594,9 +1636,9 @@ Step6: /* Next sector. */ ADV2(Lp,&I,&B,&Lp); FIRST2(I,&l,&r); ---- a/source/ticad/MAFUPGCD.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/source/ticad/MAFUPGCD.c 2018-08-29 20:10:06.409075797 -0600 -@@ -17,7 +17,7 @@ Output +--- a/source/ticad/MAFUPGCD.c ++++ b/source/ticad/MAFUPGCD.c +@@ -17,7 +17,7 @@ Word MAFUPGCD(Word p, Word M, Word A, Word B) { @@ -1605,9 +1647,9 @@ Step1: /* A = 0 \/ B = 0 */ if (A == 0) { ---- a/source/ticad/MAFUPMON.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/source/ticad/MAFUPMON.c 2018-08-29 20:10:06.410075795 -0600 -@@ -17,7 +17,7 @@ Output +--- a/source/ticad/MAFUPMON.c ++++ b/source/ticad/MAFUPMON.c +@@ -17,7 +17,7 @@ Word MAFUPMON(Word p, Word M, Word A) { @@ -1616,9 +1658,9 @@ Step1: /* A = 0 */ if (A == 0) { ---- a/source/ticad/QFFTEV.c.orig 2018-08-29 20:03:25.112519355 -0600 -+++ b/source/ticad/QFFTEV.c 2018-08-29 20:10:06.411075794 -0600 -@@ -17,8 +17,8 @@ static Word ATOMETFEVAL(Word Q, Word D, +--- a/source/ticad/QFFTEV.c ++++ b/source/ticad/QFFTEV.c +@@ -17,8 +17,8 @@ Word QepcadCls::QFFTEV(Word F, Word c, Word k) { @@ -1629,9 +1671,9 @@ Step1: /* Classify the formula $F$. */ T = FIRST(F); ---- a/source/ticad/SIGNP1.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/source/ticad/SIGNP1.c 2018-08-29 20:10:06.410075795 -0600 -@@ -19,7 +19,7 @@ using namespace std; +--- a/source/ticad/SIGNP1.c ++++ b/source/ticad/SIGNP1.c +@@ -19,7 +19,7 @@ void SIGNP1(Word c, Word P1, Word I) { @@ -1640,9 +1682,9 @@ Step1: /* Compute the signatures of $P_1$. */ vector S; ---- a/source/ticad/SUBST.c.orig 2018-08-29 20:05:52.867359499 -0600 -+++ b/source/ticad/SUBST.c 2018-08-29 20:10:06.410075795 -0600 -@@ -20,7 +20,6 @@ Substitute the sample point into the pro +--- a/source/ticad/SUBST.c ++++ b/source/ticad/SUBST.c +@@ -20,7 +20,6 @@ Word QepcadCls::SUBST(Word c, Word k, Word M, Word b, Word B) { Word B1,Bp,S,S1; @@ -1650,9 +1692,9 @@ Word P,L,Sp,T1,T2,G,Q,f,i; Step1: /* Substitute. */ ---- a/source/ticad/SUBSTR.c.orig 2018-08-29 20:05:52.868359497 -0600 -+++ b/source/ticad/SUBSTR.c 2018-08-29 20:10:06.411075794 -0600 -@@ -20,7 +20,6 @@ Substitute the rational sample point int +--- a/source/ticad/SUBSTR.c ++++ b/source/ticad/SUBSTR.c +@@ -20,7 +20,6 @@ Word QepcadCls::SUBSTR(Word c, Word k, Word b, Word B) { Word B1,Bp,S,S1; @@ -1660,9 +1702,9 @@ Word P,L,Q,T1,T2,Sp,G,f,i; Step1: /* Do it. */ ---- a/source/ticad/TICADauto.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/source/ticad/TICADauto.c 2018-08-29 20:10:06.410075795 -0600 -@@ -24,7 +24,7 @@ Output +--- a/source/ticad/TICADauto.c ++++ b/source/ticad/TICADauto.c +@@ -24,7 +24,7 @@ Word QepcadCls::TICADauto(Word Q, Word F, Word f, Word P, Word A) { @@ -1671,9 +1713,9 @@ Step1: /* Initialize. */ D = INITPCAD(); ---- a/source/ticad/TICAD.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/source/ticad/TICAD.c 2018-08-29 20:10:06.410075795 -0600 -@@ -24,7 +24,7 @@ Output +--- a/source/ticad/TICAD.c ++++ b/source/ticad/TICAD.c +@@ -24,7 +24,7 @@ Word QepcadCls::TICAD(Word Q, Word F, Word f, Word P, Word A) { @@ -1682,9 +1724,9 @@ Step1: /* Initialize. */ D = INITPCAD(); ---- a/source/userint/PRDLFI.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/source/userint/PRDLFI.c 2018-08-29 20:10:06.411075794 -0600 -@@ -7,7 +7,7 @@ Process "display-level-factors i" comman +--- a/source/userint/PRDLFI.c ++++ b/source/userint/PRDLFI.c +@@ -7,7 +7,7 @@ void QepcadCls::PRDLFI() { @@ -1693,9 +1735,9 @@ Step1: /* Get level. */ i = IREAD(); ---- a/source/userint/PREQNCONSTL.c.orig 2018-08-29 20:05:52.868359497 -0600 -+++ b/source/userint/PREQNCONSTL.c 2018-08-29 20:10:06.412075792 -0600 -@@ -90,7 +90,7 @@ Word POLYLABEL(Word P, Word p, Word r, W +--- a/source/userint/PREQNCONSTL.c ++++ b/source/userint/PREQNCONSTL.c +@@ -90,7 +90,7 @@ void QepcadCls::PREQNCONSTPOLY() { @@ -1704,9 +1746,9 @@ // Check if propagation of equational constraints was specified. if (PCPROPEC == FALSE) { ---- a/source/userint/PRMCC.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/source/userint/PRMCC.c 2018-08-29 20:10:06.411075794 -0600 -@@ -10,7 +10,7 @@ Process "manually choose a cell" command +--- a/source/userint/PRMCC.c ++++ b/source/userint/PRMCC.c +@@ -10,7 +10,7 @@ void QepcadCls::PRMCC(Word *t_) { @@ -1715,9 +1757,9 @@ /* hide t; */ Step1: /* Read in an argument. */ ---- a/source/userint/PRPROPEC.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/source/userint/PRPROPEC.c 2018-08-29 20:10:06.412075792 -0600 -@@ -7,7 +7,7 @@ Process prop-eqn-const command. +--- a/source/userint/PRPROPEC.c ++++ b/source/userint/PRPROPEC.c +@@ -7,7 +7,7 @@ void QepcadCls::PRPROPEC() { @@ -1726,9 +1768,9 @@ Step1: /* Toggle the PCPROPEC global variable and initialize globals. */ GVEQNCONST = GVPIVOT = NIL; ---- a/source/userint/PRRMPF.c.orig 2018-01-25 14:25:22.000000000 -0700 -+++ b/source/userint/PRRMPF.c 2018-08-29 20:10:06.411075794 -0600 -@@ -7,7 +7,7 @@ Process "Remove Projection Factor" comma +--- a/source/userint/PRRMPF.c ++++ b/source/userint/PRRMPF.c +@@ -7,7 +7,7 @@ void QepcadCls::PRRMPF() { From 365a88eb882b01acba077a2292407274e052af88 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Thu, 7 Dec 2023 17:22:21 -0800 Subject: [PATCH 101/145] build/pkgs/qepcad/distros: Add debian, fedora, macports --- build/pkgs/qepcad/distros/debian.txt | 1 + build/pkgs/qepcad/distros/fedora.txt | 1 + build/pkgs/qepcad/distros/macports.txt | 1 + 3 files changed, 3 insertions(+) create mode 100644 build/pkgs/qepcad/distros/debian.txt create mode 100644 build/pkgs/qepcad/distros/fedora.txt create mode 100644 build/pkgs/qepcad/distros/macports.txt diff --git a/build/pkgs/qepcad/distros/debian.txt b/build/pkgs/qepcad/distros/debian.txt new file mode 100644 index 00000000000..38b796f2c4b --- /dev/null +++ b/build/pkgs/qepcad/distros/debian.txt @@ -0,0 +1 @@ +qepcad diff --git a/build/pkgs/qepcad/distros/fedora.txt b/build/pkgs/qepcad/distros/fedora.txt new file mode 100644 index 00000000000..d50223a4423 --- /dev/null +++ b/build/pkgs/qepcad/distros/fedora.txt @@ -0,0 +1 @@ +qepcad-B diff --git a/build/pkgs/qepcad/distros/macports.txt b/build/pkgs/qepcad/distros/macports.txt new file mode 100644 index 00000000000..38b796f2c4b --- /dev/null +++ b/build/pkgs/qepcad/distros/macports.txt @@ -0,0 +1 @@ +qepcad From 7fa1092c2e80f07615b1d95e30d831879cc0e12c Mon Sep 17 00:00:00 2001 From: Aman Date: Fri, 8 Dec 2023 16:01:44 +0530 Subject: [PATCH 102/145] removed the python Print3 statement and Doctest from developer documentation --- src/doc/en/developer/coding_basics.rst | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/doc/en/developer/coding_basics.rst b/src/doc/en/developer/coding_basics.rst index 88bfdfd436a..0ef64de57e8 100644 --- a/src/doc/en/developer/coding_basics.rst +++ b/src/doc/en/developer/coding_basics.rst @@ -1039,11 +1039,6 @@ written. The :ref:`doctest fixer ` uses tab stops at columns 48, 56, 64, ... for these tags. -- **Python3 print:** In SageMath code and doctests, adhere to Python 3 - syntax for the print function. Use parentheses as follows:: - sage: print("but like this") - but like this - - **Split long lines:** You may want to split long lines of code with a backslash. Note: this syntax is non-standard and may be removed in the future:: From 78e6cd857ec883e9be33cd178a34ddc2c3357a39 Mon Sep 17 00:00:00 2001 From: Dima Pasechnik Date: Fri, 8 Dec 2023 11:23:51 +0000 Subject: [PATCH 103/145] use "real" upstream tarballs, update saclib, update SPKG.rst files --- build/pkgs/qepcad/SPKG.rst | 21 ++++----------------- build/pkgs/qepcad/checksums.ini | 10 +++++----- build/pkgs/saclib/SPKG.rst | 25 ++++--------------------- build/pkgs/saclib/checksums.ini | 7 ++++--- build/pkgs/saclib/package-version.txt | 2 +- 5 files changed, 18 insertions(+), 47 deletions(-) diff --git a/build/pkgs/qepcad/SPKG.rst b/build/pkgs/qepcad/SPKG.rst index 6800372bc56..f95888fa9d9 100644 --- a/build/pkgs/qepcad/SPKG.rst +++ b/build/pkgs/qepcad/SPKG.rst @@ -10,24 +10,11 @@ cylindrical algebraic decomposition License ------- -QEPCAD B Copyright (c) 1990, 2008, Hoon Hong & Chris Brown (contact -wcbrown@usna.edu) - -Permission to use, copy, modify, and/or distribute this software, -including source files, README files, etc., for any purpose with or -without fee is hereby granted, provided that the above copyright notice -and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - +ICS :wikipedia:`ISC_license` Upstream Contact ---------------- - https://github.com/chriswestbrown/qepcad +- Repository: https://github.com/chriswestbrown/qepcad +- Tarballs: https://www.usna.edu/Users/cs/wcbrown/qepcad/INSTALL/IQ.html +- Website: (outdated) https://www.usna.edu/Users/cs/wcbrown/qepcad/B/QEPCAD.html diff --git a/build/pkgs/qepcad/checksums.ini b/build/pkgs/qepcad/checksums.ini index 6a614100808..48c23eaad91 100644 --- a/build/pkgs/qepcad/checksums.ini +++ b/build/pkgs/qepcad/checksums.ini @@ -1,5 +1,5 @@ -tarball=qepcad-VERSION.tar.xz -sha1=3c482a88bf552cea6702e4db6a3d17e4b7549eb6 -md5=7d3f85d253473f6d90d83033ff22820d -cksum=2757536071 -upstream_url=http://deb.debian.org/debian/pool/main/q/qepcad/qepcad_VERSION+ds.orig.tar.xz +tarball=qepcad-VERSION.tar.gz +sha1=644324e1224350cc663e93c5ce99b93de0de26e3 +md5=f368459cfab2d42caa40919e60093020 +cksum=783450087 +upstream_url=https://www.usna.edu/Users/cs/wcbrown/qepcad/INSTALL/qepcad-B.VERSION.tgz diff --git a/build/pkgs/saclib/SPKG.rst b/build/pkgs/saclib/SPKG.rst index 06a733a7f20..84d62729fa8 100644 --- a/build/pkgs/saclib/SPKG.rst +++ b/build/pkgs/saclib/SPKG.rst @@ -10,28 +10,11 @@ SAC2 system. It is mainly used as a dependency of qepcad. License ------- -Saclib 2.2 Copyright (c) 1993, 2008, RISC-Linz (contact -wcbrown@usna.edu) - -Permission to use, copy, modify, and/or distribute this software, -including source files, README files, etc., for any purpose with or -without fee is hereby granted, provided that the above copyright notice -and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - +ICS :wikipedia:`ISC_license` Upstream Contact ---------------- -- Website: http://www.usna.edu/CS/qepcadweb/B/QEPCAD.html -- Alternative location (sometimes more up-to-date): - - https://www.usna.edu/Users/cs/wcbrown/qepcad/B/QEPCAD.html - +- Repository: https://github.com/chriswestbrown/saclib +- Tarballs: https://www.usna.edu/Users/cs/wcbrown/qepcad/INSTALL/IQ.html +- Website: (outdated) https://www.usna.edu/Users/cs/wcbrown/qepcad/B/QEPCAD.html diff --git a/build/pkgs/saclib/checksums.ini b/build/pkgs/saclib/checksums.ini index e8d1f41da83..1f0289be1e8 100644 --- a/build/pkgs/saclib/checksums.ini +++ b/build/pkgs/saclib/checksums.ini @@ -1,4 +1,5 @@ tarball=saclibVERSION.tar.gz -sha1=c82597e094d771f7d63e77c3c104ba7ab56c16ea -md5=e834693dd428caf1b15bd87b260f7825 -cksum=549883117 +sha1=6f37da451e1003b381e8a9dd7f60ec265021d061 +md5=2a251651bc96a14eba4300f18ec4cbb4 +cksum=3062086094 +upstream_url=https://www.usna.edu/Users/cs/wcbrown/qepcad/INSTALL/saclibVERSION.tgz diff --git a/build/pkgs/saclib/package-version.txt b/build/pkgs/saclib/package-version.txt index 5bc1cc43d4e..23a63f524e2 100644 --- a/build/pkgs/saclib/package-version.txt +++ b/build/pkgs/saclib/package-version.txt @@ -1 +1 @@ -2.2.7 +2.2.8 From d256b42f901eb888262d74b123b6f8dab771d73f Mon Sep 17 00:00:00 2001 From: Dima Pasechnik Date: Fri, 8 Dec 2023 11:28:40 +0000 Subject: [PATCH 104/145] distros info for saclib --- build/pkgs/saclib/distros/debian.txt | 1 + build/pkgs/saclib/distros/fedora.txt | 2 ++ 2 files changed, 3 insertions(+) create mode 100644 build/pkgs/saclib/distros/debian.txt create mode 100644 build/pkgs/saclib/distros/fedora.txt diff --git a/build/pkgs/saclib/distros/debian.txt b/build/pkgs/saclib/distros/debian.txt new file mode 100644 index 00000000000..2eb44006718 --- /dev/null +++ b/build/pkgs/saclib/distros/debian.txt @@ -0,0 +1 @@ +libsaclib-dev diff --git a/build/pkgs/saclib/distros/fedora.txt b/build/pkgs/saclib/distros/fedora.txt new file mode 100644 index 00000000000..51f02e6fee8 --- /dev/null +++ b/build/pkgs/saclib/distros/fedora.txt @@ -0,0 +1,2 @@ +saclib +saclib-devel From beb976109e4513faa8a6f4b8acbff402efc2b7a9 Mon Sep 17 00:00:00 2001 From: Dima Pasechnik Date: Fri, 8 Dec 2023 11:29:18 +0000 Subject: [PATCH 105/145] promote qepcad to optional --- build/pkgs/qepcad/type | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/pkgs/qepcad/type b/build/pkgs/qepcad/type index 9839eb20815..134d9bc32d5 100644 --- a/build/pkgs/qepcad/type +++ b/build/pkgs/qepcad/type @@ -1 +1 @@ -experimental +optional From 95b80ca04ddd98cd1d86ff8b05f917adde609e5f Mon Sep 17 00:00:00 2001 From: Dima Pasechnik Date: Sat, 9 Dec 2023 16:49:33 +0000 Subject: [PATCH 106/145] adjust doctest --- src/sage/interfaces/qepcad.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sage/interfaces/qepcad.py b/src/sage/interfaces/qepcad.py index 5a69861eec8..5b05124d33a 100644 --- a/src/sage/interfaces/qepcad.py +++ b/src/sage/interfaces/qepcad.py @@ -1090,7 +1090,7 @@ def _parse_answer_stats(self): sage: ans 'x^2 - 2 > 0' sage: stats - '-----------------------------------------------------------------------------\r\n0 Garbage collections, 0 Cells and 0 Arrays reclaimed, in 0 milliseconds.\r\n492514 Cells in AVAIL, 500000 Cells in SPACE.\r\n\r\nSystem time: 16 milliseconds.\r\nSystem time after the initialization: 4 milliseconds.\r\n-----------------------------------------------------------------------------\r\n' + '-----------------------------------------------------------------------------\r\n0 Garbage collections, 0 Cells and 0 Arrays reclaimed, in 0 ... """ if self.phase() != 'EXITED': raise ValueError("QEPCAD is not finished yet") From 66e5109686d6faf01e8517504cb26250e5325548 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Fri, 3 Nov 2023 12:45:39 -0700 Subject: [PATCH 107/145] build/pkgs/gnumake_tokenpool: New --- build/pkgs/gnumake_tokenpool/SPKG.rst | 21 +++++++++++++++++++ build/pkgs/gnumake_tokenpool/checksums.ini | 5 +++++ build/pkgs/gnumake_tokenpool/dependencies | 1 + .../gnumake_tokenpool/install-requires.txt | 1 + .../gnumake_tokenpool/package-version.txt | 1 + build/pkgs/gnumake_tokenpool/spkg-install.in | 2 ++ build/pkgs/gnumake_tokenpool/type | 1 + 7 files changed, 32 insertions(+) create mode 100644 build/pkgs/gnumake_tokenpool/SPKG.rst create mode 100644 build/pkgs/gnumake_tokenpool/checksums.ini create mode 100644 build/pkgs/gnumake_tokenpool/dependencies create mode 100644 build/pkgs/gnumake_tokenpool/install-requires.txt create mode 100644 build/pkgs/gnumake_tokenpool/package-version.txt create mode 100644 build/pkgs/gnumake_tokenpool/spkg-install.in create mode 100644 build/pkgs/gnumake_tokenpool/type diff --git a/build/pkgs/gnumake_tokenpool/SPKG.rst b/build/pkgs/gnumake_tokenpool/SPKG.rst new file mode 100644 index 00000000000..87ae8d01c27 --- /dev/null +++ b/build/pkgs/gnumake_tokenpool/SPKG.rst @@ -0,0 +1,21 @@ +gnumake_tokenpool: Jobclient and jobserver for the GNU make tokenpool protocol +============================================================================== + +Description +----------- + +The project has implementations in multiple languages. + +We only install the implementation in Python. + + +License +------- + +MIT + + +Upstream Contact +---------------- + +https://github.com/milahu/gnumake-tokenpool diff --git a/build/pkgs/gnumake_tokenpool/checksums.ini b/build/pkgs/gnumake_tokenpool/checksums.ini new file mode 100644 index 00000000000..9362f2e52f4 --- /dev/null +++ b/build/pkgs/gnumake_tokenpool/checksums.ini @@ -0,0 +1,5 @@ +tarball=gnumake_tokenpool-VERSION.tar.gz +sha1=6b5cf8f6327055941e9f52ff2b2dd20242675e7e +md5=bc890dd499ba91a2f8d6aa47884e0fb2 +cksum=612068075 +upstream_url=https://github.com/milahu/gnumake-tokenpool/archive/VERSION.tar.gz diff --git a/build/pkgs/gnumake_tokenpool/dependencies b/build/pkgs/gnumake_tokenpool/dependencies new file mode 100644 index 00000000000..25a25c98198 --- /dev/null +++ b/build/pkgs/gnumake_tokenpool/dependencies @@ -0,0 +1 @@ + | $(PYTHON) $(PYTHON_TOOLCHAIN) diff --git a/build/pkgs/gnumake_tokenpool/install-requires.txt b/build/pkgs/gnumake_tokenpool/install-requires.txt new file mode 100644 index 00000000000..6911b62dd9b --- /dev/null +++ b/build/pkgs/gnumake_tokenpool/install-requires.txt @@ -0,0 +1 @@ +git+https://github.com/milahu/gnumake-tokenpool@54435c300e3b660cc75ffd8d63e518df322e6891#egg=gnumake_tokenpool diff --git a/build/pkgs/gnumake_tokenpool/package-version.txt b/build/pkgs/gnumake_tokenpool/package-version.txt new file mode 100644 index 00000000000..5b5ac0b3599 --- /dev/null +++ b/build/pkgs/gnumake_tokenpool/package-version.txt @@ -0,0 +1 @@ +54435c300e3b660cc75ffd8d63e518df322e6891 diff --git a/build/pkgs/gnumake_tokenpool/spkg-install.in b/build/pkgs/gnumake_tokenpool/spkg-install.in new file mode 100644 index 00000000000..37ac1a53437 --- /dev/null +++ b/build/pkgs/gnumake_tokenpool/spkg-install.in @@ -0,0 +1,2 @@ +cd src +sdh_pip_install . diff --git a/build/pkgs/gnumake_tokenpool/type b/build/pkgs/gnumake_tokenpool/type new file mode 100644 index 00000000000..a6a7b9cd726 --- /dev/null +++ b/build/pkgs/gnumake_tokenpool/type @@ -0,0 +1 @@ +standard From a47112daed745ac2da4177e0f9efebd1223b63ed Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Fri, 3 Nov 2023 18:12:30 -0700 Subject: [PATCH 108/145] src/sage/doctest/forker.py: Use gnumake_tokenpool if available --- pkgs/sagemath-categories/tox.ini | 1 + src/sage/doctest/forker.py | 56 +++++++++++++++++++------------- 2 files changed, 35 insertions(+), 22 deletions(-) diff --git a/pkgs/sagemath-categories/tox.ini b/pkgs/sagemath-categories/tox.ini index 5469be55b3c..b4bb49d132a 100644 --- a/pkgs/sagemath-categories/tox.ini +++ b/pkgs/sagemath-categories/tox.ini @@ -26,6 +26,7 @@ passenv = # Parallel build SAGE_NUM_THREADS SAGE_NUM_THREADS_PARALLEL + MAKEFLAGS # SAGE_VENV only for referring to the basepython or finding the wheels sagepython, sagewheels: SAGE_VENV # Location of the wheels diff --git a/src/sage/doctest/forker.py b/src/sage/doctest/forker.py index 05bd5d0fd8e..ede127ff48e 100644 --- a/src/sage/doctest/forker.py +++ b/src/sage/doctest/forker.py @@ -1803,6 +1803,16 @@ def parallel_dispatch(self): """ opt = self.controller.options + job_client = None + try: + from gnumake_tokenpool import JobClient, NoJobServer + try: + job_client = JobClient() + except NoJobServer: + pass + except ImportError: + pass + source_iter = iter(self.controller.sources) # If timeout was 0, simply set a very long time @@ -1925,6 +1935,9 @@ def sel_exit(): w.copied_pid = w.pid w.close() finished.append(w) + if job_client: + job_client.release() + workers = new_workers # Similarly, process finished workers. @@ -1959,28 +1972,25 @@ def sel_exit(): break # Start new workers if possible - while source_iter is not None and len(workers) < opt.nthreads: - try: - source = next(source_iter) - except StopIteration: - source_iter = None - else: - # Start a new worker. - import copy - worker_options = copy.copy(opt) - if target_endtime is not None: - worker_options.target_walltime = (target_endtime - now) / (max(1, pending_tests / opt.nthreads)) - w = DocTestWorker(source, options=worker_options, funclist=[sel_exit]) - heading = self.controller.reporter.report_head(w.source) - if not self.controller.options.only_errors: - w.messages = heading + "\n" - # Store length of heading to detect if the - # worker has something interesting to report. - w.heading_len = len(w.messages) - w.start() # This might take some time - w.deadline = time.time() + opt.timeout - workers.append(w) - restart = True + while ((source := next(source_iter, None)) is not None + and len(workers) < opt.nthreads + and (not job_client or job_client.acquire())): + # Start a new worker. + import copy + worker_options = copy.copy(opt) + if target_endtime is not None: + worker_options.target_walltime = (target_endtime - now) / (max(1, pending_tests / opt.nthreads)) + w = DocTestWorker(source, options=worker_options, funclist=[sel_exit]) + heading = self.controller.reporter.report_head(w.source) + if not self.controller.options.only_errors: + w.messages = heading + "\n" + # Store length of heading to detect if the + # worker has something interesting to report. + w.heading_len = len(w.messages) + w.start() # This might take some time + w.deadline = time.time() + opt.timeout + workers.append(w) + restart = True # Recompute state if needed if restart: @@ -2040,6 +2050,8 @@ def sel_exit(): sleep(die_timeout) for w in workers: w.kill() + if job_client: + job_client.release() finally: os._exit(0) From afd277d9a5a2c6f50a7327dc40a7efdfc4d60c7d Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Fri, 3 Nov 2023 18:15:29 -0700 Subject: [PATCH 109/145] build/pkgs/gnumake_tokenpool: Update to ba838b031da2f20af237159ad6e91ada038ef921 --- build/pkgs/gnumake_tokenpool/SPKG.rst | 3 ++- build/pkgs/gnumake_tokenpool/checksums.ini | 8 ++++---- build/pkgs/gnumake_tokenpool/install-requires.txt | 2 +- build/pkgs/gnumake_tokenpool/package-version.txt | 2 +- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/build/pkgs/gnumake_tokenpool/SPKG.rst b/build/pkgs/gnumake_tokenpool/SPKG.rst index 87ae8d01c27..85711b4d778 100644 --- a/build/pkgs/gnumake_tokenpool/SPKG.rst +++ b/build/pkgs/gnumake_tokenpool/SPKG.rst @@ -18,4 +18,5 @@ MIT Upstream Contact ---------------- -https://github.com/milahu/gnumake-tokenpool +- https://github.com/milahu/gnumake-tokenpool (upstream) +- https://github.com/mkoeppe/gnumake-tokenpool (patch) diff --git a/build/pkgs/gnumake_tokenpool/checksums.ini b/build/pkgs/gnumake_tokenpool/checksums.ini index 9362f2e52f4..2bb9bb4ff53 100644 --- a/build/pkgs/gnumake_tokenpool/checksums.ini +++ b/build/pkgs/gnumake_tokenpool/checksums.ini @@ -1,5 +1,5 @@ tarball=gnumake_tokenpool-VERSION.tar.gz -sha1=6b5cf8f6327055941e9f52ff2b2dd20242675e7e -md5=bc890dd499ba91a2f8d6aa47884e0fb2 -cksum=612068075 -upstream_url=https://github.com/milahu/gnumake-tokenpool/archive/VERSION.tar.gz +sha1=34e7b5aaeda4eb5edfaafc2db7f177320b2a5a90 +md5=13896c774e66c610adc5e70e86b9946b +cksum=663994353 +upstream_url=https://github.com/mkoeppe/gnumake-tokenpool/archive/VERSION.tar.gz diff --git a/build/pkgs/gnumake_tokenpool/install-requires.txt b/build/pkgs/gnumake_tokenpool/install-requires.txt index 6911b62dd9b..15d38f1a86b 100644 --- a/build/pkgs/gnumake_tokenpool/install-requires.txt +++ b/build/pkgs/gnumake_tokenpool/install-requires.txt @@ -1 +1 @@ -git+https://github.com/milahu/gnumake-tokenpool@54435c300e3b660cc75ffd8d63e518df322e6891#egg=gnumake_tokenpool +git+https://github.com/mkoeppe/gnumake-tokenpool@ba838b031da2f20af237159ad6e91ada038ef921#egg=gnumake_tokenpool diff --git a/build/pkgs/gnumake_tokenpool/package-version.txt b/build/pkgs/gnumake_tokenpool/package-version.txt index 5b5ac0b3599..dc46dd046a9 100644 --- a/build/pkgs/gnumake_tokenpool/package-version.txt +++ b/build/pkgs/gnumake_tokenpool/package-version.txt @@ -1 +1 @@ -54435c300e3b660cc75ffd8d63e518df322e6891 +ba838b031da2f20af237159ad6e91ada038ef921 From 84b9b68f68667174082d84132e3dee9302a2d133 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Fri, 3 Nov 2023 18:44:00 -0700 Subject: [PATCH 110/145] pkgs/sagemath-*/tox.ini: passenv MAKEFLAGS --- pkgs/sagemath-environment/tox.ini | 1 + pkgs/sagemath-objects/tox.ini | 1 + pkgs/sagemath-repl/tox.ini | 1 + pkgs/sagemath-standard/tox.ini | 1 + 4 files changed, 4 insertions(+) diff --git a/pkgs/sagemath-environment/tox.ini b/pkgs/sagemath-environment/tox.ini index ff2eef44f66..6bf1f2a6ebb 100644 --- a/pkgs/sagemath-environment/tox.ini +++ b/pkgs/sagemath-environment/tox.ini @@ -26,6 +26,7 @@ passenv = # Parallel build SAGE_NUM_THREADS SAGE_NUM_THREADS_PARALLEL + MAKEFLAGS # SAGE_VENV only for referring to the basepython or finding the wheels sagepython, sagewheels: SAGE_VENV # Location of the wheels diff --git a/pkgs/sagemath-objects/tox.ini b/pkgs/sagemath-objects/tox.ini index 0ca92ea9570..a8f5a6d6a76 100644 --- a/pkgs/sagemath-objects/tox.ini +++ b/pkgs/sagemath-objects/tox.ini @@ -26,6 +26,7 @@ passenv = # Parallel build SAGE_NUM_THREADS SAGE_NUM_THREADS_PARALLEL + MAKEFLAGS # SAGE_VENV only for referring to the basepython or finding the wheels sagepython, sagewheels: SAGE_VENV # Location of the wheels diff --git a/pkgs/sagemath-repl/tox.ini b/pkgs/sagemath-repl/tox.ini index 6944df002f5..679153a2947 100644 --- a/pkgs/sagemath-repl/tox.ini +++ b/pkgs/sagemath-repl/tox.ini @@ -26,6 +26,7 @@ passenv = # Parallel build SAGE_NUM_THREADS SAGE_NUM_THREADS_PARALLEL + MAKEFLAGS # SAGE_VENV only for referring to the basepython or finding the wheels sagepython, sagewheels: SAGE_VENV # Location of the wheels diff --git a/pkgs/sagemath-standard/tox.ini b/pkgs/sagemath-standard/tox.ini index c14f97f8bbf..6aae1ef1bfa 100644 --- a/pkgs/sagemath-standard/tox.ini +++ b/pkgs/sagemath-standard/tox.ini @@ -75,6 +75,7 @@ passenv = # Parallel build SAGE_NUM_THREADS SAGE_NUM_THREADS_PARALLEL + MAKEFLAGS # SAGE_VENV only for referring to the basepython or finding the wheels sagepython, sagewheels: SAGE_VENV # Location of the wheels From d0763bbd71bb770c45237ea7455b2c7603a2ccfe Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 4 Nov 2023 10:14:14 -0700 Subject: [PATCH 111/145] build/pkgs/gnumake_tokenpool: Use upstreamed fix --- build/pkgs/gnumake_tokenpool/SPKG.rst | 1 - build/pkgs/gnumake_tokenpool/checksums.ini | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/build/pkgs/gnumake_tokenpool/SPKG.rst b/build/pkgs/gnumake_tokenpool/SPKG.rst index 85711b4d778..a5c43be63b5 100644 --- a/build/pkgs/gnumake_tokenpool/SPKG.rst +++ b/build/pkgs/gnumake_tokenpool/SPKG.rst @@ -19,4 +19,3 @@ Upstream Contact ---------------- - https://github.com/milahu/gnumake-tokenpool (upstream) -- https://github.com/mkoeppe/gnumake-tokenpool (patch) diff --git a/build/pkgs/gnumake_tokenpool/checksums.ini b/build/pkgs/gnumake_tokenpool/checksums.ini index 2bb9bb4ff53..f01142e694c 100644 --- a/build/pkgs/gnumake_tokenpool/checksums.ini +++ b/build/pkgs/gnumake_tokenpool/checksums.ini @@ -2,4 +2,4 @@ tarball=gnumake_tokenpool-VERSION.tar.gz sha1=34e7b5aaeda4eb5edfaafc2db7f177320b2a5a90 md5=13896c774e66c610adc5e70e86b9946b cksum=663994353 -upstream_url=https://github.com/mkoeppe/gnumake-tokenpool/archive/VERSION.tar.gz +upstream_url=https://github.com/milahu/gnumake-tokenpool/archive/VERSION.tar.gz From 56cbd03493db3c02c03ae574d7040bdf04178f77 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 4 Nov 2023 10:46:35 -0700 Subject: [PATCH 112/145] build/pkgs/gnumake_tokenpool: Switch to PyPI release --- build/pkgs/gnumake_tokenpool/checksums.ini | 10 +++++----- build/pkgs/gnumake_tokenpool/install-requires.txt | 2 +- build/pkgs/gnumake_tokenpool/package-version.txt | 2 +- build/pkgs/gnumake_tokenpool/spkg-install.in | 2 -- 4 files changed, 7 insertions(+), 9 deletions(-) delete mode 100644 build/pkgs/gnumake_tokenpool/spkg-install.in diff --git a/build/pkgs/gnumake_tokenpool/checksums.ini b/build/pkgs/gnumake_tokenpool/checksums.ini index f01142e694c..62f631ea40a 100644 --- a/build/pkgs/gnumake_tokenpool/checksums.ini +++ b/build/pkgs/gnumake_tokenpool/checksums.ini @@ -1,5 +1,5 @@ -tarball=gnumake_tokenpool-VERSION.tar.gz -sha1=34e7b5aaeda4eb5edfaafc2db7f177320b2a5a90 -md5=13896c774e66c610adc5e70e86b9946b -cksum=663994353 -upstream_url=https://github.com/milahu/gnumake-tokenpool/archive/VERSION.tar.gz +tarball=gnumake_tokenpool-VERSION-py3-none-any.whl +sha1=a060f03e0306a85bc1a91a450e457be83ed371e9 +md5=834ccc4d6d52741c5eabac1bdb8f39b2 +cksum=1679797266 +upstream_url=https://pypi.io/packages/py3/g/gnumake_tokenpool/gnumake_tokenpool-VERSION-py3-none-any.whl diff --git a/build/pkgs/gnumake_tokenpool/install-requires.txt b/build/pkgs/gnumake_tokenpool/install-requires.txt index 15d38f1a86b..0ee4452edd3 100644 --- a/build/pkgs/gnumake_tokenpool/install-requires.txt +++ b/build/pkgs/gnumake_tokenpool/install-requires.txt @@ -1 +1 @@ -git+https://github.com/mkoeppe/gnumake-tokenpool@ba838b031da2f20af237159ad6e91ada038ef921#egg=gnumake_tokenpool +gnumake-tokenpool diff --git a/build/pkgs/gnumake_tokenpool/package-version.txt b/build/pkgs/gnumake_tokenpool/package-version.txt index dc46dd046a9..bcab45af15a 100644 --- a/build/pkgs/gnumake_tokenpool/package-version.txt +++ b/build/pkgs/gnumake_tokenpool/package-version.txt @@ -1 +1 @@ -ba838b031da2f20af237159ad6e91ada038ef921 +0.0.3 diff --git a/build/pkgs/gnumake_tokenpool/spkg-install.in b/build/pkgs/gnumake_tokenpool/spkg-install.in deleted file mode 100644 index 37ac1a53437..00000000000 --- a/build/pkgs/gnumake_tokenpool/spkg-install.in +++ /dev/null @@ -1,2 +0,0 @@ -cd src -sdh_pip_install . From 8945746e3fe60218bc2688751a4aafcc6f0b32c1 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 4 Nov 2023 14:46:52 -0700 Subject: [PATCH 113/145] src/sage/doctest/forker.py: Fix/simplify last change --- src/sage/doctest/forker.py | 42 ++++++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/src/sage/doctest/forker.py b/src/sage/doctest/forker.py index ede127ff48e..4315cd1ba9f 100644 --- a/src/sage/doctest/forker.py +++ b/src/sage/doctest/forker.py @@ -1972,25 +1972,31 @@ def sel_exit(): break # Start new workers if possible - while ((source := next(source_iter, None)) is not None - and len(workers) < opt.nthreads + while (source_iter is not None and len(workers) < opt.nthreads and (not job_client or job_client.acquire())): - # Start a new worker. - import copy - worker_options = copy.copy(opt) - if target_endtime is not None: - worker_options.target_walltime = (target_endtime - now) / (max(1, pending_tests / opt.nthreads)) - w = DocTestWorker(source, options=worker_options, funclist=[sel_exit]) - heading = self.controller.reporter.report_head(w.source) - if not self.controller.options.only_errors: - w.messages = heading + "\n" - # Store length of heading to detect if the - # worker has something interesting to report. - w.heading_len = len(w.messages) - w.start() # This might take some time - w.deadline = time.time() + opt.timeout - workers.append(w) - restart = True + try: + source = next(source_iter) + except StopIteration: + source_iter = None + if job_client: + job_client.release() + else: + # Start a new worker. + import copy + worker_options = copy.copy(opt) + if target_endtime is not None: + worker_options.target_walltime = (target_endtime - now) / (max(1, pending_tests / opt.nthreads)) + w = DocTestWorker(source, options=worker_options, funclist=[sel_exit]) + heading = self.controller.reporter.report_head(w.source) + if not self.controller.options.only_errors: + w.messages = heading + "\n" + # Store length of heading to detect if the + # worker has something interesting to report. + w.heading_len = len(w.messages) + w.start() # This might take some time + w.deadline = time.time() + opt.timeout + workers.append(w) + restart = True # Recompute state if needed if restart: From 791200341ce283f30eb8f326dd5943459d2e183a Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Mon, 6 Nov 2023 10:12:37 -0800 Subject: [PATCH 114/145] Update documentation --- src/bin/sage-runtests | 3 ++- src/doc/en/developer/doctesting.rst | 5 ++++- src/doc/en/installation/source.rst | 17 +++++++++++------ 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/src/bin/sage-runtests b/src/bin/sage-runtests index 01b7ca44868..e25cebb48a8 100755 --- a/src/bin/sage-runtests +++ b/src/bin/sage-runtests @@ -26,7 +26,8 @@ if __name__ == "__main__": ".py, .pyx, .pxd, .pxi, .sage, .spyx, .tex, .rst.") parser.add_argument("-p", "--nthreads", dest="nthreads", type=int, nargs='?', const=0, default=1, metavar="N", - help="tests in parallel using N threads with 0 interpreted as max(2, min(8, cpu_count()))") + help="test in parallel using N threads, with 0 interpreted as max(2, min(8, cpu_count())); " + "when run under the control of the GNU make jobserver (make -j), request as most N job slots") parser.add_argument("-T", "--timeout", type=int, default=-1, help="timeout (in seconds) for doctesting one file, 0 for no timeout") what = parser.add_mutually_exclusive_group() what.add_argument("-a", "--all", action="store_true", default=False, help="test all files in the Sage library") diff --git a/src/doc/en/developer/doctesting.rst b/src/doc/en/developer/doctesting.rst index 589c9260134..f7c54bbbeec 100644 --- a/src/doc/en/developer/doctesting.rst +++ b/src/doc/en/developer/doctesting.rst @@ -512,7 +512,10 @@ doctests. This determines the number of threads by reading the environment variable :envvar:`MAKE`: if it is set to ``make -j12``, then use 12 threads. If :envvar:`MAKE` is not set, then by default it uses the number of CPU cores (as determined by the Python function -``multiprocessing.cpu_count()``) with a minimum of 2 and a maximum of 8. +:func:`multiprocessing.cpu_count`) with a minimum of 2 and a maximum of 8. +(When this runs under the control of the `GNU make jobserver +`_, then Sage +will request as most this number of job slots.) In any case, this will test the Sage library with multiple threads:: diff --git a/src/doc/en/installation/source.rst b/src/doc/en/installation/source.rst index b16fd8e7295..c9de73dd724 100644 --- a/src/doc/en/installation/source.rst +++ b/src/doc/en/installation/source.rst @@ -782,14 +782,19 @@ Here are some of the more commonly used variables affecting the build process: Some users on single-core macOS machines have reported problems when building Sage with ``MAKE='make -jNUM'`` with ``NUM`` greater than one. -- :envvar:`SAGE_NUM_THREADS` - if set to a number, then when building the - documentation, parallel doctesting, or running ``sage -b``, use this many - threads. +- :envvar:`SAGE_NUM_THREADS` - if set to a number, then when rebuilding with + ``sage -b`` or parallel doctesting with ``sage -t -p 0``, use at most this + many threads. + If this is not set, then determine the number of threads using the value of the :envvar:`MAKE` (see above) or :envvar:`MAKEFLAGS` environment variables. - If none of these specifies a number of jobs, use one thread (except for - parallel testing: there we use a default of the number of CPU cores, with a - maximum of 8 and a minimum of 2). + If none of these specifies a number of jobs, + - ``sage -b`` only uses one thread + - ``sage -t -p 0`` uses a default of the number of CPU cores, with a + maximum of 8 and a minimum of 2. + + When ``sage -t -p`` runs under the control of the GNU ``make`` + jobserver, then Sage will request as most this number of job slots. - :envvar:`V` - if set to ``0``, silence the build. Instead of showing a detailed compilation log, only one line of output is shown From 1dc6d36ae8541731300a326a7f90e4f86a03cbc2 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 9 Dec 2023 10:14:07 -0800 Subject: [PATCH 115/145] src/doc/en/installation/source.rst: Fix markup --- src/doc/en/installation/source.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/doc/en/installation/source.rst b/src/doc/en/installation/source.rst index c9de73dd724..485d4916ec8 100644 --- a/src/doc/en/installation/source.rst +++ b/src/doc/en/installation/source.rst @@ -789,7 +789,9 @@ Here are some of the more commonly used variables affecting the build process: If this is not set, then determine the number of threads using the value of the :envvar:`MAKE` (see above) or :envvar:`MAKEFLAGS` environment variables. If none of these specifies a number of jobs, + - ``sage -b`` only uses one thread + - ``sage -t -p 0`` uses a default of the number of CPU cores, with a maximum of 8 and a minimum of 2. From 8b2c6663e529697008520dc27e688334cc38816b Mon Sep 17 00:00:00 2001 From: Jing Guo Date: Sat, 9 Dec 2023 22:13:08 +0000 Subject: [PATCH 116/145] tree_decomposition.pyx: Allow returning directed nice tree decomp; fix bugs in #36843 --- .../tree_decomposition.pyx | 46 +++++++++++++++---- 1 file changed, 36 insertions(+), 10 deletions(-) diff --git a/src/sage/graphs/graph_decompositions/tree_decomposition.pyx b/src/sage/graphs/graph_decompositions/tree_decomposition.pyx index f1ebec67af7..2d088395050 100644 --- a/src/sage/graphs/graph_decompositions/tree_decomposition.pyx +++ b/src/sage/graphs/graph_decompositions/tree_decomposition.pyx @@ -852,6 +852,22 @@ def make_nice_tree_decomposition(graph, tree_decomp): sage: bip_one_four_TD = bip_one_four.treewidth(certificate=True) sage: make_nice_tree_decomposition(bip_one_four, bip_one_four_TD) Nice tree decomposition of Tree decomposition: Graph on 15 vertices + + The following two examples are for testing GitHub Issue 36843:: + + sage: from sage.graphs.graph_decompositions.tree_decomposition import make_nice_tree_decomposition + sage: triangle = graphs.CompleteGraph(3) + sage: triangle_TD = triangle.treewidth(certificate=True) + sage: make_nice_tree_decomposition(triangle, triangle_TD) + Nice tree decomposition of Tree decomposition: Graph on 7 vertices + + :: + + sage: from sage.graphs.graph_decompositions.tree_decomposition import make_nice_tree_decomposition + sage: graph = graphs.CompleteBipartiteGraph(2, 5) + sage: graph_TD = graph.treewidth(certificate=True) + sage: make_nice_tree_decomposition(graph, graph_TD) + Nice tree decomposition of Tree decomposition: Graph on 25 vertices """ if not is_valid_tree_decomposition(graph, tree_decomp): raise ValueError("input must be a valid tree decomposition for this graph") @@ -863,11 +879,19 @@ def make_nice_tree_decomposition(graph, tree_decomp): # Step 1: Ensure the tree is directed and has a root # Choose a root and orient the edges from root-to-leaves direction - leaves = [u for u in tree_decomp if tree_decomp.degree(u) == 1] - root = leaves.pop() + # + # Testing <= 1 for the special case when one bag containing all vertices + leaves = [u for u in tree_decomp if tree_decomp.degree(u) <= 1] + from sage.graphs.digraph import DiGraph - directed_tree = DiGraph(tree_decomp.breadth_first_search(start=root, edges=True), - format='list_of_edges') + if len(leaves) == 1: + root = leaves[0] + directed_tree = DiGraph(tree_decomp) + else: + root = leaves.pop() + + directed_tree = DiGraph(tree_decomp.breadth_first_search(start=root, edges=True), + format='list_of_edges') # Relabel the graph in range (0, |tree_decomp| - 1) bags_to_int = directed_tree.relabel(inplace=True, return_map=True) @@ -904,7 +928,7 @@ def make_nice_tree_decomposition(graph, tree_decomp): children = directed_tree.neighbors_out(ui) children.pop() # one vertex remains a child of ui - directed_tree.delete_edges((ui, vi) for v in children) + directed_tree.delete_edges((ui, vi) for vi in children) new_nodes = [directed_tree.add_vertex() for _ in range(len(children) - 1)] @@ -1011,7 +1035,7 @@ def make_nice_tree_decomposition(graph, tree_decomp): return nice_tree_decomp -def label_nice_tree_decomposition(nice_TD, root): +def label_nice_tree_decomposition(nice_TD, root, directed=False): r""" Return a nice tree decomposition with nodes labelled accordingly. @@ -1021,6 +1045,8 @@ def label_nice_tree_decomposition(nice_TD, root): - ``root`` -- the root of the nice tree decomposition + - ``directed`` -- boolean (default: ``False``); whether to return the directed graph + OUTPUT: A nice tree decomposition with nodes labelled. @@ -1035,7 +1061,7 @@ def label_nice_tree_decomposition(nice_TD, root): sage: label_TD = label_nice_tree_decomposition(nice_TD, root) sage: for node in sorted(label_TD): ....: print(node, label_TD.get_vertex(node)) - (0, {}) root + (0, {}) forget (1, {0}) forget (2, {0, 1}) intro (3, {0}) forget @@ -1064,9 +1090,7 @@ def label_nice_tree_decomposition(nice_TD, root): in_deg = directed_TD.in_degree(node) out_deg = directed_TD.out_degree(node) - if in_deg == 0: - directed_TD.set_vertex(node, 'root') - elif out_deg == 2: + if out_deg == 2: directed_TD.set_vertex(node, 'join') elif out_deg == 1: current_bag = node[1] @@ -1079,6 +1103,8 @@ def label_nice_tree_decomposition(nice_TD, root): else: directed_TD.set_vertex(node, 'leaf') + if directed: + return directed_TD return Graph(directed_TD, name=nice_TD.name()) From 270bd4836b9280ee45a3dcaa8e57eab32ca10b0c Mon Sep 17 00:00:00 2001 From: Jing Guo Date: Sun, 10 Dec 2023 11:46:41 +0000 Subject: [PATCH 117/145] tree_decomposition.pyx: Add tests for small simple graphs; change docstring --- .../tree_decomposition.pyx | 40 ++++++++++++++++--- 1 file changed, 35 insertions(+), 5 deletions(-) diff --git a/src/sage/graphs/graph_decompositions/tree_decomposition.pyx b/src/sage/graphs/graph_decompositions/tree_decomposition.pyx index 2d088395050..aa55e0d201b 100644 --- a/src/sage/graphs/graph_decompositions/tree_decomposition.pyx +++ b/src/sage/graphs/graph_decompositions/tree_decomposition.pyx @@ -817,6 +817,7 @@ def make_nice_tree_decomposition(graph, tree_decomp): INPUT: - ``graph`` -- a Sage graph + - ``tree_decomp`` -- a tree decomposition OUTPUT: @@ -853,7 +854,7 @@ def make_nice_tree_decomposition(graph, tree_decomp): sage: make_nice_tree_decomposition(bip_one_four, bip_one_four_TD) Nice tree decomposition of Tree decomposition: Graph on 15 vertices - The following two examples are for testing GitHub Issue 36843:: + Check that :issue:`36843` is fixed:: sage: from sage.graphs.graph_decompositions.tree_decomposition import make_nice_tree_decomposition sage: triangle = graphs.CompleteGraph(3) @@ -868,6 +869,30 @@ def make_nice_tree_decomposition(graph, tree_decomp): sage: graph_TD = graph.treewidth(certificate=True) sage: make_nice_tree_decomposition(graph, graph_TD) Nice tree decomposition of Tree decomposition: Graph on 25 vertices + + :: + + sage: from sage.graphs.graph_decompositions.tree_decomposition import make_nice_tree_decomposition + sage: empty_graph = graphs.EmptyGraph() + sage: tree_decomp = empty_graph.treewidth(certificate=True) + sage: len(make_nice_tree_decomposition(empty_graph, tree_decomp)) + 0 + + :: + + sage: from sage.graphs.graph_decompositions.tree_decomposition import make_nice_tree_decomposition + sage: singleton = graphs.CompleteGraph(1) + sage: tree_decomp = singleton.treewidth(certificate=True) + sage: make_nice_tree_decomposition(singleton, tree_decomp) + Nice tree decomposition of Tree decomposition: Graph on 3 vertices + + :: + + sage: from sage.graphs.graph_decompositions.tree_decomposition import make_nice_tree_decomposition + sage: an_edge = graphs.CompleteGraph(2) + sage: tree_decomp = an_edge.treewidth(certificate=True) + sage: make_nice_tree_decomposition(an_edge, tree_decomp) + Nice tree decomposition of Tree decomposition: Graph on 5 vertices """ if not is_valid_tree_decomposition(graph, tree_decomp): raise ValueError("input must be a valid tree decomposition for this graph") @@ -1035,6 +1060,7 @@ def make_nice_tree_decomposition(graph, tree_decomp): return nice_tree_decomp + def label_nice_tree_decomposition(nice_TD, root, directed=False): r""" Return a nice tree decomposition with nodes labelled accordingly. @@ -1045,7 +1071,9 @@ def label_nice_tree_decomposition(nice_TD, root, directed=False): - ``root`` -- the root of the nice tree decomposition - - ``directed`` -- boolean (default: ``False``); whether to return the directed graph + - ``directed`` -- boolean (default: ``False``); whether to return the nice + tree decomposition as a directed graph rooted at vertex ``root`` or as an + undirected graph OUTPUT: @@ -1058,7 +1086,9 @@ def label_nice_tree_decomposition(nice_TD, root, directed=False): sage: bip_one_four_TD = bip_one_four.treewidth(certificate=True) sage: nice_TD = make_nice_tree_decomposition(bip_one_four, bip_one_four_TD) sage: root = sorted(nice_TD.vertices())[0] - sage: label_TD = label_nice_tree_decomposition(nice_TD, root) + sage: label_TD = label_nice_tree_decomposition(nice_TD, root, directed=True) + sage: print(label_TD.name()) + Labelled Nice tree decomposition of Tree decomposition sage: for node in sorted(label_TD): ....: print(node, label_TD.get_vertex(node)) (0, {}) forget @@ -1081,13 +1111,13 @@ def label_nice_tree_decomposition(nice_TD, root, directed=False): from sage.graphs.graph import Graph directed_TD = DiGraph(nice_TD.breadth_first_search(start=root, edges=True), - format='list_of_edges') + format='list_of_edges', + name='Labelled {}'.format(nice_TD)) # The loop starts from the root node # We assume the tree decomposition is valid and nice, # hence saving time on checking. for node in directed_TD: - in_deg = directed_TD.in_degree(node) out_deg = directed_TD.out_degree(node) if out_deg == 2: From cc81342dfbcdf401b452ff025cab3c3342cd7eeb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Chapoton?= Date: Sun, 10 Dec 2023 15:12:59 +0100 Subject: [PATCH 118/145] various details in group (ruff and pycodestyle) --- src/sage/groups/abelian_gps/abelian_group.py | 6 +++--- .../groups/abelian_gps/abelian_group_morphism.py | 4 ++-- src/sage/groups/additive_abelian/qmodnz.py | 2 +- src/sage/groups/affine_gps/group_element.py | 1 - src/sage/groups/artin.py | 1 - src/sage/groups/braid.py | 5 ++--- src/sage/groups/conjugacy_classes.py | 1 - src/sage/groups/cubic_braid.py | 4 ++-- src/sage/groups/finitely_presented.py | 8 ++++---- src/sage/groups/fqf_orthogonal.py | 2 +- src/sage/groups/free_group.py | 8 ++++---- src/sage/groups/galois_group.py | 4 ++-- src/sage/groups/generic.py | 6 +++--- src/sage/groups/indexed_free_group.py | 2 +- src/sage/groups/libgap_mixin.py | 8 ++++---- src/sage/groups/matrix_gps/linear.py | 4 ++-- src/sage/groups/matrix_gps/orthogonal.py | 8 ++++---- src/sage/groups/matrix_gps/symplectic.py | 4 ++-- src/sage/groups/matrix_gps/unitary.py | 4 ++-- src/sage/groups/perm_gps/cubegroup.py | 2 +- src/sage/groups/perm_gps/permgroup.py | 16 ++++++++-------- src/sage/groups/perm_gps/permgroup_named.py | 6 +++--- .../semimonomial_transformation_group.py | 2 +- 23 files changed, 52 insertions(+), 56 deletions(-) diff --git a/src/sage/groups/abelian_gps/abelian_group.py b/src/sage/groups/abelian_gps/abelian_group.py index 121cf7524db..f2e79c92353 100644 --- a/src/sage/groups/abelian_gps/abelian_group.py +++ b/src/sage/groups/abelian_gps/abelian_group.py @@ -1387,11 +1387,11 @@ def number_of_subgroups(self, order=None): sylow_types = defaultdict(list) for p, e in primary_factors: sylow_types[p].append(e) - subgroups_orders_kwds = dict() + subgroups_orders_kwds = {} if order is None: for p, p_exps in sylow_types.items(): - subgroups_orders_kwds[p] = dict(max_sum=sum(p_exps)) + subgroups_orders_kwds[p] = {'max_sum': sum(p_exps)} else: order = Integer(order) if order < 1: @@ -1403,7 +1403,7 @@ def number_of_subgroups(self, order=None): for p in (set(sylow_types) - set(order_exps)): del sylow_types[p] for p in sylow_types: - subgroups_orders_kwds[p] = dict(n=order_exps[p]) + subgroups_orders_kwds[p] = {'n': order_exps[p]} result = Integer(1) for p, p_exps in sylow_types.items(): diff --git a/src/sage/groups/abelian_gps/abelian_group_morphism.py b/src/sage/groups/abelian_gps/abelian_group_morphism.py index 718a0d50f57..e56b1c68afd 100644 --- a/src/sage/groups/abelian_gps/abelian_group_morphism.py +++ b/src/sage/groups/abelian_gps/abelian_group_morphism.py @@ -133,8 +133,8 @@ def _libgap_(self): sage: libgap(phi) [ f1, f2 ] -> [ f1*f4, f2 ] """ - G = libgap(self.domain()) - H = libgap(self.codomain()) + G = libgap(self.domain()) + H = libgap(self.codomain()) in_G = [libgap(g) for g in self.domaingens] in_H = [libgap(h) for h in self.codomaingens] return G.GroupHomomorphismByImages(H, in_G, in_H) diff --git a/src/sage/groups/additive_abelian/qmodnz.py b/src/sage/groups/additive_abelian/qmodnz.py index 6fdb3838fd2..db0b23d5fe4 100644 --- a/src/sage/groups/additive_abelian/qmodnz.py +++ b/src/sage/groups/additive_abelian/qmodnz.py @@ -180,7 +180,7 @@ def some_elements(self): sage: len(L) 92 """ - return list(set(self(x) for x in QQ.some_elements())) + return list({self(x) for x in QQ.some_elements()}) def random_element(self): r""" diff --git a/src/sage/groups/affine_gps/group_element.py b/src/sage/groups/affine_gps/group_element.py index 74d8b684bbb..52fbe9365d6 100644 --- a/src/sage/groups/affine_gps/group_element.py +++ b/src/sage/groups/affine_gps/group_element.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- r""" Elements of Affine Groups diff --git a/src/sage/groups/artin.py b/src/sage/groups/artin.py index 959744eea57..2b2f604a462 100644 --- a/src/sage/groups/artin.py +++ b/src/sage/groups/artin.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ Artin Groups diff --git a/src/sage/groups/braid.py b/src/sage/groups/braid.py index 8d6c062bd63..18d95ef86f2 100644 --- a/src/sage/groups/braid.py +++ b/src/sage/groups/braid.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ Braid groups @@ -2068,7 +2067,7 @@ def reverse(self): sage: br.is_conjugated(b) False """ - t = [i for i in self.Tietze()] + t = list(self.Tietze()) t.reverse() return self.parent()(tuple(t)) @@ -2842,7 +2841,7 @@ def _links_gould_representation(self, symbolics=False): # quantum trace operator on two fold tensor space E = mu.parent().one() mu2 = E.tensor_product(mu) - return tuple([[R, RI], mu2]) + return ([R, RI], mu2) from sage.matrix.matrix_space import MatrixSpace Ed = MatrixSpace(BR, d, d, sparse=sparse).one() diff --git a/src/sage/groups/conjugacy_classes.py b/src/sage/groups/conjugacy_classes.py index 4ad8200ef23..147cc803842 100644 --- a/src/sage/groups/conjugacy_classes.py +++ b/src/sage/groups/conjugacy_classes.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- r""" Conjugacy classes of groups diff --git a/src/sage/groups/cubic_braid.py b/src/sage/groups/cubic_braid.py index debecbc0ba1..9b12d8b9cfa 100644 --- a/src/sage/groups/cubic_braid.py +++ b/src/sage/groups/cubic_braid.py @@ -868,7 +868,7 @@ def degrees(self): raise TypeError('not a finite reflection group') if self.strands() > 5: raise TypeError('not a finite reflection group') - d_table = {1: tuple(), 2: (3,), 3: (4, 6), + d_table = {1: (), 2: (3,), 3: (4, 6), 4: (6, 9, 12), 5: (12, 18, 24, 30)} return tuple(Integer(deg) for deg in d_table[self.strands()]) @@ -887,7 +887,7 @@ def codegrees(self): raise TypeError('not a finite reflection group') if self.strands() > 5: raise TypeError('not a finite reflection group') - d_table = {1: tuple(), 2: (0,), 3: (0, 2), + d_table = {1: (), 2: (0,), 3: (0, 2), 4: (0, 3, 6), 5: (0, 6, 12, 18)} return tuple(Integer(deg) for deg in d_table[self.strands()]) diff --git a/src/sage/groups/finitely_presented.py b/src/sage/groups/finitely_presented.py index a351e544ce7..07eabcd25b4 100644 --- a/src/sage/groups/finitely_presented.py +++ b/src/sage/groups/finitely_presented.py @@ -263,7 +263,7 @@ def __reduce__(self): (Finitely presented group < a, b, c | a*b*c*a^-1*c^-1*b^-1, a*b*c*b^-1*a^-1*c^-1 >, ((1, 2, 3),)) """ - return (self.parent(), tuple([self.Tietze()])) + return (self.parent(), (self.Tietze(),)) def _repr_(self): """ @@ -1830,7 +1830,7 @@ def characteristic_varieties(self, ring=QQ, matrix_ideal=None, groebner=False): S = R.polynomial_ring() K = R.base_ring() id_rels = R.ideal(rels) - res = dict() + res = {} bound = n + 1 for j in range(bound + 1): J = id_rels + A.fitting_ideal(j) @@ -1847,7 +1847,7 @@ def characteristic_varieties(self, ring=QQ, matrix_ideal=None, groebner=False): return res if R.ngens() == 1: res = {j: gcd(S(p) for p in res[j].gens()) for j in range(bound + 1)} - char_var = dict() + char_var = {} strict = True j = 0 while strict and j <= bound: @@ -1862,7 +1862,7 @@ def characteristic_varieties(self, ring=QQ, matrix_ideal=None, groebner=False): strict = False j += 1 return char_var - char_var = dict() + char_var = {} strict = True j = 0 while strict and j <= bound: diff --git a/src/sage/groups/fqf_orthogonal.py b/src/sage/groups/fqf_orthogonal.py index 3d0c79ed7c3..24dcb5412db 100644 --- a/src/sage/groups/fqf_orthogonal.py +++ b/src/sage/groups/fqf_orthogonal.py @@ -549,7 +549,7 @@ def orbits(G, L): # separating the different primes here would speed things up b_cand = [[b for b in B if b.q() == a.q() and b.order() == a.order()] for a in A.smith_form_gens()] - G = B.orthogonal_group(tuple()) + G = B.orthogonal_group(()) ambient = G.ambient() waiting = [[]] while len(waiting) > 0: diff --git a/src/sage/groups/free_group.py b/src/sage/groups/free_group.py index 6f3c4400779..5bc575ae264 100644 --- a/src/sage/groups/free_group.py +++ b/src/sage/groups/free_group.py @@ -148,7 +148,7 @@ def _lexi_gen(zeroes=False): """ count = Integer(0) while True: - mwrap, ind = count.quo_rem(26) + mwrap, ind = count.quo_rem(26) if mwrap == 0 and not zeroes: name = '' else: @@ -505,12 +505,12 @@ def syllables(self): """ g = self.gap().UnderlyingElement() k = g.NumberSyllables().sage() - exponent_syllable = libgap.eval('ExponentSyllable') + exponent_syllable = libgap.eval('ExponentSyllable') generator_syllable = libgap.eval('GeneratorSyllable') result = [] gen = self.parent().gen for i in range(k): - exponent = exponent_syllable(g, i+1).sage() + exponent = exponent_syllable(g, i+1).sage() generator = gen(generator_syllable(g, i+1).sage() - 1) result.append( (generator, exponent) ) return tuple(result) @@ -880,7 +880,7 @@ def _element_constructor_(self, *args, **kwds): except AttributeError: return self.element_class(self, x, **kwds) if isinstance(P, FreeGroup_class): - names = set(P._names[abs(i)-1] for i in x.Tietze()) + names = {P._names[abs(i)-1] for i in x.Tietze()} if names.issubset(self._names): return self([i.sign()*(self._names.index(P._names[abs(i)-1])+1) for i in x.Tietze()]) diff --git a/src/sage/groups/galois_group.py b/src/sage/groups/galois_group.py index ed9e6d61bd4..5a48380eb21 100644 --- a/src/sage/groups/galois_group.py +++ b/src/sage/groups/galois_group.py @@ -470,7 +470,7 @@ def _domain_to_gap(self): sage: G._domain_to_gap[5] # needs sage.rings.number_field 5 """ - return dict((key, i+1) for i, key in enumerate(self._domain)) + return {key: i+1 for i, key in enumerate(self._domain)} @lazy_attribute def _domain_from_gap(self): @@ -485,7 +485,7 @@ def _domain_from_gap(self): sage: G._domain_from_gap[20] # needs sage.rings.number_field 20 """ - return dict((i+1, key) for i, key in enumerate(self._domain)) + return {i+1: key for i, key in enumerate(self._domain)} def ngens(self): r""" diff --git a/src/sage/groups/generic.py b/src/sage/groups/generic.py index 17deee71ef6..69bffca1b9f 100644 --- a/src/sage/groups/generic.py +++ b/src/sage/groups/generic.py @@ -486,7 +486,7 @@ def bsgs(a, b, bounds, operation='*', identity=None, inverse=None, op=None): raise ValueError("no solution in bsgs()") m = ran.isqrt() + 1 # we need sqrt(ran) rounded up - table = dict() # will hold pairs (a^(lb+i),lb+i) for i in range(m) + table = {} # will hold pairs (a^(lb+i),lb+i) for i in range(m) d = c for i0 in xsrange(m): @@ -1041,7 +1041,7 @@ def discrete_log_lambda(a, base, bounds, operation='*', identity=None, inverse=N width = Integer(ub - lb) N = width.isqrt() + 1 - M = dict() + M = {} for s in range(10): # to avoid infinite loops # random walk function setup k = 0 @@ -1060,7 +1060,7 @@ def discrete_log_lambda(a, base, bounds, operation='*', identity=None, inverse=N c += r if mut: H.set_immutable() - mem = set([H]) + mem = {H} # second random walk H = a d = 0 diff --git a/src/sage/groups/indexed_free_group.py b/src/sage/groups/indexed_free_group.py index 287ab021b1d..79be1df663d 100644 --- a/src/sage/groups/indexed_free_group.py +++ b/src/sage/groups/indexed_free_group.py @@ -363,7 +363,7 @@ def _element_constructor_(self, x=None): 1 """ if isinstance(x, (list, tuple)): - d = dict() + d = {} for k, v in x: if k in d: d[k] += v diff --git a/src/sage/groups/libgap_mixin.py b/src/sage/groups/libgap_mixin.py index e2da04e9ed3..3bb5d68e36f 100644 --- a/src/sage/groups/libgap_mixin.py +++ b/src/sage/groups/libgap_mixin.py @@ -764,12 +764,12 @@ def character_table(self): """ #code from function in permgroup.py, but modified for #how gap handles these groups. - G = self._gap_() - cl = self.conjugacy_classes() + G = self._gap_() + cl = self.conjugacy_classes() from sage.rings.integer import Integer - n = Integer(len(cl)) + n = Integer(len(cl)) irrG = G.Irr() - ct = [[irrG[i][j] for j in range(n)] for i in range(n)] + ct = [[irrG[i][j] for j in range(n)] for i in range(n)] from sage.rings.number_field.number_field import CyclotomicField e = irrG.Flat().Conductor() diff --git a/src/sage/groups/matrix_gps/linear.py b/src/sage/groups/matrix_gps/linear.py index d13904dec51..65a8c13645c 100644 --- a/src/sage/groups/matrix_gps/linear.py +++ b/src/sage/groups/matrix_gps/linear.py @@ -253,14 +253,14 @@ def SL(n, R, var='a'): except AttributeError: cat = Groups() name = 'Special Linear Group of degree {0} over {1}'.format(degree, ring) - ltx = 'SL({0}, {1})'.format(degree, latex(ring)) + ltx = 'SL({0}, {1})'.format(degree, latex(ring)) try: from .linear_gap import LinearMatrixGroup_gap except ImportError: pass else: try: - cmd = 'SL({0}, {1})'.format(degree, ring._gap_init_()) + cmd = 'SL({0}, {1})'.format(degree, ring._gap_init_()) return LinearMatrixGroup_gap(degree, ring, True, name, ltx, cmd, category=cat) except ValueError: diff --git a/src/sage/groups/matrix_gps/orthogonal.py b/src/sage/groups/matrix_gps/orthogonal.py index c91560f77c7..9e90d3ac0dc 100644 --- a/src/sage/groups/matrix_gps/orthogonal.py +++ b/src/sage/groups/matrix_gps/orthogonal.py @@ -195,15 +195,15 @@ def _OG(n, R, special, e=0, var='a', invariant_form=None): name = '{0} Orthogonal Group of degree {1} over {2} {3}\n{4}'.format( prefix, degree, ring, inserted_text,invariant_form) - ltx = r'\text{{{0}O}}_{{{1}}}({2})\text{{ {3} }}{4}'.format( + ltx = r'\text{{{0}O}}_{{{1}}}({2})\text{{ {3} }}{4}'.format( ltx_prefix, degree, latex(ring), inserted_text, latex(invariant_form)) else: name = '{0} Orthogonal Group of degree {1} over {2}'.format(prefix, degree, ring) - ltx = r'\text{{{0}O}}_{{{1}}}({2})'.format(ltx_prefix, degree, latex(ring)) + ltx = r'\text{{{0}O}}_{{{1}}}({2})'.format(ltx_prefix, degree, latex(ring)) else: name = '{0} Orthogonal Group of degree {1} and form parameter {2} over {3}'.format(prefix, degree, e, ring) - ltx = r'\text{{{0}O}}_{{{1}}}({2}, {3})'.format(ltx_prefix, degree, + ltx = r'\text{{{0}O}}_{{{1}}}({2}, {3})'.format(ltx_prefix, degree, latex(ring), '+' if e == 1 else '-') @@ -517,7 +517,7 @@ def invariant_bilinear_form(self): return m invariant_quadratic_form = invariant_bilinear_form # this is identical in the generic case - invariant_form = invariant_bilinear_form # alias (analogues to symplectic and unitary cases) + invariant_form = invariant_bilinear_form # alias (analogues to symplectic and unitary cases) def _check_matrix(self, x, *args): """a diff --git a/src/sage/groups/matrix_gps/symplectic.py b/src/sage/groups/matrix_gps/symplectic.py index 3a7e7258fe9..e0f3324b645 100644 --- a/src/sage/groups/matrix_gps/symplectic.py +++ b/src/sage/groups/matrix_gps/symplectic.py @@ -155,11 +155,11 @@ def Sp(n, R, var='a', invariant_form=None): name = 'Symplectic Group of degree {0} over {1} with respect to alternating bilinear form\n{2}'.format( degree, ring, invariant_form) - ltx = r'\text{{Sp}}_{{{0}}}({1})\text{{ with respect to alternating bilinear form}}{2}'.format( + ltx = r'\text{{Sp}}_{{{0}}}({1})\text{{ with respect to alternating bilinear form}}{2}'.format( degree, latex(ring), latex(invariant_form)) else: name = 'Symplectic Group of degree {0} over {1}'.format(degree, ring) - ltx = r'\text{{Sp}}_{{{0}}}({1})'.format(degree, latex(ring)) + ltx = r'\text{{Sp}}_{{{0}}}({1})'.format(degree, latex(ring)) try: from .symplectic_gap import SymplecticMatrixGroup_gap diff --git a/src/sage/groups/matrix_gps/unitary.py b/src/sage/groups/matrix_gps/unitary.py index 4fbb1f1e74f..ed6221cb61d 100644 --- a/src/sage/groups/matrix_gps/unitary.py +++ b/src/sage/groups/matrix_gps/unitary.py @@ -131,11 +131,11 @@ def _UG(n, R, special, var='a', invariant_form=None): name = '{0} Unitary Group of degree {1} over {2} {3}\n{4}'.format(prefix, degree, ring, inserted_text, invariant_form) - ltx = r'\text{{{0}U}}_{{{1}}}({2})\text{{ {3} }}{4}'.format(latex_prefix, + ltx = r'\text{{{0}U}}_{{{1}}}({2})\text{{ {3} }}{4}'.format(latex_prefix, degree, latex(ring), inserted_text, latex(invariant_form)) else: name = '{0} Unitary Group of degree {1} over {2}'.format(prefix, degree, ring) - ltx = r'\text{{{0}U}}_{{{1}}}({2})'.format(latex_prefix, degree, latex(ring)) + ltx = r'\text{{{0}U}}_{{{1}}}({2})'.format(latex_prefix, degree, latex(ring)) if isinstance(ring, FiniteField): try: diff --git a/src/sage/groups/perm_gps/cubegroup.py b/src/sage/groups/perm_gps/cubegroup.py index 134c018d3c4..0b40ba3bc78 100644 --- a/src/sage/groups/perm_gps/cubegroup.py +++ b/src/sage/groups/perm_gps/cubegroup.py @@ -1011,7 +1011,7 @@ def plot3d_cube(self, mv, title=True): P.axes(show=False) if title: t1 = text('Up, Front, and Right faces. ' , (-0.2, -2.5)) - t2 = text(' sagemath.org', (0.8, -3.1),rgbcolor=lgrey) + t2 = text(' sagemath.org', (0.8, -3.1),rgbcolor=lgrey) t3 = text(" ", (3.5, 0), rgbcolor=white) P = P + t1 + t2 + t3 P.axes(show=False) diff --git a/src/sage/groups/perm_gps/permgroup.py b/src/sage/groups/perm_gps/permgroup.py index b0083394cb0..9eff50ce4ce 100644 --- a/src/sage/groups/perm_gps/permgroup.py +++ b/src/sage/groups/perm_gps/permgroup.py @@ -498,7 +498,7 @@ def __init__(self, gens=None, gap_group=None, canonicalize=True, # Handle the case where only the GAP group is specified. if gens is None: - gens = [gen for gen in gap_group.GeneratorsOfGroup()] + gens = list(gap_group.GeneratorsOfGroup()) if domain is None: gens = [standardize_generator(x, as_cycles=True) for x in gens] @@ -524,8 +524,8 @@ def __init__(self, gens=None, gap_group=None, canonicalize=True, self._domain = domain self._deg = len(self._domain) - self._domain_to_gap = dict((key, i+1) for i, key in enumerate(self._domain)) - self._domain_from_gap = dict((i+1, key) for i, key in enumerate(self._domain)) + self._domain_to_gap = {key: i+1 for i, key in enumerate(self._domain)} + self._domain_from_gap = {i+1: key for i, key in enumerate(self._domain)} if not gens: # length 0 gens = [()] @@ -1043,7 +1043,7 @@ def list(self): sage: G.list() [(), (1,2)] """ - return [x for x in self] + return list(self) def __contains__(self, item): """ @@ -3446,11 +3446,11 @@ def character_table(self): - David Joyner and William Stein (2006-01-04) """ - G = self._libgap_() - cl = G.ConjugacyClasses() - n = Integer(cl.Length()) + G = self._libgap_() + cl = G.ConjugacyClasses() + n = Integer(cl.Length()) irrG = G.Irr() - ct = [[irrG[i, j] for j in range(n)] for i in range(n)] + ct = [[irrG[i, j] for j in range(n)] for i in range(n)] from sage.rings.number_field.number_field import CyclotomicField e = irrG.Flat().Conductor() diff --git a/src/sage/groups/perm_gps/permgroup_named.py b/src/sage/groups/perm_gps/permgroup_named.py index f34ee9fcd21..222ee36f6da 100644 --- a/src/sage/groups/perm_gps/permgroup_named.py +++ b/src/sage/groups/perm_gps/permgroup_named.py @@ -1390,14 +1390,14 @@ def __init__(self, factors): # abelian group for i in range(1, (a//2)+1): if i != a-i: - genx.append(tuple((jumppoint+i, jumppoint+a-i))) + genx.append((jumppoint+i, jumppoint+a-i)) jumppoint = jumppoint + a # If all of the direct factors are C2, then the action turning # each element into its inverse is trivial, and the # semi-direct product becomes a direct product, so we simply # tack on another disjoint transposition if all(x == 2 for x in simplified): - genx.append(tuple((jumppoint, jumppoint+1))) + genx.append((jumppoint, jumppoint+1)) gens.append(genx) PermutationGroup_generic.__init__(self, gens=gens) @@ -1492,7 +1492,7 @@ def __init__(self, n): gens = ((1, 2), (3, 4)) else: gen1 = tuple((i, n - i + 1) for i in range(1, n // 2 + 1)) - gens = tuple([tuple(gen0), gen1]) + gens = (tuple(gen0), gen1) PermutationGroup_generic.__init__(self, gens) diff --git a/src/sage/groups/semimonomial_transformations/semimonomial_transformation_group.py b/src/sage/groups/semimonomial_transformations/semimonomial_transformation_group.py index 40bbed2c6bb..e61c7bf64c7 100644 --- a/src/sage/groups/semimonomial_transformations/semimonomial_transformation_group.py +++ b/src/sage/groups/semimonomial_transformations/semimonomial_transformation_group.py @@ -266,7 +266,7 @@ def _an_element_(self): """ R = self.base_ring() v = [R.primitive_element()] + [R.one()] * (self.degree() - 1) - p = Permutation([self.degree()] + [i for i in range(1, self.degree())]) + p = Permutation([self.degree()] + list(range(1, self.degree()))) if not R.is_prime_field(): f = R.hom([R.gen()**R.characteristic()]) From 40514468f85a80d4c89ebb04e155148ad2eddb64 Mon Sep 17 00:00:00 2001 From: Aman Date: Sun, 10 Dec 2023 21:24:40 +0530 Subject: [PATCH 119/145] corrected the test case by sorting the result --- src/sage/rings/polynomial/polynomial_element.pyx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/sage/rings/polynomial/polynomial_element.pyx b/src/sage/rings/polynomial/polynomial_element.pyx index 5a480feae26..5d61c12660f 100644 --- a/src/sage/rings/polynomial/polynomial_element.pyx +++ b/src/sage/rings/polynomial/polynomial_element.pyx @@ -8105,6 +8105,7 @@ cdef class Polynomial(CommutativePolynomial): ....: f2 = x2^3 - fld_out(2) ....: for algo in (None, 'pari', 'numpy'): ....: rts = f.roots(ring=fld_out, multiplicities=False) + ....: rts = sorted(rts, key=lambda x: (x.real(), x.imag())) ....: if fld_in == fld_out and algo is None: ....: print("{} {}".format(fld_in, rts)) ....: for rt in rts: @@ -8113,9 +8114,9 @@ cdef class Polynomial(CommutativePolynomial): Real Field with 53 bits of precision [1.25992104989487] Real Double Field [1.25992104989...] Real Field with 100 bits of precision [1.2599210498948731647672106073] - Complex Field with 53 bits of precision [1.25992104989487, -0.62996052494743... - 1.09112363597172*I, -0.62996052494743... + 1.09112363597172*I] - Complex Double Field [1.25992104989..., -0.629960524947... - 1.0911236359717...*I, -0.629960524947... + 1.0911236359717...*I] - Complex Field with 100 bits of precision [1.2599210498948731647672106073, -0.62996052494743658238360530364 - 1.0911236359717214035600726142*I, -0.62996052494743658238360530364 + 1.0911236359717214035600726142*I] + Complex Field with 53 bits of precision [-0.62996052494743... - 1.09112363597172*I, -0.62996052494743... + 1.09112363597172*I, 1.25992104989487] + Complex Double Field [-0.629960524947... - 1.0911236359717...*I, -0.629960524947... + 1.0911236359717...*I, 1.25992104989...] + Complex Field with 100 bits of precision [-0.62996052494743658238360530364 - 1.0911236359717214035600726142*I, -0.62996052494743658238360530364 + 1.0911236359717214035600726142*I, 1.2599210498948731647672106073] Note that we can find the roots of a polynomial with algebraic coefficients:: From 48ee57e1b92c41f6ab35c5b0839d0225d0cf2aa2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Chapoton?= Date: Sun, 10 Dec 2023 17:53:48 +0100 Subject: [PATCH 120/145] various details in algebras (ruff mostly) --- src/sage/algebras/clifford_algebra.py | 12 ++++---- src/sage/algebras/cluster_algebra.py | 4 +-- src/sage/algebras/free_algebra.py | 2 +- src/sage/algebras/fusion_rings/f_matrix.py | 20 ++++++------- .../algebras/fusion_rings/fusion_double.py | 4 +-- src/sage/algebras/fusion_rings/fusion_ring.py | 8 ++--- .../hecke_algebras/cubic_hecke_algebra.py | 6 ++-- .../hecke_algebras/cubic_hecke_matrix_rep.py | 2 +- .../lie_algebras/affine_lie_algebra.py | 8 ++--- .../lie_algebras/classical_lie_algebra.py | 1 - .../algebras/lie_algebras/free_lie_algebra.py | 1 - src/sage/algebras/lie_algebras/heisenberg.py | 1 - .../rank_two_heisenberg_virasoro.py | 1 - .../lie_algebras/symplectic_derivation.py | 1 - src/sage/algebras/lie_algebras/virasoro.py | 1 - .../freely_generated_lie_conformal_algebra.py | 2 +- ..._conformal_algebra_with_structure_coefs.py | 4 +-- src/sage/algebras/orlik_solomon.py | 2 +- src/sage/algebras/orlik_terao.py | 2 +- src/sage/algebras/q_system.py | 6 ++-- .../algebras/quantum_groups/fock_space.py | 30 +++++++++---------- .../quantum_groups/quantum_group_gap.py | 2 +- src/sage/algebras/schur_algebra.py | 2 +- src/sage/algebras/splitting_algebra.py | 2 +- .../algebras/steenrod/steenrod_algebra.py | 2 +- .../steenrod/steenrod_algebra_misc.py | 2 +- src/sage/algebras/weyl_algebra.py | 6 ++-- 27 files changed, 64 insertions(+), 70 deletions(-) diff --git a/src/sage/algebras/clifford_algebra.py b/src/sage/algebras/clifford_algebra.py index ca0d6d41ee8..3b9b8ec9db6 100644 --- a/src/sage/algebras/clifford_algebra.py +++ b/src/sage/algebras/clifford_algebra.py @@ -2783,15 +2783,15 @@ def __richcmp__(self, other, op): elif op == op_GT: return other.__richcmp__(self, op_LT) - s_gens = set(g for g in self.gens() if g) - o_gens = set(g for g in other.gens() if g) + s_gens = {g for g in self.gens() if g} + o_gens = {g for g in other.gens() if g} if self.side() != other.side(): if other.side() == "right": - X = set(t * f for t in self.ring().basis() for f in s_gens) + X = {t * f for t in self.ring().basis() for f in s_gens} s_gens.update(X) elif other.side() == "left": - X = set(f * t for t in self.ring().basis() for f in s_gens) + X = {f * t for t in self.ring().basis() for f in s_gens} s_gens.update(X) if set(s_gens) == set(o_gens): @@ -2805,10 +2805,10 @@ def __richcmp__(self, other, op): if self.side() != other.side(): if self.side() == "right": - X = set(t * f for t in self.ring().basis() for f in o_gens) + X = {t * f for t in self.ring().basis() for f in o_gens} s_gens.update(X) elif self.side() == "left": - X = set(f * t for t in self.ring().basis() for f in o_gens) + X = {f * t for t in self.ring().basis() for f in o_gens} s_gens.update(X) contains = all(f in self for f in o_gens) diff --git a/src/sage/algebras/cluster_algebra.py b/src/sage/algebras/cluster_algebra.py index 6324bc235be..28c229edc09 100644 --- a/src/sage/algebras/cluster_algebra.py +++ b/src/sage/algebras/cluster_algebra.py @@ -1666,8 +1666,8 @@ def clear_computed_data(self): [(0, 1), (1, 0)] """ I = identity_matrix(self._n) - self._path_dict = dict((v, []) for v in map(tuple, I.columns())) - self._F_poly_dict = dict((v, self._U(1)) for v in self._path_dict) + self._path_dict = {v: [] for v in map(tuple, I.columns())} + self._F_poly_dict = {v: self._U(1) for v in self._path_dict} self.reset_current_seed() self.reset_exploring_iterator() diff --git a/src/sage/algebras/free_algebra.py b/src/sage/algebras/free_algebra.py index d375a68c0ae..6935bf67b23 100644 --- a/src/sage/algebras/free_algebra.py +++ b/src/sage/algebras/free_algebra.py @@ -300,7 +300,7 @@ def create_key(self, base_ring, arg1=None, arg2=None, if order is None: order = 'degrevlex' if degrees is None else 'deglex' args = [arg for arg in (arg1, arg2) if arg is not None] - kwds = dict(sparse=sparse, order=order, implementation="singular") + kwds = {'sparse': sparse, 'order': order, 'implementation': "singular"} if name is not None: kwds["name"] = name if names is not None: diff --git a/src/sage/algebras/fusion_rings/f_matrix.py b/src/sage/algebras/fusion_rings/f_matrix.py index fe39ebf72b4..47f5976cf03 100644 --- a/src/sage/algebras/fusion_rings/f_matrix.py +++ b/src/sage/algebras/fusion_rings/f_matrix.py @@ -580,8 +580,8 @@ def findcases(self, output=False): """ i = 0 if output: - idx_map = dict() - ret = dict() + idx_map = {} + ret = {} id_anyon = self._FR.one() for (a, b, c, d) in product(self._FR.basis(), repeat=4): if a == id_anyon or b == id_anyon or c == id_anyon: @@ -1053,7 +1053,7 @@ def load_fvars(self, filename): self._fvars, self._non_cyc_roots, self._coerce_map_from_cyc_field, self._qqbar_embedding = pickle.load(f) # Update state attributes self._chkpt_status = 7 - self._solved = list(True for v in self._fvars) + self._solved = [True for v in self._fvars] self._field = self._qqbar_embedding.domain() def get_fr_str(self): @@ -1675,9 +1675,9 @@ def equations_graph(self, eqns=None): for eq in eqns: # Eqns could be a list of poly objects or poly tuples stored in internal repn if isinstance(eq, tuple): - s = [v for v in variables(eq)] + s = list(variables(eq)) else: - s = [v for v in eq.variables()] + s = list(eq.variables()) for x in s: for y in s: if y != x: @@ -1765,8 +1765,8 @@ def _par_graph_gb(self, eqns=None, term_order="degrevlex", largest_comp=45, verb """ if eqns is None: eqns = self.ideal_basis - small_comps = list() - temp_eqns = list() + small_comps = [] + temp_eqns = [] for comp, comp_eqns in self._partition_eqns(eqns=eqns, verbose=verbose).items(): # Check if component is too large to process if len(comp) > largest_comp: @@ -1924,8 +1924,8 @@ def _get_explicit_solution(self, eqns=None, verbose=True): F = self._field R = F['x'] - numeric_fvars = dict() - non_cyclotomic_roots = list() + numeric_fvars = {} + non_cyclotomic_roots = [] must_change_base_field = False phi = F.hom([F.gen()], F) for comp, part in eqns_partition.items(): @@ -2270,7 +2270,7 @@ def _update_equations(self): {fx3} """ special_values = {known: self._fvars[self._var_to_sextuple[known]] for known in self._solved if known} - self.ideal_basis = set(eq.subs(special_values) for eq in self.ideal_basis) + self.ideal_basis = {eq.subs(special_values) for eq in self.ideal_basis} self.ideal_basis.discard(0) def find_cyclotomic_solution(self, equations=None, algorithm="", verbose=True, output=False): diff --git a/src/sage/algebras/fusion_rings/fusion_double.py b/src/sage/algebras/fusion_rings/fusion_double.py index 520ea96ef13..339e4a4e199 100644 --- a/src/sage/algebras/fusion_rings/fusion_double.py +++ b/src/sage/algebras/fusion_rings/fusion_double.py @@ -187,7 +187,7 @@ def __init__(self, G, prefix="s"): self._fusion_labels = None self._field = None cat = AlgebrasWithBasis(ZZ) - CombinatorialFreeModule.__init__(self, ZZ, [k for k in self._names], + CombinatorialFreeModule.__init__(self, ZZ, list(self._names), prefix=prefix, bracket=False, category=cat) def _repr_(self): @@ -433,7 +433,7 @@ def Nk_ij(self, i, j, k, use_characters=False): G = self._G I = G.conjugacy_class(i.g()) J = G.conjugacy_class(j.g()) - IJ = set(I_elem * J_elem for I_elem in I for J_elem in J) + IJ = {I_elem * J_elem for I_elem in I for J_elem in J} if k.g() not in IJ: return ZZ.zero() diff --git a/src/sage/algebras/fusion_rings/fusion_ring.py b/src/sage/algebras/fusion_rings/fusion_ring.py index 02da0032802..72bc0f8600c 100644 --- a/src/sage/algebras/fusion_rings/fusion_ring.py +++ b/src/sage/algebras/fusion_rings/fusion_ring.py @@ -1175,13 +1175,13 @@ def _get_trees(fr, top_row, root): return [[]] if fr.Nk_ij(m1, m2, root) else [] else: m1, m2 = top_row[:2] - return [tuple([l, *b]) for l in fr.basis() for b in _get_trees(fr, [l]+top_row[2:], root) if fr.Nk_ij(m1, m2, l)] + return [(l, *b) for l in fr.basis() for b in _get_trees(fr, [l]+top_row[2:], root) if fr.Nk_ij(m1, m2, l)] - comp_basis = list() + comp_basis = [] for top in product((a*a).monomials(), repeat=n_strands//2): # If the n_strands is odd, we must extend the top row by a fusing anyon top_row = list(top)+[a]*(n_strands % 2) - comp_basis.extend(tuple([*top, *levels]) for levels in _get_trees(self, top_row, b)) + comp_basis.extend((*top, *levels) for levels in _get_trees(self, top_row, b)) return comp_basis def get_fmatrix(self, *args, **kwargs): @@ -1248,7 +1248,7 @@ def _emap(self, mapper, input_args, worker_pool=None): no_mp = worker_pool is None # Map phase input_iter = zip_longest([], input_iter, fillvalue=(mapper, id(self))) - results = list() + results = [] if no_mp: mapped = map(executor, input_iter) else: diff --git a/src/sage/algebras/hecke_algebras/cubic_hecke_algebra.py b/src/sage/algebras/hecke_algebras/cubic_hecke_algebra.py index 6a336d9932c..5a3bd2ceb47 100644 --- a/src/sage/algebras/hecke_algebras/cubic_hecke_algebra.py +++ b/src/sage/algebras/hecke_algebras/cubic_hecke_algebra.py @@ -2405,7 +2405,7 @@ def _reduce_gen_power(self, k): result = result_ele.to_vector() elif abs(k) == 1: - result_ele = self._tietze_to_finite_sub_basis_monomial(tuple([k])) + result_ele = self._tietze_to_finite_sub_basis_monomial((k,)) result = result_ele.to_vector() else: @@ -2874,7 +2874,7 @@ def garside_involution(self, element): True """ braid_group = self.braid_group() - reverse_gens = [g for g in braid_group.gens()] + reverse_gens = list(braid_group.gens()) reverse_gens.reverse() brgrp_garside_involution = braid_group.hom(reverse_gens, check=False) return self._extend_braid_automorphism(element, brgrp_garside_involution) @@ -3446,7 +3446,7 @@ def schur_elements(self, generic=False): GER = self.extension_ring(generic=True) generic_result = [GER(s) for s in gap3_result] if generic: - return [s for s in generic_result] + return list(generic_result) else: ER = self.extension_ring() return [ER(s) for s in generic_result] diff --git a/src/sage/algebras/hecke_algebras/cubic_hecke_matrix_rep.py b/src/sage/algebras/hecke_algebras/cubic_hecke_matrix_rep.py index 02689e2b11c..c0587117753 100644 --- a/src/sage/algebras/hecke_algebras/cubic_hecke_matrix_rep.py +++ b/src/sage/algebras/hecke_algebras/cubic_hecke_matrix_rep.py @@ -968,7 +968,7 @@ def _image_on_basis(self, basis_element): for gen_ind in ele_Tietze: gen_matrix_list = self._image_on_gen(gen_ind) if matrix_list is None: - matrix_list = [m for m in gen_matrix_list] + matrix_list = list(gen_matrix_list) else: for i in range(len(matrix_list)): matrix_list[i] *= gen_matrix_list[i] diff --git a/src/sage/algebras/lie_algebras/affine_lie_algebra.py b/src/sage/algebras/lie_algebras/affine_lie_algebra.py index f94866cd1c6..17a14c24780 100644 --- a/src/sage/algebras/lie_algebras/affine_lie_algebra.py +++ b/src/sage/algebras/lie_algebras/affine_lie_algebra.py @@ -789,12 +789,12 @@ def build_root(O): for r in list(self._root_mapping.keys()): self._root_mapping[-r] = [-s for s in self._root_mapping[r]] if self._cartan_type.type() == 'BC': - assert set(r for r in self._root_mapping if len(self._root_mapping[r]) > 1) == set(Q.roots()) + assert {r for r in self._root_mapping if len(self._root_mapping[r]) > 1} == set(Q.roots()) if self._cartan_type.rank() == 2: # Special case since sl_2 has only 1 root length - assert set(r / 2 for r in self._root_mapping if len(self._root_mapping[r]) == 1) == set(Q.roots()) + assert {r / 2 for r in self._root_mapping if len(self._root_mapping[r]) == 1} == set(Q.roots()) else: - assert set(r / 2 for r in self._root_mapping if len(self._root_mapping[r]) == 1) == set(Q.short_roots()) + assert {r / 2 for r in self._root_mapping if len(self._root_mapping[r]) == 1} == set(Q.short_roots()) from sage.combinat.free_module import CombinatorialFreeModule X = sorted(self._root_mapping, key=str) self._g1 = CombinatorialFreeModule(R, X, prefix='E') @@ -845,7 +845,7 @@ def _test_classical_subalgebra(self, **options): if r + s in roots: tester.assertEqual(list(ret.support()), [(r+s, 0)], f"obtained [{r}, {s}] == {ret}") elif r == -s: - supp = set((ac, 0) for ac in r.associated_coroot().monomials()) + supp = {(ac, 0) for ac in r.associated_coroot().monomials()} tester.assertEqual(set(ret.support()), supp, f"obtained [{r}, {s}] == {ret}") else: tester.assertEqual(ret, self.zero(), f"nonzero for [{r}, {s}]") diff --git a/src/sage/algebras/lie_algebras/classical_lie_algebra.py b/src/sage/algebras/lie_algebras/classical_lie_algebra.py index a2bb531abe0..11900983313 100644 --- a/src/sage/algebras/lie_algebras/classical_lie_algebra.py +++ b/src/sage/algebras/lie_algebras/classical_lie_algebra.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ Classical Lie Algebras diff --git a/src/sage/algebras/lie_algebras/free_lie_algebra.py b/src/sage/algebras/lie_algebras/free_lie_algebra.py index c07a99e9e44..a0186ea7ab5 100644 --- a/src/sage/algebras/lie_algebras/free_lie_algebra.py +++ b/src/sage/algebras/lie_algebras/free_lie_algebra.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ Free Lie Algebras diff --git a/src/sage/algebras/lie_algebras/heisenberg.py b/src/sage/algebras/lie_algebras/heisenberg.py index d2f336f642c..6fbf9e72675 100644 --- a/src/sage/algebras/lie_algebras/heisenberg.py +++ b/src/sage/algebras/lie_algebras/heisenberg.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ Heisenberg Algebras diff --git a/src/sage/algebras/lie_algebras/rank_two_heisenberg_virasoro.py b/src/sage/algebras/lie_algebras/rank_two_heisenberg_virasoro.py index d8ede1be6dd..127f1f8eb4a 100644 --- a/src/sage/algebras/lie_algebras/rank_two_heisenberg_virasoro.py +++ b/src/sage/algebras/lie_algebras/rank_two_heisenberg_virasoro.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- r""" Rank Two Heisenberg-Virasoro Algebras diff --git a/src/sage/algebras/lie_algebras/symplectic_derivation.py b/src/sage/algebras/lie_algebras/symplectic_derivation.py index afaf5561b80..f9a2e483330 100644 --- a/src/sage/algebras/lie_algebras/symplectic_derivation.py +++ b/src/sage/algebras/lie_algebras/symplectic_derivation.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- r""" Symplectic Derivation Lie Algebras diff --git a/src/sage/algebras/lie_algebras/virasoro.py b/src/sage/algebras/lie_algebras/virasoro.py index 16589b60391..297ccf184a8 100644 --- a/src/sage/algebras/lie_algebras/virasoro.py +++ b/src/sage/algebras/lie_algebras/virasoro.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ Virasoro Algebra and Related Lie Algebras diff --git a/src/sage/algebras/lie_conformal_algebras/freely_generated_lie_conformal_algebra.py b/src/sage/algebras/lie_conformal_algebras/freely_generated_lie_conformal_algebra.py index b26d0bb4ca0..9a6a74a62bb 100644 --- a/src/sage/algebras/lie_conformal_algebras/freely_generated_lie_conformal_algebra.py +++ b/src/sage/algebras/lie_conformal_algebras/freely_generated_lie_conformal_algebra.py @@ -61,7 +61,7 @@ def __init__(self, R, index_set=None, central_elements=None, category=None, if central_elements is not None: self._central_elements = Family(central_elements) else: - self._central_elements = tuple() + self._central_elements = () def lie_conformal_algebra_generators(self): """ diff --git a/src/sage/algebras/lie_conformal_algebras/lie_conformal_algebra_with_structure_coefs.py b/src/sage/algebras/lie_conformal_algebras/lie_conformal_algebra_with_structure_coefs.py index 3c4252ce905..e56ad62fad0 100644 --- a/src/sage/algebras/lie_conformal_algebras/lie_conformal_algebra_with_structure_coefs.py +++ b/src/sage/algebras/lie_conformal_algebras/lie_conformal_algebra_with_structure_coefs.py @@ -146,7 +146,7 @@ def _standardize_s_coeff(s_coeff, index_set, ce, parity=None): """ if parity is None: parity = (0,)*index_set.cardinality() - index_to_parity = {i:p for (i,p) in zip(index_set,parity)} + index_to_parity = dict(zip(index_set,parity)) sc = {} #mypair has a pair of generators for mypair in s_coeff.keys(): @@ -215,7 +215,7 @@ def __init__(self, R, s_coeff, index_set=None, central_elements=None, """ names, index_set = standardize_names_index_set(names,index_set) if central_elements is None: - central_elements = tuple() + central_elements = () if names is not None and names != tuple(index_set): names2 = names + tuple(central_elements) diff --git a/src/sage/algebras/orlik_solomon.py b/src/sage/algebras/orlik_solomon.py index 76ed00aa855..a6f8c3c7fe8 100644 --- a/src/sage/algebras/orlik_solomon.py +++ b/src/sage/algebras/orlik_solomon.py @@ -126,7 +126,7 @@ def __init__(self, R, M, ordering=None): self._sorting = {x:i for i,x in enumerate(ordering)} # set up the dictionary of broken circuits - self._broken_circuits = dict() + self._broken_circuits = {} for c in self._M.circuits(): L = sorted(c, key=lambda x: self._sorting[x]) self._broken_circuits[frozenset(L[1:])] = L[0] diff --git a/src/sage/algebras/orlik_terao.py b/src/sage/algebras/orlik_terao.py index 81158f3e9b7..deb3caed04f 100644 --- a/src/sage/algebras/orlik_terao.py +++ b/src/sage/algebras/orlik_terao.py @@ -158,7 +158,7 @@ def __init__(self, R, M, ordering=None): self._sorting = {x: i for i, x in enumerate(ordering)} # set up the dictionary of broken circuits - self._broken_circuits = dict() + self._broken_circuits = {} for c in self._M.circuits(): L = sorted(c, key=self._sorting.__getitem__) self._broken_circuits[frozenset(L[1:])] = L[0] diff --git a/src/sage/algebras/q_system.py b/src/sage/algebras/q_system.py index d35c51a32a5..8099f98aa8c 100644 --- a/src/sage/algebras/q_system.py +++ b/src/sage/algebras/q_system.py @@ -293,10 +293,10 @@ def _unicode_art_term(self, t): ret = UnicodeArt("") for k, exp in t._sorted_items(): a,m = k - var = UnicodeArt([u"Q" + unicode_subscript(m) + u'⁽' + unicode_superscript(a) + u'⁾'], baseline=0) + var = UnicodeArt(["Q" + unicode_subscript(m) + '⁽' + unicode_superscript(a) + '⁾'], baseline=0) if exp > 1: - var = (UnicodeArt([u'('], baseline=0) + var - + UnicodeArt([u')' + unicode_superscript(exp)], baseline=0)) + var = (UnicodeArt(['('], baseline=0) + var + + UnicodeArt([')' + unicode_superscript(exp)], baseline=0)) ret += var return ret diff --git a/src/sage/algebras/quantum_groups/fock_space.py b/src/sage/algebras/quantum_groups/fock_space.py index 22665746325..3daf03099d5 100644 --- a/src/sage/algebras/quantum_groups/fock_space.py +++ b/src/sage/algebras/quantum_groups/fock_space.py @@ -37,7 +37,7 @@ ############################# -## Fock space options +# Fock space options class FockSpaceOptions(GlobalOptions): r""" @@ -84,15 +84,15 @@ class FockSpaceOptions(GlobalOptions): NAME = 'FockSpace' module = 'sage.algebras.quantum_groups.fock_space' - display = dict(default="ket", - description='Specifies how terms of the natural basis of Fock space should be printed', - values=dict(ket='displayed as a ket in bra-ket notation', - list='displayed as a list'), - case_sensitive=False) + display = {'default': "ket", + 'description': 'Specifies how terms of the natural basis of Fock space should be printed', + 'values': {'ket': 'displayed as a ket in bra-ket notation', + 'list': 'displayed as a list'}, + 'case_sensitive': False} ############################################################################### -## Fock space +# Fock space class FockSpace(Parent, UniqueRepresentation): r""" @@ -371,7 +371,7 @@ def _repr_(self): of Univariate Polynomial Ring in q over Integer Ring """ return "Fock space of rank {} of multicharge {} over {}".format( - self._n, self._multicharge, self.base_ring()) + self._n, self._multicharge, self.base_ring()) def _latex_(self): r""" @@ -568,9 +568,9 @@ def __init__(self, F): """ self._basis_name = "natural" # If the cell x is above the cell y - if len(F._multicharge) == 1: # For partitions - self._above = lambda x,y: x[0] < y[0] - else: # For partition tuples + if len(F._multicharge) == 1: # For partitions + self._above = lambda x, y: x[0] < y[0] + else: # For partition tuples self._above = lambda x,y: x[0] < y[0] or (x[0] == y[0] and x[1] < y[1]) self._addable = lambda la,i: [x for x in la.outside_corners() if la.content(*x, multicharge=F._multicharge) == i] @@ -666,11 +666,11 @@ def _unicode_art_term(self, m): from sage.typeset.unicode_art import UnicodeArt, unicode_art a = unicode_art(m) h = a.height() - l = UnicodeArt([u'│']*h, baseline=0) - r = UnicodeArt([u" "*i + u'╲' for i in range(h//2)], baseline=0) + l = UnicodeArt(['│']*h, baseline=0) + r = UnicodeArt([" "*i + '╲' for i in range(h//2)], baseline=0) if h % 2: - r *= UnicodeArt([u" "*(h//2) + u'〉'], baseline=0) - r *= UnicodeArt([u" "*i + u'╱' for i in reversed(range(h//2))], baseline=0) + r *= UnicodeArt([" "*(h//2) + '〉'], baseline=0) + r *= UnicodeArt([" "*i + '╱' for i in reversed(range(h//2))], baseline=0) ret = l + a + r ret._baseline = h - 1 return ret diff --git a/src/sage/algebras/quantum_groups/quantum_group_gap.py b/src/sage/algebras/quantum_groups/quantum_group_gap.py index 4998af7b588..0c92355503c 100644 --- a/src/sage/algebras/quantum_groups/quantum_group_gap.py +++ b/src/sage/algebras/quantum_groups/quantum_group_gap.py @@ -2025,7 +2025,7 @@ def _ambient_basis_map(self): """ B = list(self.basis()) d = {self.highest_weight_vector(): self._gen} - todo = set([self.highest_weight_vector()]) + todo = {self.highest_weight_vector()} I = self._cartan_type.index_set() while todo: x = todo.pop() diff --git a/src/sage/algebras/schur_algebra.py b/src/sage/algebras/schur_algebra.py index 4fca609ecf7..fc4d787a266 100644 --- a/src/sage/algebras/schur_algebra.py +++ b/src/sage/algebras/schur_algebra.py @@ -343,7 +343,7 @@ def product_on_basis(self, e_ij, e_kl): # Find s in I(n,r) such that (p,s) ~ (i,j) and (s,q) ~ (k,l) for e in e_pq: Z_ijklpq = self.base_ring().zero() - for s in Permutations([xx for xx in j]): + for s in Permutations(list(j)): if (schur_representative_from_index(e[0], s) == e_ij and schur_representative_from_index(s, e[1]) == e_kl): Z_ijklpq += self.base_ring().one() diff --git a/src/sage/algebras/splitting_algebra.py b/src/sage/algebras/splitting_algebra.py index 8913932ffac..04237c09b77 100644 --- a/src/sage/algebras/splitting_algebra.py +++ b/src/sage/algebras/splitting_algebra.py @@ -355,7 +355,7 @@ def __init__(self, monic_polynomial, names='X', iterate=True, warning=True): root_inv = (-1 )**(deg_cf) * cf0_inv * root_inv self._invertible_elements.update({root:root_inv}) verbose("adding inverse %s of root %s" % (root_inv, root)) - invert_items = [(k,v) for k, v in self._invertible_elements.items()] + invert_items = list(self._invertible_elements.items()) for k, v in invert_items: self._invertible_elements.update({v: k}) return diff --git a/src/sage/algebras/steenrod/steenrod_algebra.py b/src/sage/algebras/steenrod/steenrod_algebra.py index 3aaacfdf312..2e63a8e9e12 100644 --- a/src/sage/algebras/steenrod/steenrod_algebra.py +++ b/src/sage/algebras/steenrod/steenrod_algebra.py @@ -1320,7 +1320,7 @@ def coprod_list(t): while a and a[-1] == 0: a = a[:-1] right.append(tuple(a)) - tens = dict().fromkeys(zip(left, right), 1) + tens = {}.fromkeys(zip(left, right), 1) return self.tensor_square()._from_dict(tens, coerce=True) else: # p odd from sage.combinat.permutation import Permutation diff --git a/src/sage/algebras/steenrod/steenrod_algebra_misc.py b/src/sage/algebras/steenrod/steenrod_algebra_misc.py index 91ab657a84f..c2cb488ab4a 100644 --- a/src/sage/algebras/steenrod/steenrod_algebra_misc.py +++ b/src/sage/algebras/steenrod/steenrod_algebra_misc.py @@ -271,7 +271,7 @@ def is_valid_profile(profile, truncation_type, p=2, generic=None): # p odd: e = list(profile[0]) + [truncation_type]*len(profile[0]) k = list(profile[1]) - if not set(k).issubset(set([1,2])): + if not set(k).issubset({1,2}): return False if truncation_type > 0: k = k + [2] diff --git a/src/sage/algebras/weyl_algebra.py b/src/sage/algebras/weyl_algebra.py index b033a24065c..657c20fa3a5 100644 --- a/src/sage/algebras/weyl_algebra.py +++ b/src/sage/algebras/weyl_algebra.py @@ -810,9 +810,9 @@ class options(GlobalOptions): """ NAME = 'DifferentialWeylAlgebra' module = 'sage.algebras.weyl_algebra' - factor_representation = dict(default=False, - description='Controls whether to factor the differentials out or not in the output representations', - checker=lambda x: x in [True, False]) + factor_representation = {'default': False, + 'description': 'Controls whether to factor the differentials out or not in the output representations', + 'checker': lambda x: x in [True, False]} def _element_constructor_(self, x): """ From f5fef3950d5e4c4f0e70847658a597a6241c78ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Chapoton?= Date: Sun, 10 Dec 2023 18:05:31 +0100 Subject: [PATCH 121/145] various details in categories (ruff C4 and UP02) --- src/sage/categories/aperiodic_semigroups.py | 1 - src/sage/categories/cartesian_product.py | 2 +- src/sage/categories/category.py | 7 +++---- src/sage/categories/commutative_rings.py | 2 +- .../categories/covariant_functorial_construction.py | 2 +- src/sage/categories/coxeter_groups.py | 11 +++++------ src/sage/categories/crystals.py | 4 ++-- .../examples/commutative_additive_semigroups.py | 4 ++-- src/sage/categories/examples/with_realizations.py | 2 +- src/sage/categories/fields.py | 1 - .../categories/finite_complex_reflection_groups.py | 8 ++++---- src/sage/categories/finite_coxeter_groups.py | 6 +++--- .../finite_dimensional_algebras_with_basis.py | 1 - src/sage/categories/finite_enumerated_sets.py | 1 - src/sage/categories/finite_posets.py | 4 ++-- src/sage/categories/group_algebras.py | 1 - src/sage/categories/h_trivial_semigroups.py | 1 - src/sage/categories/highest_weight_crystals.py | 2 +- src/sage/categories/homsets.py | 1 - src/sage/categories/j_trivial_semigroups.py | 1 - src/sage/categories/l_trivial_semigroups.py | 1 - src/sage/categories/poor_man_map.py | 1 - src/sage/categories/pushout.py | 6 +++--- src/sage/categories/r_trivial_semigroups.py | 1 - src/sage/categories/regular_crystals.py | 4 ++-- src/sage/categories/semigroups.py | 2 +- src/sage/categories/signed_tensor.py | 1 - src/sage/categories/simplicial_sets.py | 6 +++--- src/sage/categories/tensor.py | 1 - src/sage/categories/weyl_groups.py | 2 +- 30 files changed, 36 insertions(+), 51 deletions(-) diff --git a/src/sage/categories/aperiodic_semigroups.py b/src/sage/categories/aperiodic_semigroups.py index a59652fe4d5..474930f2525 100644 --- a/src/sage/categories/aperiodic_semigroups.py +++ b/src/sage/categories/aperiodic_semigroups.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- r""" Aperiodic semigroups """ diff --git a/src/sage/categories/cartesian_product.py b/src/sage/categories/cartesian_product.py index d7b380b2598..bfedd135b2e 100644 --- a/src/sage/categories/cartesian_product.py +++ b/src/sage/categories/cartesian_product.py @@ -16,7 +16,7 @@ from sage.categories.covariant_functorial_construction import CovariantFunctorialConstruction, CovariantConstructionCategory from sage.categories.pushout import MultivariateConstructionFunctor -native_python_containers = set([tuple, list, set, frozenset, range]) +native_python_containers = {tuple, list, set, frozenset, range} class CartesianProductFunctor(CovariantFunctorialConstruction, MultivariateConstructionFunctor): """ diff --git a/src/sage/categories/category.py b/src/sage/categories/category.py index 1dd39bfc7d6..54e0df67278 100644 --- a/src/sage/categories/category.py +++ b/src/sage/categories/category.py @@ -2647,9 +2647,8 @@ def category_graph(categories=None): categories = category_sample() # Include all the super categories # Get rid of join categories - categories = set(cat - for category in categories - for cat in category.all_super_categories(proper=isinstance(category, JoinCategory))) + categories = {cat for category in categories + for cat in category.all_super_categories(proper=isinstance(category, JoinCategory))} g = graphs.digraph.DiGraph() for cat in categories: g.add_vertex(cat._repr_object_names()) @@ -2859,7 +2858,7 @@ def _make_named_class_key(self, name): ) """ - _make_named_class_cache = dict() + _make_named_class_cache = {} _cmp_key = _cmp_key_named diff --git a/src/sage/categories/commutative_rings.py b/src/sage/categories/commutative_rings.py index 9c28072ae0b..1601ca3d3e3 100644 --- a/src/sage/categories/commutative_rings.py +++ b/src/sage/categories/commutative_rings.py @@ -354,7 +354,7 @@ def cyclotomic_cosets(self, q, cosets=None): if cosets is None: rest = set(self) else: - rest = set(self(x) for x in cosets) + rest = {self(x) for x in cosets} orbits = [] while rest: diff --git a/src/sage/categories/covariant_functorial_construction.py b/src/sage/categories/covariant_functorial_construction.py index 45c94bb7bc1..e64bbaa35aa 100644 --- a/src/sage/categories/covariant_functorial_construction.py +++ b/src/sage/categories/covariant_functorial_construction.py @@ -145,7 +145,7 @@ def category_from_parents(self, parents): # But then this would impose that, for any constructor, the # category of the result does not depend on the order/repetition # of the categories of the parents - return self.category_from_categories(tuple(set(parent.category() for parent in parents))) + return self.category_from_categories(tuple({parent.category() for parent in parents})) @cached_method def category_from_categories(self, categories): diff --git a/src/sage/categories/coxeter_groups.py b/src/sage/categories/coxeter_groups.py index 3ce730d8f1d..972d3b4d716 100644 --- a/src/sage/categories/coxeter_groups.py +++ b/src/sage/categories/coxeter_groups.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- r""" Coxeter Groups """ @@ -633,8 +632,8 @@ class is not unique and we only obtain one such class. if not self.is_irreducible() or not self.is_well_generated(): raise ValueError("this method is available for irreducible, well-generated complex reflection groups") from sage.combinat.permutation import Permutations - return set(self.from_reduced_word(w) - for w in Permutations(self.index_set())) + return {self.from_reduced_word(w) + for w in Permutations(self.index_set())} def grassmannian_elements(self, side="right"): """ @@ -1061,7 +1060,7 @@ def bruhat_interval_poset(self, x, y, facade=False): return Poset([[x], []]) if not x.bruhat_le(y): return Poset() - curlayer = set([y]) + curlayer = {y} d = {} while curlayer: nextlayer = set() @@ -1263,8 +1262,8 @@ def _test_simple_projections(self, **options): tester.assertEqual(opi[i](w), w.apply_simple_projection(i, side=side, length_increasing=False)) tester.assertTrue(pi[i](w).has_descent(i, side=side)) tester.assertFalse(opi[i](w).has_descent(i, side=side)) - tester.assertEqual(set([pi[i](w), opi[i](w)]), - set([w, w.apply_simple_reflection(i, side=side)])) + tester.assertEqual({pi[i](w), opi[i](w)}, + {w, w.apply_simple_reflection(i, side=side)}) def _test_has_descent(self, **options): """ diff --git a/src/sage/categories/crystals.py b/src/sage/categories/crystals.py index 74a8319da29..ae900a93e66 100644 --- a/src/sage/categories/crystals.py +++ b/src/sage/categories/crystals.py @@ -2082,7 +2082,7 @@ def __init__(self, parent, on_gens, cartan_type=None, elif isinstance(on_gens, collections.abc.Sequence): if len(self._gens) != len(on_gens): raise ValueError("invalid generator images") - d = {x: y for x, y in zip(self._gens, on_gens)} + d = dict(zip(self._gens, on_gens)) f = lambda x: d[x] else: f = on_gens @@ -2239,7 +2239,7 @@ def to_module_generator(self, x): return self._path_mg_cache[x] mg = set(self._path_mg_cache.keys()) - visited = set([None, x]) + visited = {None, x} index_set = self._cartan_type.index_set() todo = [x] ef = [[]] diff --git a/src/sage/categories/examples/commutative_additive_semigroups.py b/src/sage/categories/examples/commutative_additive_semigroups.py index ce501d5caef..0b3cb314e74 100644 --- a/src/sage/categories/examples/commutative_additive_semigroups.py +++ b/src/sage/categories/examples/commutative_additive_semigroups.py @@ -164,8 +164,8 @@ def __init__(self, parent, iterable): sage: x.value {'a': 2, 'b': 0, 'c': 1, 'd': 5} """ - d = dict( (a,0) for a in parent.alphabet ) - for (a, c) in iterable: + d = {a: 0 for a in parent.alphabet} + for a, c in iterable: d[a] = c ElementWrapper.__init__(self, parent, d) diff --git a/src/sage/categories/examples/with_realizations.py b/src/sage/categories/examples/with_realizations.py index 5a8c1149187..85b4b86daa0 100644 --- a/src/sage/categories/examples/with_realizations.py +++ b/src/sage/categories/examples/with_realizations.py @@ -269,7 +269,7 @@ def supsets(self, set): [{1, 2, 3}, {2, 3}, {1, 2}, {2}] """ S = self.base_set() - return list(S.difference(s) for s in Subsets(S.difference(set))) + return [S.difference(s) for s in Subsets(S.difference(set))] def _repr_(self): r""" diff --git a/src/sage/categories/fields.py b/src/sage/categories/fields.py index fb5e1f06a1b..63ab62aabff 100644 --- a/src/sage/categories/fields.py +++ b/src/sage/categories/fields.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- r""" Fields """ diff --git a/src/sage/categories/finite_complex_reflection_groups.py b/src/sage/categories/finite_complex_reflection_groups.py index 80ff28a90f2..1a5ed06c42a 100644 --- a/src/sage/categories/finite_complex_reflection_groups.py +++ b/src/sage/categories/finite_complex_reflection_groups.py @@ -575,9 +575,9 @@ def milnor_fiber_poset(self): """ I = self.index_set() data = {} - next_reprs = {(): [g for g in self]} + next_reprs = {(): list(self)} next_cosets = {(): [frozenset([g]) for g in next_reprs[()]]} - next_level = set((i, ()) for i in range(len(next_cosets[()]))) + next_level = {(i, ()) for i in range(len(next_cosets[()]))} while next_level: cur = next_level cosets = next_cosets @@ -966,7 +966,7 @@ def noncrossing_partition_lattice(self, c=None, L=None, else: L = [(pi, pi.reflection_length()) for pi in L] rels = [] - ref_lens = {pi: l for (pi, l) in L} + ref_lens = dict(L) for (pi, l) in L: for t in R: tau = pi * t @@ -1215,7 +1215,7 @@ def milnor_fiber_complex(self): for g in self: if any(g in C for C in cosets[Ip]): continue - H = set([g]) + H = {g} to_test = [(g, j) for j in Ip] while to_test: h, j = to_test.pop() diff --git a/src/sage/categories/finite_coxeter_groups.py b/src/sage/categories/finite_coxeter_groups.py index 9d1b8f6cf68..7c7dd59dd99 100644 --- a/src/sage/categories/finite_coxeter_groups.py +++ b/src/sage/categories/finite_coxeter_groups.py @@ -596,7 +596,7 @@ def m_cambrian_lattice(self, c, m=1, on_roots=False): covers = [] bottom_elt = frozenset((s, 0) for s in S) - new = set([bottom_elt]) + new = {bottom_elt} while new: new_element = new.pop() elements.add(new_element) @@ -809,7 +809,7 @@ def coxeter_poset(self): """ I = self.index_set() data = {} - next_level = set((g, ()) for g in self) + next_level = {(g, ()) for g in self} while next_level: cur = next_level next_level = set() @@ -988,7 +988,7 @@ def coxeter_knuth_neighbor(self, w): raise NotImplementedError("this has only been implemented in finite type A so far") d = [] for i in range(2, len(w)): - v = [j for j in w] + v = list(w) if w[i-2] == w[i]: if w[i] == w[i-1] - 1: v[i-2] = w[i-1] diff --git a/src/sage/categories/finite_dimensional_algebras_with_basis.py b/src/sage/categories/finite_dimensional_algebras_with_basis.py index 2ba4069a8d5..0858078f41b 100644 --- a/src/sage/categories/finite_dimensional_algebras_with_basis.py +++ b/src/sage/categories/finite_dimensional_algebras_with_basis.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- r""" Finite dimensional algebras with basis diff --git a/src/sage/categories/finite_enumerated_sets.py b/src/sage/categories/finite_enumerated_sets.py index 4ca87850b7a..6c4fba4c1a6 100644 --- a/src/sage/categories/finite_enumerated_sets.py +++ b/src/sage/categories/finite_enumerated_sets.py @@ -665,7 +665,6 @@ def rank(self, x): sage: C.unrank(54213) ('a', 86, [7, 5, 4, 4]) """ - from builtins import zip from sage.rings.integer_ring import ZZ x = self(x) b = ZZ.one() diff --git a/src/sage/categories/finite_posets.py b/src/sage/categories/finite_posets.py index c50eb6c100d..49d9f2ba53f 100644 --- a/src/sage/categories/finite_posets.py +++ b/src/sage/categories/finite_posets.py @@ -183,7 +183,7 @@ def is_poset_isomorphism(self, f, codomain): .. SEEALSO:: :meth:`FiniteLatticePosets.ParentMethods.is_lattice_morphism` """ - image = set(f(x) for x in self) + image = {f(x) for x in self} if len(image) != self.cardinality(): # Not injective return False @@ -191,7 +191,7 @@ def is_poset_isomorphism(self, f, codomain): # Not surjective return False for x in self: - if set(f(y) for y in self.upper_covers(x)) != set(codomain.upper_covers(f(x))): + if {f(y) for y in self.upper_covers(x)} != set(codomain.upper_covers(f(x))): return False return True diff --git a/src/sage/categories/group_algebras.py b/src/sage/categories/group_algebras.py index 7a41d4877fd..89ad3f56d79 100644 --- a/src/sage/categories/group_algebras.py +++ b/src/sage/categories/group_algebras.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- r""" Group Algebras diff --git a/src/sage/categories/h_trivial_semigroups.py b/src/sage/categories/h_trivial_semigroups.py index e11d8663eb7..5630068d671 100644 --- a/src/sage/categories/h_trivial_semigroups.py +++ b/src/sage/categories/h_trivial_semigroups.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- r""" H-trivial semigroups """ diff --git a/src/sage/categories/highest_weight_crystals.py b/src/sage/categories/highest_weight_crystals.py index 35cec0173a6..68e72a11b90 100644 --- a/src/sage/categories/highest_weight_crystals.py +++ b/src/sage/categories/highest_weight_crystals.py @@ -342,7 +342,7 @@ def iter_by_deg(gens): deg += 1 yield len(next) todo = next - next = set([]) + next = set() while todo: x = todo.pop() for i in I: diff --git a/src/sage/categories/homsets.py b/src/sage/categories/homsets.py index 794d79d304e..6a24e546eb7 100644 --- a/src/sage/categories/homsets.py +++ b/src/sage/categories/homsets.py @@ -1,4 +1,3 @@ -# -*- encoding: utf-8 -*- r""" Homset categories """ diff --git a/src/sage/categories/j_trivial_semigroups.py b/src/sage/categories/j_trivial_semigroups.py index bcad8a8c653..8ca78c83a1e 100644 --- a/src/sage/categories/j_trivial_semigroups.py +++ b/src/sage/categories/j_trivial_semigroups.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- r""" J-trivial semigroups """ diff --git a/src/sage/categories/l_trivial_semigroups.py b/src/sage/categories/l_trivial_semigroups.py index 9c483dcd3d1..ef4a8c41016 100644 --- a/src/sage/categories/l_trivial_semigroups.py +++ b/src/sage/categories/l_trivial_semigroups.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- r""" L-trivial semigroups """ diff --git a/src/sage/categories/poor_man_map.py b/src/sage/categories/poor_man_map.py index b8d0bdb4de9..6fc55a02104 100644 --- a/src/sage/categories/poor_man_map.py +++ b/src/sage/categories/poor_man_map.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- r""" Poor Man's map """ diff --git a/src/sage/categories/pushout.py b/src/sage/categories/pushout.py index a23557037b0..7cecf57e551 100644 --- a/src/sage/categories/pushout.py +++ b/src/sage/categories/pushout.py @@ -1441,7 +1441,7 @@ def __mul__(self, other): # The variable names of the MultiPolynomialFunctor # that can be interpreted as variables in self - RemainingVars = [x for x in othervars] + RemainingVars = list(othervars) IsOverlap = False BadOverlap = False for x in othervars: @@ -2164,7 +2164,7 @@ def merge(self, other): else: n = self.n - name_mapping = dict() + name_mapping = {} for base_ring, name in self.name_mapping.items(): try: other_name = other.name_mapping[base_ring] @@ -2174,7 +2174,7 @@ def merge(self, other): if name == other_name: name_mapping[base_ring] = name - latex_name_mapping = dict() + latex_name_mapping = {} for base_ring, latex_name in self.latex_name_mapping.items(): try: other_latex_name = other.latex_name_mapping[base_ring] diff --git a/src/sage/categories/r_trivial_semigroups.py b/src/sage/categories/r_trivial_semigroups.py index 7b5c9fea5ed..a73f28931eb 100644 --- a/src/sage/categories/r_trivial_semigroups.py +++ b/src/sage/categories/r_trivial_semigroups.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- r""" R-trivial semigroups """ diff --git a/src/sage/categories/regular_crystals.py b/src/sage/categories/regular_crystals.py index 297420e5083..5a0ac6291b5 100644 --- a/src/sage/categories/regular_crystals.py +++ b/src/sage/categories/regular_crystals.py @@ -855,8 +855,8 @@ def dual_equivalence_class(self, index_set=None): if self.epsilon(i) != self.phi(i): raise ValueError("the element is not weight 0") - visited = set([]) - todo = set([self]) + visited = set() + todo = {self} edges = [] while todo: x = todo.pop() diff --git a/src/sage/categories/semigroups.py b/src/sage/categories/semigroups.py index 4b85a255568..8f2c57feeb9 100644 --- a/src/sage/categories/semigroups.py +++ b/src/sage/categories/semigroups.py @@ -341,7 +341,7 @@ def cayley_graph(self, side="right", simple=False, elements=None, else: generators = self.semigroup_generators() if isinstance(generators, (list, tuple)): - generators = dict((self(g), self(g)) for g in generators) + generators = {self(g): self(g) for g in generators} left = (side == "left" or side == "twosided") right = (side == "right" or side == "twosided") diff --git a/src/sage/categories/signed_tensor.py b/src/sage/categories/signed_tensor.py index cbd5176ed16..c5281b7275a 100644 --- a/src/sage/categories/signed_tensor.py +++ b/src/sage/categories/signed_tensor.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ Signed Tensor Product Functorial Construction diff --git a/src/sage/categories/simplicial_sets.py b/src/sage/categories/simplicial_sets.py index 19ec792d9ab..2b45c4c98cb 100644 --- a/src/sage/categories/simplicial_sets.py +++ b/src/sage/categories/simplicial_sets.py @@ -379,7 +379,7 @@ def _universal_cover_dict(self): rels = [] for f in self.n_cells(2): - z = dict() + z = {} for i, sigma in enumerate(self.faces(f)): if sigma in spanning_tree: z[i] = FG.one() @@ -472,7 +472,7 @@ def covering_map(self, character): """ from sage.topology.simplicial_set import AbstractSimplex, SimplicialSet from sage.topology.simplicial_set_morphism import SimplicialSetMorphism - char = {a: b for (a, b) in character.items()} + char = dict(character.items()) G = list(char.values())[0].parent() if not G.is_finite(): raise NotImplementedError("can only compute universal covers of spaces with finite fundamental group") @@ -608,7 +608,7 @@ def _canonical_twisting_operator(self): phi = G.abelianization_map() abelG, R, I, images = G.abelianization_to_algebra(ZZ) QRP = R.quotient_ring(I) - res = dict() + res = {} for s, el in d.items(): res[s] = QRP(prod(images[abs(a)-1]**sign(a) for a in el.Tietze())) return res diff --git a/src/sage/categories/tensor.py b/src/sage/categories/tensor.py index 67c4e6476ca..01208e6217e 100644 --- a/src/sage/categories/tensor.py +++ b/src/sage/categories/tensor.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ Tensor Product Functorial Construction diff --git a/src/sage/categories/weyl_groups.py b/src/sage/categories/weyl_groups.py index 5a52c10e04b..b28cf132f19 100644 --- a/src/sage/categories/weyl_groups.py +++ b/src/sage/categories/weyl_groups.py @@ -828,7 +828,7 @@ def quantum_bruhat_successors(self, index_set=None, roots=False, quantum_only=Fa if index_set is None: index_set = [] else: - index_set = [x for x in index_set] + index_set = list(index_set) index_set = tuple(index_set) if self != self.coset_representative(index_set): raise ValueError("{} is not of minimum length in its coset of the parabolic subgroup generated by the reflections {}".format(self, index_set)) From 7cbc82a9a0436ff219b9fd4542e0c7b0f78a449b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Chapoton?= Date: Sun, 10 Dec 2023 18:16:06 +0100 Subject: [PATCH 122/145] some ruff details in modular (unicode) --- src/sage/modular/cusps.py | 1 - src/sage/modular/etaproducts.py | 2 +- src/sage/modular/hypergeometric_motive.py | 3 +-- src/sage/modular/local_comp/smoothchar.py | 2 +- src/sage/modular/modform/element.py | 4 ++-- .../modular/modform_hecketriangle/abstract_space.py | 2 +- .../hecke_triangle_group_element.py | 4 ++-- .../modform_hecketriangle/hecke_triangle_groups.py | 2 +- src/sage/modular/modsym/manin_symbol_list.py | 1 - src/sage/modular/pollack_stevens/dist.pyx | 10 +++++----- src/sage/modular/pollack_stevens/fund_domain.py | 1 - src/sage/modular/pollack_stevens/modsym.py | 7 +++---- src/sage/modular/pollack_stevens/sigma0.py | 1 - 13 files changed, 17 insertions(+), 23 deletions(-) diff --git a/src/sage/modular/cusps.py b/src/sage/modular/cusps.py index fd8a6d7bc58..39d72a71209 100644 --- a/src/sage/modular/cusps.py +++ b/src/sage/modular/cusps.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- r""" The set `\mathbb{P}^1(\QQ)` of cusps diff --git a/src/sage/modular/etaproducts.py b/src/sage/modular/etaproducts.py index 700b369b5df..27b2edd39a3 100644 --- a/src/sage/modular/etaproducts.py +++ b/src/sage/modular/etaproducts.py @@ -633,7 +633,7 @@ def EtaProduct(level, dic) -> EtaGroupElement: - ``dic`` -- (dictionary): a dictionary indexed by divisors of N such that the coefficient of `\eta(q^d)` is r[d]. Only nonzero coefficients need be specified. If Ligozat's - criteria are not satisfied, a ``ValueError`` will be raised. + criteria are not satisfied, a :class:`ValueError` will be raised. OUTPUT: diff --git a/src/sage/modular/hypergeometric_motive.py b/src/sage/modular/hypergeometric_motive.py index b26e5c39be5..8dbec096831 100644 --- a/src/sage/modular/hypergeometric_motive.py +++ b/src/sage/modular/hypergeometric_motive.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ Hypergeometric motives @@ -261,7 +260,7 @@ def alpha_to_cyclotomic(alpha): The output represent a product of cyclotomic polynomials with exactly the given roots. Note that the multiplicity of `r/s` in the list - must be independent of `r`; otherwise, a ``ValueError`` will be raised. + must be independent of `r`; otherwise, a :class:`ValueError` will be raised. This is the inverse of :func:`cyclotomic_to_alpha`. diff --git a/src/sage/modular/local_comp/smoothchar.py b/src/sage/modular/local_comp/smoothchar.py index 1e4c25fe096..333b609aef6 100644 --- a/src/sage/modular/local_comp/smoothchar.py +++ b/src/sage/modular/local_comp/smoothchar.py @@ -1314,7 +1314,7 @@ def extend_character(self, level, chi, vals, check=True): ring coercible to it), specifying values on the quotients returned by :meth:`quotient_gens`. - A ``ValueError`` will be raised if `x^t \ne \chi(\alpha^t)`, where `t` + A :class:`ValueError` will be raised if `x^t \ne \chi(\alpha^t)`, where `t` is the smallest integer such that `\alpha^t` is congruent modulo `p^{\rm level}` to an element of `\QQ_p`. diff --git a/src/sage/modular/modform/element.py b/src/sage/modular/modform/element.py index 2c8c1c79616..f3cab3dcfe4 100644 --- a/src/sage/modular/modform/element.py +++ b/src/sage/modular/modform/element.py @@ -658,7 +658,7 @@ def atkin_lehner_eigenvalue(self, d=None, embedding=None): specified, and in (a suitable extension of) the base field of ``self`` otherwise. - If ``self`` is not an eigenform for `W_d`, a ``ValueError`` is + If ``self`` is not an eigenform for `W_d`, a :class:`ValueError` is raised. .. SEEALSO:: @@ -2588,7 +2588,7 @@ def atkin_lehner_eigenvalue(self, d=None, embedding=None): OUTPUT: The Atkin-Lehner eigenvalue of `W_d` on ``self``. If ``self`` is not an - eigenform for `W_d`, a ``ValueError`` is raised. + eigenform for `W_d`, a :class:`ValueError` is raised. .. SEEALSO:: diff --git a/src/sage/modular/modform_hecketriangle/abstract_space.py b/src/sage/modular/modform_hecketriangle/abstract_space.py index d1c52cc3b8f..47bd1e6c766 100644 --- a/src/sage/modular/modform_hecketriangle/abstract_space.py +++ b/src/sage/modular/modform_hecketriangle/abstract_space.py @@ -620,7 +620,7 @@ def element_from_ambient_coordinates(self, vec): def homogeneous_part(self, k, ep): r""" Since ``self`` already is a homogeneous component return ``self`` - unless the degree differs in which case a ``ValueError`` is raised. + unless the degree differs in which case a :class:`ValueError` is raised. EXAMPLES:: diff --git a/src/sage/modular/modform_hecketriangle/hecke_triangle_group_element.py b/src/sage/modular/modform_hecketriangle/hecke_triangle_group_element.py index 7fa7b698d14..47ff7c34796 100644 --- a/src/sage/modular/modform_hecketriangle/hecke_triangle_group_element.py +++ b/src/sage/modular/modform_hecketriangle/hecke_triangle_group_element.py @@ -183,7 +183,7 @@ def _word_S_T_data(self): of ``self`` as a product of the generators ``S`` and ``T`` together with a sign correction ``sgn``. - If this decomposition is not possible a ``TypeError`` + If this decomposition is not possible a :class:`TypeError` is raised. In particular this function can be used to check the membership in ``parent`` of an arbitrary matrix over the base ring. @@ -257,7 +257,7 @@ def word_S_T(self): of ``L`` are either the generator ``S`` or a non-trivial integer power of the generator ``T``. ``sgn`` is +- the identity. - If this decomposition is not possible a ``TypeError`` is raised. + If this decomposition is not possible a :class:`TypeError` is raised. EXAMPLES:: diff --git a/src/sage/modular/modform_hecketriangle/hecke_triangle_groups.py b/src/sage/modular/modform_hecketriangle/hecke_triangle_groups.py index b37898fc024..4189a07ffee 100644 --- a/src/sage/modular/modform_hecketriangle/hecke_triangle_groups.py +++ b/src/sage/modular/modform_hecketriangle/hecke_triangle_groups.py @@ -757,7 +757,7 @@ def root_extension_embedding(self, D, K=None): OUTPUT: The corresponding embedding if it was found. - Otherwise a ``ValueError`` is raised. + Otherwise a :class:`ValueError` is raised. EXAMPLES:: diff --git a/src/sage/modular/modsym/manin_symbol_list.py b/src/sage/modular/modsym/manin_symbol_list.py index 93fa3f1365b..6375cc0dbe7 100644 --- a/src/sage/modular/modsym/manin_symbol_list.py +++ b/src/sage/modular/modsym/manin_symbol_list.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ Manin symbol lists diff --git a/src/sage/modular/pollack_stevens/dist.pyx b/src/sage/modular/pollack_stevens/dist.pyx index 3f67bbf8ecb..e98333c9a40 100644 --- a/src/sage/modular/pollack_stevens/dist.pyx +++ b/src/sage/modular/pollack_stevens/dist.pyx @@ -67,7 +67,7 @@ def get_dist_classes(p, prec_cap, base, symk, implementation): - ``implementation`` - string - If not None, override the automatic choice of implementation. May be 'long' or 'vector', - otherwise raise a ``NotImplementedError`` + otherwise raise a :class:`NotImplementedError` OUTPUT: @@ -293,9 +293,9 @@ cdef class Dist(ModuleElement): def find_scalar(self, _other, p, M=None, check=True): r""" Return an ``alpha`` with ``other = self * alpha``, or raises - a ``ValueError``. + a :class:`ValueError`. - It will also raise a ``ValueError`` if this distribution is zero. + It will also raise a :class:`ValueError` if this distribution is zero. INPUT: @@ -417,9 +417,9 @@ cdef class Dist(ModuleElement): def find_scalar_from_zeroth_moment(self, _other, p, M=None, check=True): r""" Return an ``alpha`` with ``other = self * alpha`` using only - the zeroth moment, or raises a ``ValueError``. + the zeroth moment, or raises a :class:`ValueError`. - It will also raise a ``ValueError`` if the zeroth moment of the + It will also raise a :class:`ValueError` if the zeroth moment of the distribution is zero. INPUT: diff --git a/src/sage/modular/pollack_stevens/fund_domain.py b/src/sage/modular/pollack_stevens/fund_domain.py index 4bd2638d5a6..ef067853f4a 100644 --- a/src/sage/modular/pollack_stevens/fund_domain.py +++ b/src/sage/modular/pollack_stevens/fund_domain.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- r""" Manin relations for overconvergent modular symbols diff --git a/src/sage/modular/pollack_stevens/modsym.py b/src/sage/modular/pollack_stevens/modsym.py index 78e601189a8..63b3264615a 100644 --- a/src/sage/modular/pollack_stevens/modsym.py +++ b/src/sage/modular/pollack_stevens/modsym.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- r""" Element class for Pollack-Stevens' modular symbols @@ -361,9 +360,9 @@ def _get_prime(self, p=None, alpha=None, allow_none=False): OUTPUT: - - a prime or None. If ``allow_none`` is False then a - ``ValueError`` will be raised rather than returning None if no - prime can be determined. + - a prime or ``None``. If ``allow_none`` is ``False`` then a + :class:`ValueError` will be raised rather than returning ``None`` + if no prime can be determined. EXAMPLES:: diff --git a/src/sage/modular/pollack_stevens/sigma0.py b/src/sage/modular/pollack_stevens/sigma0.py index bd203ec8600..ce52830f070 100644 --- a/src/sage/modular/pollack_stevens/sigma0.py +++ b/src/sage/modular/pollack_stevens/sigma0.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- r""" The matrix monoid `\Sigma_0(N)`. From ccfbd09f1f397b06cb4be0d750bc2d8d58a2bebd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Chapoton?= Date: Sun, 10 Dec 2023 20:41:34 +0100 Subject: [PATCH 123/145] various details in modules folder (ruff, cython-lint, roles) --- src/sage/modules/fg_pid/fgp_module.py | 2 +- src/sage/modules/filtered_vector_space.py | 6 ++--- src/sage/modules/finite_submodule_iter.pyx | 3 +-- src/sage/modules/free_module.py | 28 ++++++++++----------- src/sage/modules/free_module_element.pyx | 3 +-- src/sage/modules/free_module_integer.py | 1 - src/sage/modules/free_quadratic_module.py | 6 ++--- src/sage/modules/matrix_morphism.py | 2 +- src/sage/modules/module.pyx | 2 +- src/sage/modules/tensor_operations.py | 2 +- src/sage/modules/vector_integer_sparse.pyx | 5 ++-- src/sage/modules/vector_mod2_dense.pyx | 5 +--- src/sage/modules/vector_modn_sparse.pyx | 5 ++-- src/sage/modules/vector_numpy_dense.pyx | 4 +-- src/sage/modules/vector_rational_sparse.pyx | 5 ++-- src/sage/modules/with_basis/invariant.py | 2 +- src/sage/modules/with_basis/morphism.py | 11 ++++---- 17 files changed, 41 insertions(+), 51 deletions(-) diff --git a/src/sage/modules/fg_pid/fgp_module.py b/src/sage/modules/fg_pid/fgp_module.py index f2b1063ce64..7c1292334ef 100644 --- a/src/sage/modules/fg_pid/fgp_module.py +++ b/src/sage/modules/fg_pid/fgp_module.py @@ -1806,7 +1806,7 @@ def list(self): sage: list(V/W) [(0), (1)] """ - return [e for e in self] + return list(self) def __iter__(self): """ diff --git a/src/sage/modules/filtered_vector_space.py b/src/sage/modules/filtered_vector_space.py index c5e4b7058bf..d6a1d6237a6 100644 --- a/src/sage/modules/filtered_vector_space.py +++ b/src/sage/modules/filtered_vector_space.py @@ -465,7 +465,7 @@ def make_subspace(indices): indices = set(filtration.pop(infinity, [])) V = make_subspace(indices) filtered_subspaces = [(infinity, V)] - for deg in reversed(sorted(filtration.keys())): + for deg in sorted(filtration.keys(), reverse=True): next_V = V indices.update(filtration[deg]) V = make_subspace(indices) @@ -775,13 +775,13 @@ def presentation(self): def _repr_field_name(self): """ - Return an abbreviated field name as string + Return an abbreviated field name as string. .. NOTE: This should rather be a method of fields and rings. RAISES: - ``NotImplementedError``: The field does not have an + :class:`NotImplementedError`: The field does not have an abbreviated name defined. EXAMPLES:: diff --git a/src/sage/modules/finite_submodule_iter.pyx b/src/sage/modules/finite_submodule_iter.pyx index ab335200e0d..4f0fbbdca3b 100644 --- a/src/sage/modules/finite_submodule_iter.pyx +++ b/src/sage/modules/finite_submodule_iter.pyx @@ -283,7 +283,7 @@ cdef class FiniteFieldsubspace_iterator(FiniteZZsubmodule_iterator): sage: all(Y[i]-X[i] == v for i in range(len(X))) True """ - cdef Py_ssize_t d, i, p + cdef Py_ssize_t i, p cdef list pows, order F = basis[0].base_ring() @@ -366,7 +366,6 @@ cdef class FiniteFieldsubspace_projPoint_iterator: 85 """ from sage.matrix.constructor import matrix - cdef i self._basis = list(basis) self._basis_length = len(self._basis) self._immutable = immutable diff --git a/src/sage/modules/free_module.py b/src/sage/modules/free_module.py index 00b28b26620..7f9679a31d2 100644 --- a/src/sage/modules/free_module.py +++ b/src/sage/modules/free_module.py @@ -563,7 +563,7 @@ def VectorSpace(K, dimension_or_basis_keys=None, sparse=False, inner_product_mat (0, 0, 1) ] - The base must be a field or a ``TypeError`` is raised. + The base must be a field or a :class:`TypeError` is raised. :: @@ -1720,8 +1720,8 @@ def submodule(self, gens, check=True, already_echelonized=False): Echelon basis matrix: [3 3 0] - We try to create a submodule that isn't really a submodule, - which results in an ``ArithmeticError`` exception:: + We try to create a submodule that is not really a submodule, + which results in an :class:`ArithmeticError` exception:: sage: W.submodule([B[0] - B[1]]) Traceback (most recent call last): @@ -2722,7 +2722,7 @@ def coordinates(self, v, check=True): \\sum c_i B_i = v. - If `v` is not in self, raise an ``ArithmeticError`` exception. + If `v` is not in self, raise an :class:`ArithmeticError` exception. EXAMPLES:: @@ -4637,7 +4637,7 @@ def span_of_basis(self, basis, base_ring=None, check=True, already_echelonized=F [3 3 0] The basis vectors must be linearly independent or a - ``ValueError`` exception is raised:: + :class:`ValueError` exception is raised:: sage: W.span_of_basis([[2,2,2], [3,3,3]]) Traceback (most recent call last): @@ -4696,7 +4696,7 @@ def subspace(self, gens, check=True, already_echelonized=False): [1 1 0] With ``check=True`` (the default) the mistake is correctly - detected and reported with an ``ArithmeticError`` exception:: + detected and reported with an :class:`ArithmeticError` exception:: sage: W.subspace([[1,1,0]], check=True) Traceback (most recent call last): @@ -5799,7 +5799,7 @@ def coordinate_vector(self, v, check=True): \\sum c_i B_i = v. - If `v` is not in self, raise an ``ArithmeticError`` exception. + If `v` is not in self, raise an :class:`ArithmeticError` exception. EXAMPLES:: @@ -6150,7 +6150,7 @@ def coordinate_vector(self, v, check=True): \\sum c_i B_i = v. - If `v` is not in self, raise an ``ArithmeticError`` exception. + If `v` is not in self, raise an :class:`ArithmeticError` exception. EXAMPLES:: @@ -7001,7 +7001,7 @@ def echelon_coordinates(self, v, check=True): \sum c_i B_i = v. - If `v` is not in self, raise an ``ArithmeticError`` exception. + If `v` is not in self, raise an :class:`ArithmeticError` exception. EXAMPLES:: @@ -7441,7 +7441,7 @@ def coordinate_vector(self, v, check=True): \\sum c_i B_i = v. - If `v` is not in self, raise an ``ArithmeticError`` exception. + If `v` is not in self, raise an :class:`ArithmeticError` exception. EXAMPLES:: @@ -7498,7 +7498,7 @@ def echelon_coordinate_vector(self, v, check=True): \\sum c_i B_i = v. - If `v` is not in self, raise an ``ArithmeticError`` exception. + If `v` is not in self, raise an :class:`ArithmeticError` exception. EXAMPLES:: @@ -7652,7 +7652,7 @@ def coordinate_vector(self, v, check=True): \\sum c_i B_i = v. - If `v` is not in self, raise an ``ArithmeticError`` exception. + If `v` is not in self, raise an :class:`ArithmeticError` exception. EXAMPLES:: @@ -8054,7 +8054,7 @@ def echelon_coordinates(self, v, check=True): \\sum c_i B_i = v. - If `v` is not in ``self``, raise an ``ArithmeticError`` exception. + If `v` is not in ``self``, raise an :class:`ArithmeticError` exception. EXAMPLES:: @@ -8117,7 +8117,7 @@ def coordinate_vector(self, v, check=True): \\sum c_i B_i = v. - If `v` is not in ``self``, raise an ``ArithmeticError`` exception. + If `v` is not in ``self``, raise an :class:`ArithmeticError` exception. EXAMPLES:: diff --git a/src/sage/modules/free_module_element.pyx b/src/sage/modules/free_module_element.pyx index 2c28616dbf4..3492dbf2eb1 100644 --- a/src/sage/modules/free_module_element.pyx +++ b/src/sage/modules/free_module_element.pyx @@ -4788,11 +4788,10 @@ cdef class FreeModuleElement_generic_sparse(FreeModuleElement): sage: v.nonzero_positions() [0, 1, 3, 4] """ - #WARNING: In creation, we do not check that the indices i satisfy + # WARNING: In creation, we do not check that the indices i satisfy # 0 <= i < degree # or even that the indices are integers. FreeModuleElement.__init__(self, parent) - R = self.base_ring() cdef Py_ssize_t i cdef dict entries_dict, e if not entries: diff --git a/src/sage/modules/free_module_integer.py b/src/sage/modules/free_module_integer.py index 5f20d55a89c..c45a0b5c485 100644 --- a/src/sage/modules/free_module_integer.py +++ b/src/sage/modules/free_module_integer.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ Discrete subgroups of `\\ZZ^n` diff --git a/src/sage/modules/free_quadratic_module.py b/src/sage/modules/free_quadratic_module.py index df0f90a4fb6..fa0b61e0af3 100644 --- a/src/sage/modules/free_quadratic_module.py +++ b/src/sage/modules/free_quadratic_module.py @@ -207,7 +207,7 @@ def QuadraticSpace(K, dimension, inner_product_matrix, sparse=False): (0, 0, 1) ] - The base must be a field or a ``TypeError`` is raised:: + The base must be a field or a :class:`TypeError` is raised:: sage: QuadraticSpace(ZZ,5,identity_matrix(ZZ,2)) Traceback (most recent call last): @@ -791,7 +791,7 @@ def span_of_basis(self, basis, check=True, already_echelonized=False): [3 3 0] The basis vectors must be linearly independent or a - ``ValueError`` exception is raised:: + :class:`ValueError` exception is raised:: sage: W.span_of_basis([[2,2,2], [3,3,3]]) Traceback (most recent call last): @@ -1341,7 +1341,7 @@ def change_ring(self, R): element of ``self`` into a vector over the fraction field of `R`, then taking the resulting `R`-module. - This raises a ``TypeError`` if coercion is not possible. + This raises a :class:`TypeError` if coercion is not possible. INPUT: diff --git a/src/sage/modules/matrix_morphism.py b/src/sage/modules/matrix_morphism.py index d342dc00237..868da6f88a5 100644 --- a/src/sage/modules/matrix_morphism.py +++ b/src/sage/modules/matrix_morphism.py @@ -321,7 +321,7 @@ def inverse(self): r""" Return the inverse of this matrix morphism, if the inverse exists. - Raises a ``ZeroDivisionError`` if the inverse does not exist. + This raises a :class:`ZeroDivisionError` if the inverse does not exist. EXAMPLES: diff --git a/src/sage/modules/module.pyx b/src/sage/modules/module.pyx index 21bb44f8e67..ae0dc162520 100644 --- a/src/sage/modules/module.pyx +++ b/src/sage/modules/module.pyx @@ -205,7 +205,7 @@ cdef class Module(Parent): Return the base extension of ``self`` to `R`. This is the same as ``self.change_ring(R)`` except that a - ``TypeError`` is raised if there is no canonical coerce map + :class:`TypeError` is raised if there is no canonical coerce map from the base ring of ``self`` to `R`. INPUT: diff --git a/src/sage/modules/tensor_operations.py b/src/sage/modules/tensor_operations.py index 91ec0d83e07..8d341541dbe 100644 --- a/src/sage/modules/tensor_operations.py +++ b/src/sage/modules/tensor_operations.py @@ -282,7 +282,7 @@ def __init__(self, vector_collections, operation='product'): assert all(V.base_ring() is base_ring for V in vector_collections) self._V = tuple(vector_collections) self._vectors = [] - self._index_map = dict() + self._index_map = {} if operation == 'product': self._init_product() elif operation == 'symmetric': diff --git a/src/sage/modules/vector_integer_sparse.pyx b/src/sage/modules/vector_integer_sparse.pyx index 9fdecf6a326..5fe48656495 100644 --- a/src/sage/modules/vector_integer_sparse.pyx +++ b/src/sage/modules/vector_integer_sparse.pyx @@ -175,7 +175,6 @@ cdef int mpz_vector_set_entry(mpz_vector* v, Py_ssize_t n, mpz_t x) except -1: if n >= v.degree or n < 0: raise IndexError("Index (=%s) must be between 0 and %s." % (n, v.degree - 1)) cdef Py_ssize_t i, m, ins - cdef Py_ssize_t m2, ins2 cdef Py_ssize_t *pos cdef mpz_t *e @@ -195,7 +194,7 @@ cdef int mpz_vector_set_entry(mpz_vector* v, Py_ssize_t n, mpz_t x) except -1: e = v.entries pos = v.positions allocate_mpz_vector(v, v.num_nonzero - 1) # This does *not* change v.num_nonzero - for i from 0 <= i < m: + for i in range(m): # v.entries[i] = e[i] mpz_set(v.entries[i], e[i]) mpz_clear(e[i]) @@ -223,7 +222,7 @@ cdef int mpz_vector_set_entry(mpz_vector* v, Py_ssize_t n, mpz_t x) except -1: e = v.entries pos = v.positions allocate_mpz_vector(v, v.num_nonzero) - for i from 0 <= i < ins: + for i in range(ins): # v.entries[i] = e[i] mpz_set(v.entries[i], e[i]) mpz_clear(e[i]) diff --git a/src/sage/modules/vector_mod2_dense.pyx b/src/sage/modules/vector_mod2_dense.pyx index 243d8020138..4137b594eec 100644 --- a/src/sage/modules/vector_mod2_dense.pyx +++ b/src/sage/modules/vector_mod2_dense.pyx @@ -443,12 +443,9 @@ cdef class Vector_mod2_dense(free_module_element.FreeModuleElement): sage: e * 2 == 0 True """ - cdef IntegerMod_int a - if left: return self.__copy__() - else: - return self._new_c() + return self._new_c() cpdef _neg_(self) noexcept: """ diff --git a/src/sage/modules/vector_modn_sparse.pyx b/src/sage/modules/vector_modn_sparse.pyx index 9ea760c31a2..0cde9644380 100644 --- a/src/sage/modules/vector_modn_sparse.pyx +++ b/src/sage/modules/vector_modn_sparse.pyx @@ -152,7 +152,6 @@ cdef int set_entry(c_vector_modint* v, Py_ssize_t n, int_fast64_t x) except -1: if n < 0 or n >= v.degree: raise IndexError("index (=%s) must be between 0 and %s" % (n, v.degree-1)) cdef Py_ssize_t i, m, ins - cdef Py_ssize_t m2, ins2 cdef Py_ssize_t *pos cdef int_fast64_t *e @@ -174,7 +173,7 @@ cdef int set_entry(c_vector_modint* v, Py_ssize_t n, int_fast64_t x) except -1: e = v.entries pos = v.positions allocate_c_vector_modint(v, v.num_nonzero - 1) - for i from 0 <= i < m: + for i in range(m): v.entries[i] = e[i] v.positions[i] = pos[i] for i from m < i < v.num_nonzero: @@ -198,7 +197,7 @@ cdef int set_entry(c_vector_modint* v, Py_ssize_t n, int_fast64_t x) except -1: e = v.entries pos = v.positions allocate_c_vector_modint(v, v.num_nonzero) - for i from 0 <= i < ins: + for i in range(ins): v.entries[i] = e[i] v.positions[i] = pos[i] v.entries[ins] = x diff --git a/src/sage/modules/vector_numpy_dense.pyx b/src/sage/modules/vector_numpy_dense.pyx index 2739e36d442..433f77b11d3 100644 --- a/src/sage/modules/vector_numpy_dense.pyx +++ b/src/sage/modules/vector_numpy_dense.pyx @@ -164,7 +164,7 @@ cdef class Vector_numpy_dense(FreeModuleElement): sage: V.element_class(V, 0) (0.0, 0.0) """ - cdef Py_ssize_t i,j + cdef Py_ssize_t i if isinstance(entries,(tuple, list)): if len(entries)!=self._degree: raise TypeError("entries has wrong length") @@ -229,7 +229,7 @@ cdef class Vector_numpy_dense(FreeModuleElement): status = numpy.PyArray_SETITEM(self._vector_numpy, numpy.PyArray_GETPTR1(self._vector_numpy, i), self._python_dtype(value)) - #TODO: Throw an error if status == -1 + # TODO: Throw an error if status == -1 cdef get_unsafe(self, Py_ssize_t i) noexcept: """ diff --git a/src/sage/modules/vector_rational_sparse.pyx b/src/sage/modules/vector_rational_sparse.pyx index 2058d9bef25..58100ac033f 100644 --- a/src/sage/modules/vector_rational_sparse.pyx +++ b/src/sage/modules/vector_rational_sparse.pyx @@ -182,7 +182,6 @@ cdef int mpq_vector_set_entry(mpq_vector* v, Py_ssize_t n, mpq_t x) except -1: if n >= v.degree or n < 0: raise IndexError("Index must be between 0 and the degree minus 1.") cdef Py_ssize_t i, m, ins - cdef Py_ssize_t m2, ins2 cdef Py_ssize_t *pos cdef mpq_t *e @@ -201,7 +200,7 @@ cdef int mpq_vector_set_entry(mpq_vector* v, Py_ssize_t n, mpq_t x) except -1: e = v.entries pos = v.positions allocate_mpq_vector(v, v.num_nonzero - 1) - for i from 0 <= i < m: + for i in range(m): # v.entries[i] = e[i] mpq_set(v.entries[i], e[i]) v.positions[i] = pos[i] @@ -230,7 +229,7 @@ cdef int mpq_vector_set_entry(mpq_vector* v, Py_ssize_t n, mpq_t x) except -1: e = v.entries pos = v.positions allocate_mpq_vector(v, v.num_nonzero) - for i from 0 <= i < ins: + for i in range(ins): # v.entries[i] = e[i] mpq_set(v.entries[i], e[i]) mpq_clear(e[i]) diff --git a/src/sage/modules/with_basis/invariant.py b/src/sage/modules/with_basis/invariant.py index 71a4c938424..3408e8abf0b 100644 --- a/src/sage/modules/with_basis/invariant.py +++ b/src/sage/modules/with_basis/invariant.py @@ -799,7 +799,7 @@ def __classcall_private__(cls, M, G, chi, sage: type(T) - Check the ``ValueError``:: + Check the :class:`ValueError`:: sage: from sage.groups.class_function import ClassFunction_libgap sage: chi = ClassFunction_libgap(G, chi) diff --git a/src/sage/modules/with_basis/morphism.py b/src/sage/modules/with_basis/morphism.py index 30b4041f0cb..81f453f8b1a 100644 --- a/src/sage/modules/with_basis/morphism.py +++ b/src/sage/modules/with_basis/morphism.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- r""" Morphisms of modules with a basis @@ -666,9 +665,9 @@ def __init__(self, triangular="upper", unitriangular=False, [True, True, True] """ if key is not None: - self._key_kwds = dict(key=key) + self._key_kwds = {"key": key} else: - self._key_kwds = dict() + self._key_kwds = {} if triangular == "upper": self._dominant_item = attrcall("leading_item", **self._key_kwds) @@ -817,9 +816,9 @@ def section(self): """ Return the section (partial inverse) of ``self``. - Return a partial triangular morphism which is a section of - ``self``. The section morphism raise a ``ValueError`` if asked to - apply on an element which is not in the image of ``self``. + This returns a partial triangular morphism which is a section of + ``self``. The section morphism raises a :class:`ValueError` if + asked to apply on an element which is not in the image of ``self``. EXAMPLES:: From f95e37a38aa44f88f225f7958131e9f987de7d90 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sun, 10 Dec 2023 20:06:35 -0800 Subject: [PATCH 124/145] src/sage/libs/pari/convert_sage_matrix.pyx: Remove distribution = sagemath-pari for now --- src/sage/libs/pari/convert_sage_matrix.pyx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/sage/libs/pari/convert_sage_matrix.pyx b/src/sage/libs/pari/convert_sage_matrix.pyx index dd14eb17abf..9900e26dd64 100644 --- a/src/sage/libs/pari/convert_sage_matrix.pyx +++ b/src/sage/libs/pari/convert_sage_matrix.pyx @@ -1,4 +1,3 @@ -# sage_setup: distribution = sagemath-pari # sage.doctest: needs sage.modules from cypari2.gen cimport Gen From 409d5b491073087528cf31a8dfd5666e5945df9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Chapoton?= Date: Mon, 11 Dec 2023 10:26:31 +0100 Subject: [PATCH 125/145] suggested details --- .../lie_conformal_algebra_with_structure_coefs.py | 14 +++++++------- src/sage/algebras/steenrod/steenrod_algebra.py | 6 +++--- src/sage/algebras/weyl_algebra.py | 8 ++++---- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/sage/algebras/lie_conformal_algebras/lie_conformal_algebra_with_structure_coefs.py b/src/sage/algebras/lie_conformal_algebras/lie_conformal_algebra_with_structure_coefs.py index e56ad62fad0..9f4d129ba36 100644 --- a/src/sage/algebras/lie_conformal_algebras/lie_conformal_algebra_with_structure_coefs.py +++ b/src/sage/algebras/lie_conformal_algebras/lie_conformal_algebra_with_structure_coefs.py @@ -145,17 +145,17 @@ def _standardize_s_coeff(s_coeff, index_set, ce, parity=None): Finite family {('L', 'L'): ((0, ((('L', 1), 1),)), (1, ((('L', 0), 2),)), (3, ((('C', 0), 1/2),)))} """ if parity is None: - parity = (0,)*index_set.cardinality() - index_to_parity = dict(zip(index_set,parity)) + parity = (0,) * index_set.cardinality() + index_to_parity = dict(zip(index_set, parity)) sc = {} - #mypair has a pair of generators + # mypair has a pair of generators for mypair in s_coeff.keys(): - #e.g. v = { 0: { (L,2):3, (G,3):1}, 1:{(L,1),2} } + # e.g. v = { 0: { (L,2):3, (G,3):1}, 1:{(L,1),2} } v = s_coeff[mypair] key = tuple(mypair) vals = {} - for l in v.keys(): - lth_product = {k:y for k,y in v[l].items() if y} + for l in v: + lth_product = {k: y for k, y in v[l].items() if y} if lth_product: vals[l] = lth_product @@ -175,7 +175,7 @@ def _standardize_s_coeff(s_coeff, index_set, ce, parity=None): parsgn = -1 else: parsgn = 1 - maxpole = max(v.keys()) + maxpole = max(v) vals = {} for k in range(maxpole+1): kth_product = {} diff --git a/src/sage/algebras/steenrod/steenrod_algebra.py b/src/sage/algebras/steenrod/steenrod_algebra.py index 2e63a8e9e12..efe22f7b551 100644 --- a/src/sage/algebras/steenrod/steenrod_algebra.py +++ b/src/sage/algebras/steenrod/steenrod_algebra.py @@ -1306,7 +1306,7 @@ def coprod_list(t): if basis == 'milnor': if not self._generic: left = coprod_list(t) - right = [[x-y for (x,y) in zip(t, m)] for m in left] + right = [[x - y for x, y in zip(t, m)] for m in left] old = list(left) left = [] # trim trailing zeros: @@ -1320,14 +1320,14 @@ def coprod_list(t): while a and a[-1] == 0: a = a[:-1] right.append(tuple(a)) - tens = {}.fromkeys(zip(left, right), 1) + tens = dict.fromkeys(zip(left, right), 1) return self.tensor_square()._from_dict(tens, coerce=True) else: # p odd from sage.combinat.permutation import Permutation from .steenrod_algebra_misc import convert_perm from sage.sets.set import Set left_p = coprod_list(t[1]) - right_p = [[x-y for (x,y) in zip(t[1], m)] for m in left_p] + right_p = [[x - y for x, y in zip(t[1], m)] for m in left_p] old = list(left_p) left_p = [] # trim trailing zeros: diff --git a/src/sage/algebras/weyl_algebra.py b/src/sage/algebras/weyl_algebra.py index 657c20fa3a5..28fb2d5d512 100644 --- a/src/sage/algebras/weyl_algebra.py +++ b/src/sage/algebras/weyl_algebra.py @@ -213,7 +213,7 @@ def repr_dx(k): return '' denom = ' '.join('\\partial {}{}'.format(latex(g), exp(e)) for e, g in zip(k, gens) if e != 0) - return ''.join(' \\frac{{\\partial{}}}{{{}}}'.format(exp(total), denom) ) + return ''.join(' \\frac{{\\partial{}}}{{{}}}'.format(exp(total), denom)) repr_x = latex else: def exp(e): @@ -313,7 +313,7 @@ def half_term(mon, polynomial): return '1' ret = ' '.join('{}{}'.format(latex(R.gen(i)), exp(power)) if polynomial else '\\partial {}{}'.format(latex(R.gen(i)), exp(power)) - for i,power in enumerate(mon) if power > 0) + for i, power in enumerate(mon) if power > 0) if not polynomial: return '\\frac{{\\partial{}}}{{{}}}'.format(exp(total), ret) return ret @@ -811,8 +811,8 @@ class options(GlobalOptions): NAME = 'DifferentialWeylAlgebra' module = 'sage.algebras.weyl_algebra' factor_representation = {'default': False, - 'description': 'Controls whether to factor the differentials out or not in the output representations', - 'checker': lambda x: x in [True, False]} + 'description': 'Controls whether to factor the differentials out or not in the output representations', + 'checker': lambda x: x in [True, False]} def _element_constructor_(self, x): """ From 76d020118278e575e0832c040535f3a5b17c9d2a Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Mon, 9 Oct 2023 22:39:38 -0700 Subject: [PATCH 126/145] build/pkgs/cvxpy: Update to 1.4.0 --- build/pkgs/cvxpy/checksums.ini | 6 +++--- build/pkgs/cvxpy/package-version.txt | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build/pkgs/cvxpy/checksums.ini b/build/pkgs/cvxpy/checksums.ini index 128dcda1602..e9075f3f898 100644 --- a/build/pkgs/cvxpy/checksums.ini +++ b/build/pkgs/cvxpy/checksums.ini @@ -1,5 +1,5 @@ tarball=cvxpy-VERSION.tar.gz -sha1=8c87f8f8c2177f917ec2fad7d2b510787ffdf72d -md5=408b0a3140750299207f61de95b4ed6e -cksum=3643150234 +sha1=8d80513117a6a8a4ba14b3ac538a2edebcd3f0f6 +md5=5e12e46626c4fa008d2560b0941c22f1 +cksum=2871212675 upstream_url=https://pypi.io/packages/source/c/cvxpy/cvxpy-VERSION.tar.gz diff --git a/build/pkgs/cvxpy/package-version.txt b/build/pkgs/cvxpy/package-version.txt index f0bb29e7638..88c5fb891dc 100644 --- a/build/pkgs/cvxpy/package-version.txt +++ b/build/pkgs/cvxpy/package-version.txt @@ -1 +1 @@ -1.3.0 +1.4.0 From 3af06b0d84a590776b4522db6c4ed4469f18b22f Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Mon, 9 Oct 2023 22:40:27 -0700 Subject: [PATCH 127/145] build/pkgs/scs: Update to 3.2.3 --- build/pkgs/scs/checksums.ini | 6 +++--- build/pkgs/scs/package-version.txt | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build/pkgs/scs/checksums.ini b/build/pkgs/scs/checksums.ini index 1e2e269bf71..572dded9919 100644 --- a/build/pkgs/scs/checksums.ini +++ b/build/pkgs/scs/checksums.ini @@ -1,5 +1,5 @@ tarball=scs-VERSION.tar.gz -sha1=309a035e5031f7a51c4992d5ad6c9236a406adc2 -md5=c984027aea923fa88e2f73c61bc06dd0 -cksum=1688898932 +sha1=92e4ff21b450c9659f610064eb79e804de9167b4 +md5=dc86b5ed0a0a22453bb88feacf31539a +cksum=4083736723 upstream_url=https://pypi.io/packages/source/s/scs/scs-VERSION.tar.gz diff --git a/build/pkgs/scs/package-version.txt b/build/pkgs/scs/package-version.txt index be94e6f53db..b347b11eac8 100644 --- a/build/pkgs/scs/package-version.txt +++ b/build/pkgs/scs/package-version.txt @@ -1 +1 @@ -3.2.2 +3.2.3 From 67026d65ea46e6f0f1feb82240427c8d3b3ea435 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Mon, 9 Oct 2023 22:40:53 -0700 Subject: [PATCH 128/145] build/pkgs/osqp_python: Update to 0.6.3 --- build/pkgs/osqp_python/checksums.ini | 6 +++--- build/pkgs/osqp_python/package-version.txt | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build/pkgs/osqp_python/checksums.ini b/build/pkgs/osqp_python/checksums.ini index 750d1d8450a..f4edea03b65 100644 --- a/build/pkgs/osqp_python/checksums.ini +++ b/build/pkgs/osqp_python/checksums.ini @@ -1,5 +1,5 @@ tarball=osqp-VERSION.tar.gz -sha1=d69d05b87c03aaaf80ac0bb11e1a68746cf8c486 -md5=ae46dc55aa4ff7a2009db756f2b61d98 -cksum=2780901429 +sha1=3358e48aa6d81496665a8b0ee157465ce6cd329a +md5=22ee4f843ca15a98437f053e47d15e3d +cksum=2552259420 upstream_url=https://pypi.io/packages/source/o/osqp/osqp-VERSION.tar.gz diff --git a/build/pkgs/osqp_python/package-version.txt b/build/pkgs/osqp_python/package-version.txt index 72b079f4d76..844f6a91acb 100644 --- a/build/pkgs/osqp_python/package-version.txt +++ b/build/pkgs/osqp_python/package-version.txt @@ -1 +1 @@ -0.6.2.post8 +0.6.3 From 33d0be2a031eaaf0c2c5a4654bfef1627c87afef Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Mon, 9 Oct 2023 22:41:02 -0700 Subject: [PATCH 129/145] build/pkgs/cvxopt: Update to 1.3.2 --- build/pkgs/cvxopt/checksums.ini | 6 +++--- build/pkgs/cvxopt/package-version.txt | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build/pkgs/cvxopt/checksums.ini b/build/pkgs/cvxopt/checksums.ini index 92f553cd1f1..a09000f2476 100644 --- a/build/pkgs/cvxopt/checksums.ini +++ b/build/pkgs/cvxopt/checksums.ini @@ -1,5 +1,5 @@ tarball=cvxopt-VERSION.tar.gz -sha1=7118b2c490a6596a47049c8ae6e15b3568239cb8 -md5=d94895acf6f41806b482791174e9d0e7 -cksum=2569244181 +sha1=f9c3c3fb61e87d27f05b3b66bc10734d5e6284e6 +md5=ced06e7d92d8a10c84db94589e7f8162 +cksum=2059529268 upstream_url=https://pypi.io/packages/source/c/cvxopt/cvxopt-VERSION.tar.gz diff --git a/build/pkgs/cvxopt/package-version.txt b/build/pkgs/cvxopt/package-version.txt index f0bb29e7638..1892b926767 100644 --- a/build/pkgs/cvxopt/package-version.txt +++ b/build/pkgs/cvxopt/package-version.txt @@ -1 +1 @@ -1.3.0 +1.3.2 From e4df296a632e67406a0262667ba35ce19acb5680 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Wed, 11 Oct 2023 19:34:57 -0700 Subject: [PATCH 130/145] build/pkgs/cylp: Update to 0.91.6 --- build/pkgs/cylp/checksums.ini | 6 +++--- build/pkgs/cylp/package-version.txt | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build/pkgs/cylp/checksums.ini b/build/pkgs/cylp/checksums.ini index 0a073c1569a..d57bc940ac2 100644 --- a/build/pkgs/cylp/checksums.ini +++ b/build/pkgs/cylp/checksums.ini @@ -1,5 +1,5 @@ tarball=cylp-VERSION.tar.gz -sha1=1c2d20933abc48ed2fefc1ae45d8f9492fc2eef2 -md5=ac0308a916dac5dd84f831dbc0fba5c5 -cksum=1532166313 +sha1=edbcc68e1fbf35bb48e8bac136633a1e635d3729 +md5=c9039d0a5d45c9ac124b919855b8ce1f +cksum=1696691984 upstream_url=https://pypi.io/packages/source/c/cylp/cylp-VERSION.tar.gz diff --git a/build/pkgs/cylp/package-version.txt b/build/pkgs/cylp/package-version.txt index 1d5e6c02bae..88bbfa0da89 100644 --- a/build/pkgs/cylp/package-version.txt +++ b/build/pkgs/cylp/package-version.txt @@ -1 +1 @@ -0.91.5 +0.91.6 From 94d4b77833df94095a85d323c4de8e45591ad5e6 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Wed, 11 Oct 2023 22:06:06 -0700 Subject: [PATCH 131/145] build/pkgs/cylp: Add patch for Cython 3 --- build/pkgs/cylp/package-version.txt | 2 +- build/pkgs/cylp/patches/cython3.patch | 399 ++++++++++++++++++++++++++ build/pkgs/cylp/spkg-install.in | 5 +- 3 files changed, 403 insertions(+), 3 deletions(-) create mode 100644 build/pkgs/cylp/patches/cython3.patch diff --git a/build/pkgs/cylp/package-version.txt b/build/pkgs/cylp/package-version.txt index 88bbfa0da89..c182bd4d62b 100644 --- a/build/pkgs/cylp/package-version.txt +++ b/build/pkgs/cylp/package-version.txt @@ -1 +1 @@ -0.91.6 +0.91.6.p1 diff --git a/build/pkgs/cylp/patches/cython3.patch b/build/pkgs/cylp/patches/cython3.patch new file mode 100644 index 00000000000..7e2447f6b01 --- /dev/null +++ b/build/pkgs/cylp/patches/cython3.patch @@ -0,0 +1,399 @@ +From 819e046b0231e9eb7b7c6dda9ab1ba94cf5abccd Mon Sep 17 00:00:00 2001 +From: Matthias Koeppe +Date: Wed, 11 Oct 2023 20:36:35 -0700 +Subject: [PATCH 1/5] Remove outdated self-cimports in pyx files + +--- + cylp/cy/CyCbcNode.pyx | 3 --- + cylp/cy/CyCglCutGeneratorBase.pyx | 3 --- + cylp/cy/CyCglTreeInfo.pyx | 3 --- + cylp/cy/CyCoinModel.pyx | 3 --- + cylp/cy/CyCutGeneratorPythonBase.pyx | 4 ---- + cylp/cy/CyDantzigPivot.pyx | 2 -- + cylp/cy/CyDualPivotPythonBase.pyx | 3 --- + cylp/cy/CyOsiCuts.pyx | 1 - + cylp/cy/CyOsiSolverInterface.pyx | 4 ---- + cylp/cy/CyPivotPythonBase.pyx | 2 -- + cylp/cy/CyWolfePivot.pyx | 2 -- + cylp/cy/createCythonInterface.py | 1 - + 12 files changed, 31 deletions(-) + +diff --git a/cylp/cy/CyCbcNode.pyx b/cylp/cy/CyCbcNode.pyx +index a4092d0..d8da84d 100644 +--- a/cylp/cy/CyCbcNode.pyx ++++ b/cylp/cy/CyCbcNode.pyx +@@ -1,8 +1,5 @@ + # cython: embedsignature=True + +- +-cimport CyCbcNode +- + cdef class CyCbcNode: + def __cinit__(self): + self.CppSelf = new CppICbcNode() +diff --git a/cylp/cy/CyCglCutGeneratorBase.pyx b/cylp/cy/CyCglCutGeneratorBase.pyx +index 0bb324f..a2f2054 100644 +--- a/cylp/cy/CyCglCutGeneratorBase.pyx ++++ b/cylp/cy/CyCglCutGeneratorBase.pyx +@@ -1,8 +1,5 @@ + # cython: embedsignature=True + +-cimport CyCglCutGeneratorBase +-from cylp.cy.CyCglCutGeneratorBase import CyCglCutGeneratorBase +- + cdef void RunGenerateCuts(void *ptr, CppOsiSolverInterface *si, + CppOsiCuts *cs, + CppCglTreeInfo info): +diff --git a/cylp/cy/CyCglTreeInfo.pyx b/cylp/cy/CyCglTreeInfo.pyx +index 5c599bd..7857a02 100644 +--- a/cylp/cy/CyCglTreeInfo.pyx ++++ b/cylp/cy/CyCglTreeInfo.pyx +@@ -1,6 +1,3 @@ +- +-cimport CyCglTreeInfo +- + cdef class CyCglTreeInfo: + 'CyCglTreeInfo documentation' + def __cinit__(self): +diff --git a/cylp/cy/CyCoinModel.pyx b/cylp/cy/CyCoinModel.pyx +index f08b88a..55f038d 100644 +--- a/cylp/cy/CyCoinModel.pyx ++++ b/cylp/cy/CyCoinModel.pyx +@@ -1,8 +1,5 @@ + # cython: embedsignature=True + +- +-from cylp.cy cimport CyCoinModel +- + cdef class CyCoinModel: + ''' + +diff --git a/cylp/cy/CyCutGeneratorPythonBase.pyx b/cylp/cy/CyCutGeneratorPythonBase.pyx +index b067f70..48aa44d 100644 +--- a/cylp/cy/CyCutGeneratorPythonBase.pyx ++++ b/cylp/cy/CyCutGeneratorPythonBase.pyx +@@ -1,9 +1,5 @@ + # cython: embedsignature=True + +- +-cimport CyCutGeneratorPythonBase +- +- + cdef class CyCutGeneratorPythonBase(CyCglCutGeneratorBase): + def __init__(self, cutGeneratorObject, cyLPModel=None): + CyCglCutGeneratorBase.__init__(self) +diff --git a/cylp/cy/CyDantzigPivot.pyx b/cylp/cy/CyDantzigPivot.pyx +index 8089ff4..7714019 100644 +--- a/cylp/cy/CyDantzigPivot.pyx ++++ b/cylp/cy/CyDantzigPivot.pyx +@@ -3,8 +3,6 @@ + + import numpy as np + cimport numpy as np +-cimport CyDantzigPivot +-#cimport CyClpSimplex + + # varStatus defined to mimic 'enum ClpSimplex::Status'. + # But is too slow obviously +diff --git a/cylp/cy/CyDualPivotPythonBase.pyx b/cylp/cy/CyDualPivotPythonBase.pyx +index 89f4ebc..f33d5ae 100644 +--- a/cylp/cy/CyDualPivotPythonBase.pyx ++++ b/cylp/cy/CyDualPivotPythonBase.pyx +@@ -1,8 +1,5 @@ + # cython: embedsignature=True + +- +-cimport CyDualPivotPythonBase +- + cdef class CyDualPivotPythonBase(CyClpDualRowPivotBase): + def __init__(self, dualPivotMethodObject): + CyClpDualRowPivotBase.__init__(self) +diff --git a/cylp/cy/CyOsiCuts.pyx b/cylp/cy/CyOsiCuts.pyx +index 828d32f..f58490f 100644 +--- a/cylp/cy/CyOsiCuts.pyx ++++ b/cylp/cy/CyOsiCuts.pyx +@@ -1,6 +1,5 @@ + import scipy + from scipy.sparse import csr_matrix +-cimport CyOsiCuts + from cylp.py.modeling.CyLPModel import CyLPModel + cimport numpy as np + import numpy as np +diff --git a/cylp/cy/CyOsiSolverInterface.pyx b/cylp/cy/CyOsiSolverInterface.pyx +index b3f0514..5bde926 100644 +--- a/cylp/cy/CyOsiSolverInterface.pyx ++++ b/cylp/cy/CyOsiSolverInterface.pyx +@@ -1,7 +1,3 @@ +- +-cimport CyOsiSolverInterface +- +- + cdef extern from *: + CppOsiClpSolverInterface* dynamic_cast_osi_2_clp "dynamic_cast" (CppOsiSolverInterface*) + CppIClpSimplex* static_cast_clp_2_iclp "static_cast" (CppClpSimplex*) +diff --git a/cylp/cy/CyPivotPythonBase.pyx b/cylp/cy/CyPivotPythonBase.pyx +index ba6a39f..5394fd1 100644 +--- a/cylp/cy/CyPivotPythonBase.pyx ++++ b/cylp/cy/CyPivotPythonBase.pyx +@@ -1,8 +1,6 @@ + # cython: embedsignature=True + + +-cimport CyPivotPythonBase +- + cdef class CyPivotPythonBase(CyClpPrimalColumnPivotBase): + def __init__(self, pivotMethodObject): + CyClpPrimalColumnPivotBase.__init__(self) +diff --git a/cylp/cy/CyWolfePivot.pyx b/cylp/cy/CyWolfePivot.pyx +index 74288cb..de1b14f 100644 +--- a/cylp/cy/CyWolfePivot.pyx ++++ b/cylp/cy/CyWolfePivot.pyx +@@ -1,8 +1,6 @@ + # cython: embedsignature=True + + +-from cylp.cy cimport CyWolfePivot +- + cdef class CyWolfePivot(CyClpPrimalColumnPivotBase): + + cdef pivotColumn(self, CppCoinIndexedVector* cppupdates, CppCoinIndexedVector* cppspareRow1, +diff --git a/cylp/cy/createCythonInterface.py b/cylp/cy/createCythonInterface.py +index 2e284ea..d766d7d 100644 +--- a/cylp/cy/createCythonInterface.py ++++ b/cylp/cy/createCythonInterface.py +@@ -34,7 +34,6 @@ + + #Create the pyx file + pyxContent = ''' +-cimport Cy%s + + cdef class Cy%s: + 'Cy%s documentation' + +From 87785ac27212cb3bfccd621f538db2a4e8c9792c Mon Sep 17 00:00:00 2001 +From: Matthias Koeppe +Date: Wed, 11 Oct 2023 20:57:37 -0700 +Subject: [PATCH 2/5] Use absolute cimports only + +--- + cylp/cy/CyClpSimplex.pyx | 9 ++++----- + cylp/cy/CyCutGeneratorPythonBase.pxd | 8 ++++---- + cylp/cy/CyDantzigPivot.pxd | 2 +- + cylp/cy/CyDualPivotPythonBase.pxd | 2 +- + cylp/cy/CyPEPivot.pxd | 2 +- + cylp/cy/CyPivotPythonBase.pxd | 2 +- + cylp/cy/CyWolfePivot.pxd | 2 +- + 7 files changed, 13 insertions(+), 14 deletions(-) + +diff --git a/cylp/cy/CyClpSimplex.pyx b/cylp/cy/CyClpSimplex.pyx +index c7d5cf2..f6a8bfb 100644 +--- a/cylp/cy/CyClpSimplex.pyx ++++ b/cylp/cy/CyClpSimplex.pyx +@@ -15,11 +15,10 @@ import numpy as np + cimport numpy as np + from scipy import sparse + cimport cpython.ref as cpy_ref +-from CyWolfePivot cimport CyWolfePivot +-from CyPEPivot cimport CyPEPivot +-from CyPivotPythonBase cimport CyPivotPythonBase +-from CyDualPivotPythonBase cimport CyDualPivotPythonBase +-from cylp.cy cimport CyClpSimplex ++from cylp.cy.CyWolfePivot cimport CyWolfePivot ++from cylp.cy.CyPEPivot cimport CyPEPivot ++from cylp.cy.CyPivotPythonBase cimport CyPivotPythonBase ++from cylp.cy.CyDualPivotPythonBase cimport CyDualPivotPythonBase + from cylp.cy cimport CyCoinModel + from cylp.py.utils.sparseUtil import sparseConcat, csc_matrixPlus + from cylp.py.modeling.CyLPModel import CyLPVar, CyLPArray, CyLPSolution +diff --git a/cylp/cy/CyCutGeneratorPythonBase.pxd b/cylp/cy/CyCutGeneratorPythonBase.pxd +index 64ec234..25061c1 100644 +--- a/cylp/cy/CyCutGeneratorPythonBase.pxd ++++ b/cylp/cy/CyCutGeneratorPythonBase.pxd +@@ -1,7 +1,7 @@ +-from CyCglCutGeneratorBase cimport * +-from CyOsiSolverInterface cimport CppOsiSolverInterface, CyOsiSolverInterface +-from CyOsiCuts cimport CppOsiCuts, CyOsiCuts +-from CyCglTreeInfo cimport CppCglTreeInfo, CyCglTreeInfo ++from cylp.cy.CyCglCutGeneratorBase cimport * ++from cylp.cy.CyOsiSolverInterface cimport CppOsiSolverInterface, CyOsiSolverInterface ++from cylp.cy.CyOsiCuts cimport CppOsiCuts, CyOsiCuts ++from cylp.cy.CyCglTreeInfo cimport CppCglTreeInfo, CyCglTreeInfo + cimport cython.operator.dereference as deref + from cylp.cy.CyClpSimplex cimport CyClpSimplex, CppIClpSimplex + from cylp.cy.CyCoinIndexedVector cimport CyCoinIndexedVector +diff --git a/cylp/cy/CyDantzigPivot.pxd b/cylp/cy/CyDantzigPivot.pxd +index d247b0e..bd1a411 100644 +--- a/cylp/cy/CyDantzigPivot.pxd ++++ b/cylp/cy/CyDantzigPivot.pxd +@@ -1,4 +1,4 @@ +-from CyClpPrimalColumnPivotBase cimport * ++from cylp.cy.CyClpPrimalColumnPivotBase cimport * + from cylp.cy cimport CyClpSimplex + from cylp.cy.CyCoinIndexedVector cimport CyCoinIndexedVector + +diff --git a/cylp/cy/CyDualPivotPythonBase.pxd b/cylp/cy/CyDualPivotPythonBase.pxd +index d4adb7d..99ed8ae 100644 +--- a/cylp/cy/CyDualPivotPythonBase.pxd ++++ b/cylp/cy/CyDualPivotPythonBase.pxd +@@ -1,6 +1,6 @@ + import numpy as np + cimport numpy as np +-from CyClpDualRowPivotBase cimport * ++from cylp.cy.CyClpDualRowPivotBase cimport * + cimport cython.operator.dereference as deref + from cylp.cy cimport CyClpSimplex + from cylp.cy.CyCoinIndexedVector cimport CyCoinIndexedVector +diff --git a/cylp/cy/CyPEPivot.pxd b/cylp/cy/CyPEPivot.pxd +index b8d7bab..9a8d9e9 100644 +--- a/cylp/cy/CyPEPivot.pxd ++++ b/cylp/cy/CyPEPivot.pxd +@@ -1,5 +1,5 @@ + cimport cython.operator.dereference as deref +-from CyClpPrimalColumnPivotBase cimport * ++from cylp.cy.CyClpPrimalColumnPivotBase cimport * + from cylp.cy cimport CyClpSimplex + from cylp.cy.CyCoinIndexedVector cimport CyCoinIndexedVector + +diff --git a/cylp/cy/CyPivotPythonBase.pxd b/cylp/cy/CyPivotPythonBase.pxd +index 12d7dc4..3734a6b 100644 +--- a/cylp/cy/CyPivotPythonBase.pxd ++++ b/cylp/cy/CyPivotPythonBase.pxd +@@ -1,4 +1,4 @@ +-from CyClpPrimalColumnPivotBase cimport * ++from cylp.cy.CyClpPrimalColumnPivotBase cimport * + cimport cython.operator.dereference as deref + from cylp.cy.CyClpSimplex cimport CyClpSimplex, CppIClpSimplex + from cylp.cy.CyCoinIndexedVector cimport CyCoinIndexedVector +diff --git a/cylp/cy/CyWolfePivot.pxd b/cylp/cy/CyWolfePivot.pxd +index 27a700f..27a08e0 100644 +--- a/cylp/cy/CyWolfePivot.pxd ++++ b/cylp/cy/CyWolfePivot.pxd +@@ -1,4 +1,4 @@ +-from CyClpPrimalColumnPivotBase cimport * ++from cylp.cy.CyClpPrimalColumnPivotBase cimport * + from cylp.cy cimport CyClpSimplex + from cylp.cy.CyCoinIndexedVector cimport CyCoinIndexedVector + + +From a0a998d4774620543ba5e872d495b179179fdcc2 Mon Sep 17 00:00:00 2001 +From: Matthias Koeppe +Date: Wed, 11 Oct 2023 21:29:43 -0700 +Subject: [PATCH 3/5] Remove a duplicate 'cdef cppclass' + +--- + cylp/cy/CyCglCutGeneratorBase.pxd | 4 ---- + 1 file changed, 4 deletions(-) + +diff --git a/cylp/cy/CyCglCutGeneratorBase.pxd b/cylp/cy/CyCglCutGeneratorBase.pxd +index ba0a8dd..d8d4070 100644 +--- a/cylp/cy/CyCglCutGeneratorBase.pxd ++++ b/cylp/cy/CyCglCutGeneratorBase.pxd +@@ -16,10 +16,6 @@ cdef extern from "CglCutGenerator.hpp": + #CppCglCutGenerator* new_CyCglCutGenerator \ + # "new ICglCutGenerator" () + +-cdef extern from "OsiSolverInterface.hpp": +- cdef cppclass CppOsiSolverInterface "OsiSolverInterface": +- pass +- + cdef extern from "ICglCutGeneratorBase.h": + #cdef cppclass CoinIndexedVector: + # pass + +From 2306dfbfd57150d4c13470ffa07eecb10a644b15 Mon Sep 17 00:00:00 2001 +From: Matthias Koeppe +Date: Wed, 11 Oct 2023 21:36:10 -0700 +Subject: [PATCH 4/5] Do not use cpdef for variables + +--- + cylp/cy/CyClpSimplex.pxd | 4 ++-- + cylp/cy/CyCoinIndexedVector.pxd | 2 +- + cylp/cy/CyCoinMpsIO.pxd | 2 +- + cylp/cy/CyCoinPackedMatrix.pxd | 2 +- + 4 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/cylp/cy/CyClpSimplex.pxd b/cylp/cy/CyClpSimplex.pxd +index fde2b58..b8b2ad0 100644 +--- a/cylp/cy/CyClpSimplex.pxd ++++ b/cylp/cy/CyClpSimplex.pxd +@@ -304,8 +304,8 @@ cdef class CyClpSimplex: + This is the documentation of CyClpSimpelx in the pyx class + ''' + +- cpdef CppIClpSimplex *CppSelf +- cpdef vars ++ cdef CppIClpSimplex *CppSelf ++ cdef vars + cdef object varSelCriteria + cdef CyCoinModel coinModel + cdef object cyLPModel +diff --git a/cylp/cy/CyCoinIndexedVector.pxd b/cylp/cy/CyCoinIndexedVector.pxd +index 7c2215f..97b550f 100644 +--- a/cylp/cy/CyCoinIndexedVector.pxd ++++ b/cylp/cy/CyCoinIndexedVector.pxd +@@ -20,7 +20,7 @@ cdef extern from "ICoinIndexedVector.hpp": + + + cdef class CyCoinIndexedVector: +- cpdef CppCoinIndexedVector *CppSelf ++ cdef CppCoinIndexedVector *CppSelf + cpdef reserve(self, n) + cpdef assign(self, ind, other) + cdef setCppSelf(self, CppCoinIndexedVector* s) +diff --git a/cylp/cy/CyCoinMpsIO.pxd b/cylp/cy/CyCoinMpsIO.pxd +index 23fcd27..f2ac645 100644 +--- a/cylp/cy/CyCoinMpsIO.pxd ++++ b/cylp/cy/CyCoinMpsIO.pxd +@@ -45,7 +45,7 @@ cdef extern from "ICoinMpsIO.hpp": + + cdef class CyCoinMpsIO: + cdef CppICoinMpsIO *CppSelf +- cpdef Hessian ++ cdef Hessian + # cpdef getColLower(self) + # cpdef getColUpper(self) + # cpdef getRowSense(self) +diff --git a/cylp/cy/CyCoinPackedMatrix.pxd b/cylp/cy/CyCoinPackedMatrix.pxd +index 8515921..c1fa0bb 100644 +--- a/cylp/cy/CyCoinPackedMatrix.pxd ++++ b/cylp/cy/CyCoinPackedMatrix.pxd +@@ -25,7 +25,7 @@ cdef extern from "ICoinPackedMatrix.hpp": + + + cdef class CyCoinPackedMatrix: +- cpdef CppCoinPackedMatrix* CppSelf ++ cdef CppCoinPackedMatrix* CppSelf + #cpdef getIndices(self) + #cpdef getElements(self) + #cpdef getNumElements(self) + +From 3bbeb732034b7797a3ef218d84230b6513fc264c Mon Sep 17 00:00:00 2001 +From: Matthias Koeppe +Date: Wed, 11 Oct 2023 21:45:33 -0700 +Subject: [PATCH 5/5] cylp/cy/CyCbcModel.pxd: Update exception specs for Cython + 3 + +--- + cylp/cy/CyCbcModel.pxd | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/cylp/cy/CyCbcModel.pxd b/cylp/cy/CyCbcModel.pxd +index 5e43922..f19a50b 100644 +--- a/cylp/cy/CyCbcModel.pxd ++++ b/cylp/cy/CyCbcModel.pxd +@@ -10,12 +10,12 @@ cdef extern from "CbcCompareUser.hpp": + cdef cppclass CppCbcCompareUser "CbcCompareUser": + pass + ctypedef int (*runTest_t)(void* instance, CppICbcNode* x, +- CppICbcNode* y) ++ CppICbcNode* y) except? -1 + ctypedef bint (*runNewSolution_t)(void*instance, CppICbcModel* model, + double objectiveAtContinuous, +- int numberInfeasibilitiesAtContinuous) ++ int numberInfeasibilitiesAtContinuous) except? -1 + ctypedef int (*runEvery1000Nodes_t)(void* instance, +- CppICbcModel* model, int numberNodes) ++ CppICbcModel* model, int numberNodes) except? -1 + bint equalityTest(CppICbcNode* x, CppICbcNode* y) + + diff --git a/build/pkgs/cylp/spkg-install.in b/build/pkgs/cylp/spkg-install.in index e840732a8e5..96d7ddadef6 100644 --- a/build/pkgs/cylp/spkg-install.in +++ b/build/pkgs/cylp/spkg-install.in @@ -1,5 +1,6 @@ cd src # use pkg-config to discover coin installation unset COIN_INSTALL_DIR -# --no-build-isolation to ignore the numpy version pin in pyproject.toml -sdh_pip_install --no-build-isolation . +# Remove the Cython version bound and numpy version pin in pyproject.toml +sed -i.bak -e "/^ *'Cython/s/Cython[^']*/Cython/;/^ *'.*numpy/s/oldest-supported-numpy/numpy/;" pyproject.toml +sdh_pip_install . From 7f94b4e1d6b14ddf0ac98b644f679c6d4b241e10 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Wed, 11 Oct 2023 22:55:25 -0700 Subject: [PATCH 132/145] build/pkgs/clarabel: New pip package, cvxpy dependency --- build/pkgs/clarabel/SPKG.rst | 18 ++++++++++++++++++ build/pkgs/clarabel/dependencies | 4 ++++ build/pkgs/clarabel/requirements.txt | 1 + build/pkgs/clarabel/type | 1 + 4 files changed, 24 insertions(+) create mode 100644 build/pkgs/clarabel/SPKG.rst create mode 100644 build/pkgs/clarabel/dependencies create mode 100644 build/pkgs/clarabel/requirements.txt create mode 100644 build/pkgs/clarabel/type diff --git a/build/pkgs/clarabel/SPKG.rst b/build/pkgs/clarabel/SPKG.rst new file mode 100644 index 00000000000..a77207536a6 --- /dev/null +++ b/build/pkgs/clarabel/SPKG.rst @@ -0,0 +1,18 @@ +clarabel: Clarabel Conic Interior Point Solver for Rust / Python +================================================================ + +Description +----------- + +Clarabel Conic Interior Point Solver for Rust / Python + +License +------- + +Apache-2.0 + +Upstream Contact +---------------- + +https://pypi.org/project/clarabel/ + diff --git a/build/pkgs/clarabel/dependencies b/build/pkgs/clarabel/dependencies new file mode 100644 index 00000000000..47296a7bace --- /dev/null +++ b/build/pkgs/clarabel/dependencies @@ -0,0 +1,4 @@ + | $(PYTHON_TOOLCHAIN) $(PYTHON) + +---------- +All lines of this file are ignored except the first. diff --git a/build/pkgs/clarabel/requirements.txt b/build/pkgs/clarabel/requirements.txt new file mode 100644 index 00000000000..52160bfd9bd --- /dev/null +++ b/build/pkgs/clarabel/requirements.txt @@ -0,0 +1 @@ +clarabel diff --git a/build/pkgs/clarabel/type b/build/pkgs/clarabel/type new file mode 100644 index 00000000000..134d9bc32d5 --- /dev/null +++ b/build/pkgs/clarabel/type @@ -0,0 +1 @@ +optional From dbe2277721871beac84ba1b0f7bb6b240515edbd Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Wed, 11 Oct 2023 23:06:39 -0700 Subject: [PATCH 133/145] build/pkgs/cvxpy/dependencies: Add clarabel --- build/pkgs/cvxpy/dependencies | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/pkgs/cvxpy/dependencies b/build/pkgs/cvxpy/dependencies index 42cfab890cc..400617f69a8 100644 --- a/build/pkgs/cvxpy/dependencies +++ b/build/pkgs/cvxpy/dependencies @@ -1,4 +1,4 @@ - numpy scipy glpk cvxopt osqp_python ecos_python scs | $(PYTHON_TOOLCHAIN) $(PYTHON) + numpy scipy glpk cvxopt osqp_python ecos_python scs clarabel | $(PYTHON_TOOLCHAIN) $(PYTHON) ---------- All lines of this file are ignored except the first. From 8f04313683c311048b564fd5953faeb44168728b Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Wed, 11 Oct 2023 23:07:47 -0700 Subject: [PATCH 134/145] build/pkgs/{cvxpy,ecos_python,osqp_python,scs}/spkg-install.in: Instead of --no-build-isolation, patch out version constraints in pyproject.toml --- build/pkgs/cvxpy/spkg-install.in | 6 ++++-- build/pkgs/ecos_python/spkg-install.in | 5 +++-- build/pkgs/osqp_python/spkg-install.in | 5 +++-- build/pkgs/scs/spkg-install.in | 5 +++-- 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/build/pkgs/cvxpy/spkg-install.in b/build/pkgs/cvxpy/spkg-install.in index a143d1eff96..87689346ca8 100644 --- a/build/pkgs/cvxpy/spkg-install.in +++ b/build/pkgs/cvxpy/spkg-install.in @@ -1,3 +1,5 @@ cd src -# --no-build-isolation to ignore the numpy version pin in pyproject.toml -sdh_pip_install --no-build-isolation . +# Remove numpy version pin in pyproject.toml +sed -E -i.bak -e "s/numpy[ <>=]+[0-9,.<>= ]+/numpy/;" pyproject.toml +cat pyproject.toml +sdh_pip_install . diff --git a/build/pkgs/ecos_python/spkg-install.in b/build/pkgs/ecos_python/spkg-install.in index a143d1eff96..833ab197b47 100644 --- a/build/pkgs/ecos_python/spkg-install.in +++ b/build/pkgs/ecos_python/spkg-install.in @@ -1,3 +1,4 @@ cd src -# --no-build-isolation to ignore the numpy version pin in pyproject.toml -sdh_pip_install --no-build-isolation . +# Remove numpy version pin in pyproject.toml +sed -i.bak -e "s/oldest-supported-numpy/numpy/;" pyproject.toml +sdh_pip_install . diff --git a/build/pkgs/osqp_python/spkg-install.in b/build/pkgs/osqp_python/spkg-install.in index a143d1eff96..833ab197b47 100644 --- a/build/pkgs/osqp_python/spkg-install.in +++ b/build/pkgs/osqp_python/spkg-install.in @@ -1,3 +1,4 @@ cd src -# --no-build-isolation to ignore the numpy version pin in pyproject.toml -sdh_pip_install --no-build-isolation . +# Remove numpy version pin in pyproject.toml +sed -i.bak -e "s/oldest-supported-numpy/numpy/;" pyproject.toml +sdh_pip_install . diff --git a/build/pkgs/scs/spkg-install.in b/build/pkgs/scs/spkg-install.in index a143d1eff96..7adc0178622 100644 --- a/build/pkgs/scs/spkg-install.in +++ b/build/pkgs/scs/spkg-install.in @@ -1,3 +1,4 @@ cd src -# --no-build-isolation to ignore the numpy version pin in pyproject.toml -sdh_pip_install --no-build-isolation . +# Remove numpy version pin in pyproject.toml +sed -E -i.bak -e "s,setuptools[ <>=]+[0-9.]+,setuptools,;s/oldest-supported-numpy/numpy/;" pyproject.toml +sdh_pip_install . From c1e87d4f22e9c1845c406d154ddd4ab86b7cef9d Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Wed, 25 Oct 2023 23:52:22 -0700 Subject: [PATCH 135/145] build/pkgs/cylp: Update to 0.92.0 --- build/pkgs/cylp/checksums.ini | 6 +++--- build/pkgs/cylp/package-version.txt | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build/pkgs/cylp/checksums.ini b/build/pkgs/cylp/checksums.ini index d57bc940ac2..4b55b3ae7e8 100644 --- a/build/pkgs/cylp/checksums.ini +++ b/build/pkgs/cylp/checksums.ini @@ -1,5 +1,5 @@ tarball=cylp-VERSION.tar.gz -sha1=edbcc68e1fbf35bb48e8bac136633a1e635d3729 -md5=c9039d0a5d45c9ac124b919855b8ce1f -cksum=1696691984 +sha1=709228dcf3b58ea8f9b82fb49cda15de4b9d6b20 +md5=86f431eb98b04a90342879e424086889 +cksum=2094986033 upstream_url=https://pypi.io/packages/source/c/cylp/cylp-VERSION.tar.gz diff --git a/build/pkgs/cylp/package-version.txt b/build/pkgs/cylp/package-version.txt index c182bd4d62b..36545ad338e 100644 --- a/build/pkgs/cylp/package-version.txt +++ b/build/pkgs/cylp/package-version.txt @@ -1 +1 @@ -0.91.6.p1 +0.92.0 From 17735d6ed44708954a36db70cba1ef82078f3be3 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Wed, 25 Oct 2023 23:52:35 -0700 Subject: [PATCH 136/145] build/pkgs/cvxpy: Update to 1.4.1 --- build/pkgs/cvxpy/checksums.ini | 6 +++--- build/pkgs/cvxpy/package-version.txt | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build/pkgs/cvxpy/checksums.ini b/build/pkgs/cvxpy/checksums.ini index e9075f3f898..3f76d4a6228 100644 --- a/build/pkgs/cvxpy/checksums.ini +++ b/build/pkgs/cvxpy/checksums.ini @@ -1,5 +1,5 @@ tarball=cvxpy-VERSION.tar.gz -sha1=8d80513117a6a8a4ba14b3ac538a2edebcd3f0f6 -md5=5e12e46626c4fa008d2560b0941c22f1 -cksum=2871212675 +sha1=1ca24d9e2ee5add13b33724ab9a11e747fe4ed99 +md5=da9fa9feb9634d3562057484b9822889 +cksum=1557666297 upstream_url=https://pypi.io/packages/source/c/cvxpy/cvxpy-VERSION.tar.gz diff --git a/build/pkgs/cvxpy/package-version.txt b/build/pkgs/cvxpy/package-version.txt index 88c5fb891dc..347f5833ee6 100644 --- a/build/pkgs/cvxpy/package-version.txt +++ b/build/pkgs/cvxpy/package-version.txt @@ -1 +1 @@ -1.4.0 +1.4.1 From f009651081097a1494af249f18b95ac475718aab Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sun, 29 Oct 2023 14:32:16 -0700 Subject: [PATCH 137/145] build/pkgs/cylp: Update to 0.92.1 --- build/pkgs/cylp/checksums.ini | 6 +++--- build/pkgs/cylp/package-version.txt | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build/pkgs/cylp/checksums.ini b/build/pkgs/cylp/checksums.ini index 4b55b3ae7e8..af3bfec5106 100644 --- a/build/pkgs/cylp/checksums.ini +++ b/build/pkgs/cylp/checksums.ini @@ -1,5 +1,5 @@ tarball=cylp-VERSION.tar.gz -sha1=709228dcf3b58ea8f9b82fb49cda15de4b9d6b20 -md5=86f431eb98b04a90342879e424086889 -cksum=2094986033 +sha1=58a611bf775ed40e9a1ed90f2a0ae2a24781e8d3 +md5=0b967d6144bd6012fadfa28ead64bcc2 +cksum=3545374197 upstream_url=https://pypi.io/packages/source/c/cylp/cylp-VERSION.tar.gz diff --git a/build/pkgs/cylp/package-version.txt b/build/pkgs/cylp/package-version.txt index 36545ad338e..da011ce41e1 100644 --- a/build/pkgs/cylp/package-version.txt +++ b/build/pkgs/cylp/package-version.txt @@ -1 +1 @@ -0.92.0 +0.92.1 From ed79483e93dde5e3869df124189c2e1079b94848 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Thu, 2 Nov 2023 10:24:32 -0700 Subject: [PATCH 138/145] build/pkgs/cylp/patches/cython3.patch: Remove (upstreamed) --- build/pkgs/cylp/patches/cython3.patch | 399 -------------------------- 1 file changed, 399 deletions(-) delete mode 100644 build/pkgs/cylp/patches/cython3.patch diff --git a/build/pkgs/cylp/patches/cython3.patch b/build/pkgs/cylp/patches/cython3.patch deleted file mode 100644 index 7e2447f6b01..00000000000 --- a/build/pkgs/cylp/patches/cython3.patch +++ /dev/null @@ -1,399 +0,0 @@ -From 819e046b0231e9eb7b7c6dda9ab1ba94cf5abccd Mon Sep 17 00:00:00 2001 -From: Matthias Koeppe -Date: Wed, 11 Oct 2023 20:36:35 -0700 -Subject: [PATCH 1/5] Remove outdated self-cimports in pyx files - ---- - cylp/cy/CyCbcNode.pyx | 3 --- - cylp/cy/CyCglCutGeneratorBase.pyx | 3 --- - cylp/cy/CyCglTreeInfo.pyx | 3 --- - cylp/cy/CyCoinModel.pyx | 3 --- - cylp/cy/CyCutGeneratorPythonBase.pyx | 4 ---- - cylp/cy/CyDantzigPivot.pyx | 2 -- - cylp/cy/CyDualPivotPythonBase.pyx | 3 --- - cylp/cy/CyOsiCuts.pyx | 1 - - cylp/cy/CyOsiSolverInterface.pyx | 4 ---- - cylp/cy/CyPivotPythonBase.pyx | 2 -- - cylp/cy/CyWolfePivot.pyx | 2 -- - cylp/cy/createCythonInterface.py | 1 - - 12 files changed, 31 deletions(-) - -diff --git a/cylp/cy/CyCbcNode.pyx b/cylp/cy/CyCbcNode.pyx -index a4092d0..d8da84d 100644 ---- a/cylp/cy/CyCbcNode.pyx -+++ b/cylp/cy/CyCbcNode.pyx -@@ -1,8 +1,5 @@ - # cython: embedsignature=True - -- --cimport CyCbcNode -- - cdef class CyCbcNode: - def __cinit__(self): - self.CppSelf = new CppICbcNode() -diff --git a/cylp/cy/CyCglCutGeneratorBase.pyx b/cylp/cy/CyCglCutGeneratorBase.pyx -index 0bb324f..a2f2054 100644 ---- a/cylp/cy/CyCglCutGeneratorBase.pyx -+++ b/cylp/cy/CyCglCutGeneratorBase.pyx -@@ -1,8 +1,5 @@ - # cython: embedsignature=True - --cimport CyCglCutGeneratorBase --from cylp.cy.CyCglCutGeneratorBase import CyCglCutGeneratorBase -- - cdef void RunGenerateCuts(void *ptr, CppOsiSolverInterface *si, - CppOsiCuts *cs, - CppCglTreeInfo info): -diff --git a/cylp/cy/CyCglTreeInfo.pyx b/cylp/cy/CyCglTreeInfo.pyx -index 5c599bd..7857a02 100644 ---- a/cylp/cy/CyCglTreeInfo.pyx -+++ b/cylp/cy/CyCglTreeInfo.pyx -@@ -1,6 +1,3 @@ -- --cimport CyCglTreeInfo -- - cdef class CyCglTreeInfo: - 'CyCglTreeInfo documentation' - def __cinit__(self): -diff --git a/cylp/cy/CyCoinModel.pyx b/cylp/cy/CyCoinModel.pyx -index f08b88a..55f038d 100644 ---- a/cylp/cy/CyCoinModel.pyx -+++ b/cylp/cy/CyCoinModel.pyx -@@ -1,8 +1,5 @@ - # cython: embedsignature=True - -- --from cylp.cy cimport CyCoinModel -- - cdef class CyCoinModel: - ''' - -diff --git a/cylp/cy/CyCutGeneratorPythonBase.pyx b/cylp/cy/CyCutGeneratorPythonBase.pyx -index b067f70..48aa44d 100644 ---- a/cylp/cy/CyCutGeneratorPythonBase.pyx -+++ b/cylp/cy/CyCutGeneratorPythonBase.pyx -@@ -1,9 +1,5 @@ - # cython: embedsignature=True - -- --cimport CyCutGeneratorPythonBase -- -- - cdef class CyCutGeneratorPythonBase(CyCglCutGeneratorBase): - def __init__(self, cutGeneratorObject, cyLPModel=None): - CyCglCutGeneratorBase.__init__(self) -diff --git a/cylp/cy/CyDantzigPivot.pyx b/cylp/cy/CyDantzigPivot.pyx -index 8089ff4..7714019 100644 ---- a/cylp/cy/CyDantzigPivot.pyx -+++ b/cylp/cy/CyDantzigPivot.pyx -@@ -3,8 +3,6 @@ - - import numpy as np - cimport numpy as np --cimport CyDantzigPivot --#cimport CyClpSimplex - - # varStatus defined to mimic 'enum ClpSimplex::Status'. - # But is too slow obviously -diff --git a/cylp/cy/CyDualPivotPythonBase.pyx b/cylp/cy/CyDualPivotPythonBase.pyx -index 89f4ebc..f33d5ae 100644 ---- a/cylp/cy/CyDualPivotPythonBase.pyx -+++ b/cylp/cy/CyDualPivotPythonBase.pyx -@@ -1,8 +1,5 @@ - # cython: embedsignature=True - -- --cimport CyDualPivotPythonBase -- - cdef class CyDualPivotPythonBase(CyClpDualRowPivotBase): - def __init__(self, dualPivotMethodObject): - CyClpDualRowPivotBase.__init__(self) -diff --git a/cylp/cy/CyOsiCuts.pyx b/cylp/cy/CyOsiCuts.pyx -index 828d32f..f58490f 100644 ---- a/cylp/cy/CyOsiCuts.pyx -+++ b/cylp/cy/CyOsiCuts.pyx -@@ -1,6 +1,5 @@ - import scipy - from scipy.sparse import csr_matrix --cimport CyOsiCuts - from cylp.py.modeling.CyLPModel import CyLPModel - cimport numpy as np - import numpy as np -diff --git a/cylp/cy/CyOsiSolverInterface.pyx b/cylp/cy/CyOsiSolverInterface.pyx -index b3f0514..5bde926 100644 ---- a/cylp/cy/CyOsiSolverInterface.pyx -+++ b/cylp/cy/CyOsiSolverInterface.pyx -@@ -1,7 +1,3 @@ -- --cimport CyOsiSolverInterface -- -- - cdef extern from *: - CppOsiClpSolverInterface* dynamic_cast_osi_2_clp "dynamic_cast" (CppOsiSolverInterface*) - CppIClpSimplex* static_cast_clp_2_iclp "static_cast" (CppClpSimplex*) -diff --git a/cylp/cy/CyPivotPythonBase.pyx b/cylp/cy/CyPivotPythonBase.pyx -index ba6a39f..5394fd1 100644 ---- a/cylp/cy/CyPivotPythonBase.pyx -+++ b/cylp/cy/CyPivotPythonBase.pyx -@@ -1,8 +1,6 @@ - # cython: embedsignature=True - - --cimport CyPivotPythonBase -- - cdef class CyPivotPythonBase(CyClpPrimalColumnPivotBase): - def __init__(self, pivotMethodObject): - CyClpPrimalColumnPivotBase.__init__(self) -diff --git a/cylp/cy/CyWolfePivot.pyx b/cylp/cy/CyWolfePivot.pyx -index 74288cb..de1b14f 100644 ---- a/cylp/cy/CyWolfePivot.pyx -+++ b/cylp/cy/CyWolfePivot.pyx -@@ -1,8 +1,6 @@ - # cython: embedsignature=True - - --from cylp.cy cimport CyWolfePivot -- - cdef class CyWolfePivot(CyClpPrimalColumnPivotBase): - - cdef pivotColumn(self, CppCoinIndexedVector* cppupdates, CppCoinIndexedVector* cppspareRow1, -diff --git a/cylp/cy/createCythonInterface.py b/cylp/cy/createCythonInterface.py -index 2e284ea..d766d7d 100644 ---- a/cylp/cy/createCythonInterface.py -+++ b/cylp/cy/createCythonInterface.py -@@ -34,7 +34,6 @@ - - #Create the pyx file - pyxContent = ''' --cimport Cy%s - - cdef class Cy%s: - 'Cy%s documentation' - -From 87785ac27212cb3bfccd621f538db2a4e8c9792c Mon Sep 17 00:00:00 2001 -From: Matthias Koeppe -Date: Wed, 11 Oct 2023 20:57:37 -0700 -Subject: [PATCH 2/5] Use absolute cimports only - ---- - cylp/cy/CyClpSimplex.pyx | 9 ++++----- - cylp/cy/CyCutGeneratorPythonBase.pxd | 8 ++++---- - cylp/cy/CyDantzigPivot.pxd | 2 +- - cylp/cy/CyDualPivotPythonBase.pxd | 2 +- - cylp/cy/CyPEPivot.pxd | 2 +- - cylp/cy/CyPivotPythonBase.pxd | 2 +- - cylp/cy/CyWolfePivot.pxd | 2 +- - 7 files changed, 13 insertions(+), 14 deletions(-) - -diff --git a/cylp/cy/CyClpSimplex.pyx b/cylp/cy/CyClpSimplex.pyx -index c7d5cf2..f6a8bfb 100644 ---- a/cylp/cy/CyClpSimplex.pyx -+++ b/cylp/cy/CyClpSimplex.pyx -@@ -15,11 +15,10 @@ import numpy as np - cimport numpy as np - from scipy import sparse - cimport cpython.ref as cpy_ref --from CyWolfePivot cimport CyWolfePivot --from CyPEPivot cimport CyPEPivot --from CyPivotPythonBase cimport CyPivotPythonBase --from CyDualPivotPythonBase cimport CyDualPivotPythonBase --from cylp.cy cimport CyClpSimplex -+from cylp.cy.CyWolfePivot cimport CyWolfePivot -+from cylp.cy.CyPEPivot cimport CyPEPivot -+from cylp.cy.CyPivotPythonBase cimport CyPivotPythonBase -+from cylp.cy.CyDualPivotPythonBase cimport CyDualPivotPythonBase - from cylp.cy cimport CyCoinModel - from cylp.py.utils.sparseUtil import sparseConcat, csc_matrixPlus - from cylp.py.modeling.CyLPModel import CyLPVar, CyLPArray, CyLPSolution -diff --git a/cylp/cy/CyCutGeneratorPythonBase.pxd b/cylp/cy/CyCutGeneratorPythonBase.pxd -index 64ec234..25061c1 100644 ---- a/cylp/cy/CyCutGeneratorPythonBase.pxd -+++ b/cylp/cy/CyCutGeneratorPythonBase.pxd -@@ -1,7 +1,7 @@ --from CyCglCutGeneratorBase cimport * --from CyOsiSolverInterface cimport CppOsiSolverInterface, CyOsiSolverInterface --from CyOsiCuts cimport CppOsiCuts, CyOsiCuts --from CyCglTreeInfo cimport CppCglTreeInfo, CyCglTreeInfo -+from cylp.cy.CyCglCutGeneratorBase cimport * -+from cylp.cy.CyOsiSolverInterface cimport CppOsiSolverInterface, CyOsiSolverInterface -+from cylp.cy.CyOsiCuts cimport CppOsiCuts, CyOsiCuts -+from cylp.cy.CyCglTreeInfo cimport CppCglTreeInfo, CyCglTreeInfo - cimport cython.operator.dereference as deref - from cylp.cy.CyClpSimplex cimport CyClpSimplex, CppIClpSimplex - from cylp.cy.CyCoinIndexedVector cimport CyCoinIndexedVector -diff --git a/cylp/cy/CyDantzigPivot.pxd b/cylp/cy/CyDantzigPivot.pxd -index d247b0e..bd1a411 100644 ---- a/cylp/cy/CyDantzigPivot.pxd -+++ b/cylp/cy/CyDantzigPivot.pxd -@@ -1,4 +1,4 @@ --from CyClpPrimalColumnPivotBase cimport * -+from cylp.cy.CyClpPrimalColumnPivotBase cimport * - from cylp.cy cimport CyClpSimplex - from cylp.cy.CyCoinIndexedVector cimport CyCoinIndexedVector - -diff --git a/cylp/cy/CyDualPivotPythonBase.pxd b/cylp/cy/CyDualPivotPythonBase.pxd -index d4adb7d..99ed8ae 100644 ---- a/cylp/cy/CyDualPivotPythonBase.pxd -+++ b/cylp/cy/CyDualPivotPythonBase.pxd -@@ -1,6 +1,6 @@ - import numpy as np - cimport numpy as np --from CyClpDualRowPivotBase cimport * -+from cylp.cy.CyClpDualRowPivotBase cimport * - cimport cython.operator.dereference as deref - from cylp.cy cimport CyClpSimplex - from cylp.cy.CyCoinIndexedVector cimport CyCoinIndexedVector -diff --git a/cylp/cy/CyPEPivot.pxd b/cylp/cy/CyPEPivot.pxd -index b8d7bab..9a8d9e9 100644 ---- a/cylp/cy/CyPEPivot.pxd -+++ b/cylp/cy/CyPEPivot.pxd -@@ -1,5 +1,5 @@ - cimport cython.operator.dereference as deref --from CyClpPrimalColumnPivotBase cimport * -+from cylp.cy.CyClpPrimalColumnPivotBase cimport * - from cylp.cy cimport CyClpSimplex - from cylp.cy.CyCoinIndexedVector cimport CyCoinIndexedVector - -diff --git a/cylp/cy/CyPivotPythonBase.pxd b/cylp/cy/CyPivotPythonBase.pxd -index 12d7dc4..3734a6b 100644 ---- a/cylp/cy/CyPivotPythonBase.pxd -+++ b/cylp/cy/CyPivotPythonBase.pxd -@@ -1,4 +1,4 @@ --from CyClpPrimalColumnPivotBase cimport * -+from cylp.cy.CyClpPrimalColumnPivotBase cimport * - cimport cython.operator.dereference as deref - from cylp.cy.CyClpSimplex cimport CyClpSimplex, CppIClpSimplex - from cylp.cy.CyCoinIndexedVector cimport CyCoinIndexedVector -diff --git a/cylp/cy/CyWolfePivot.pxd b/cylp/cy/CyWolfePivot.pxd -index 27a700f..27a08e0 100644 ---- a/cylp/cy/CyWolfePivot.pxd -+++ b/cylp/cy/CyWolfePivot.pxd -@@ -1,4 +1,4 @@ --from CyClpPrimalColumnPivotBase cimport * -+from cylp.cy.CyClpPrimalColumnPivotBase cimport * - from cylp.cy cimport CyClpSimplex - from cylp.cy.CyCoinIndexedVector cimport CyCoinIndexedVector - - -From a0a998d4774620543ba5e872d495b179179fdcc2 Mon Sep 17 00:00:00 2001 -From: Matthias Koeppe -Date: Wed, 11 Oct 2023 21:29:43 -0700 -Subject: [PATCH 3/5] Remove a duplicate 'cdef cppclass' - ---- - cylp/cy/CyCglCutGeneratorBase.pxd | 4 ---- - 1 file changed, 4 deletions(-) - -diff --git a/cylp/cy/CyCglCutGeneratorBase.pxd b/cylp/cy/CyCglCutGeneratorBase.pxd -index ba0a8dd..d8d4070 100644 ---- a/cylp/cy/CyCglCutGeneratorBase.pxd -+++ b/cylp/cy/CyCglCutGeneratorBase.pxd -@@ -16,10 +16,6 @@ cdef extern from "CglCutGenerator.hpp": - #CppCglCutGenerator* new_CyCglCutGenerator \ - # "new ICglCutGenerator" () - --cdef extern from "OsiSolverInterface.hpp": -- cdef cppclass CppOsiSolverInterface "OsiSolverInterface": -- pass -- - cdef extern from "ICglCutGeneratorBase.h": - #cdef cppclass CoinIndexedVector: - # pass - -From 2306dfbfd57150d4c13470ffa07eecb10a644b15 Mon Sep 17 00:00:00 2001 -From: Matthias Koeppe -Date: Wed, 11 Oct 2023 21:36:10 -0700 -Subject: [PATCH 4/5] Do not use cpdef for variables - ---- - cylp/cy/CyClpSimplex.pxd | 4 ++-- - cylp/cy/CyCoinIndexedVector.pxd | 2 +- - cylp/cy/CyCoinMpsIO.pxd | 2 +- - cylp/cy/CyCoinPackedMatrix.pxd | 2 +- - 4 files changed, 5 insertions(+), 5 deletions(-) - -diff --git a/cylp/cy/CyClpSimplex.pxd b/cylp/cy/CyClpSimplex.pxd -index fde2b58..b8b2ad0 100644 ---- a/cylp/cy/CyClpSimplex.pxd -+++ b/cylp/cy/CyClpSimplex.pxd -@@ -304,8 +304,8 @@ cdef class CyClpSimplex: - This is the documentation of CyClpSimpelx in the pyx class - ''' - -- cpdef CppIClpSimplex *CppSelf -- cpdef vars -+ cdef CppIClpSimplex *CppSelf -+ cdef vars - cdef object varSelCriteria - cdef CyCoinModel coinModel - cdef object cyLPModel -diff --git a/cylp/cy/CyCoinIndexedVector.pxd b/cylp/cy/CyCoinIndexedVector.pxd -index 7c2215f..97b550f 100644 ---- a/cylp/cy/CyCoinIndexedVector.pxd -+++ b/cylp/cy/CyCoinIndexedVector.pxd -@@ -20,7 +20,7 @@ cdef extern from "ICoinIndexedVector.hpp": - - - cdef class CyCoinIndexedVector: -- cpdef CppCoinIndexedVector *CppSelf -+ cdef CppCoinIndexedVector *CppSelf - cpdef reserve(self, n) - cpdef assign(self, ind, other) - cdef setCppSelf(self, CppCoinIndexedVector* s) -diff --git a/cylp/cy/CyCoinMpsIO.pxd b/cylp/cy/CyCoinMpsIO.pxd -index 23fcd27..f2ac645 100644 ---- a/cylp/cy/CyCoinMpsIO.pxd -+++ b/cylp/cy/CyCoinMpsIO.pxd -@@ -45,7 +45,7 @@ cdef extern from "ICoinMpsIO.hpp": - - cdef class CyCoinMpsIO: - cdef CppICoinMpsIO *CppSelf -- cpdef Hessian -+ cdef Hessian - # cpdef getColLower(self) - # cpdef getColUpper(self) - # cpdef getRowSense(self) -diff --git a/cylp/cy/CyCoinPackedMatrix.pxd b/cylp/cy/CyCoinPackedMatrix.pxd -index 8515921..c1fa0bb 100644 ---- a/cylp/cy/CyCoinPackedMatrix.pxd -+++ b/cylp/cy/CyCoinPackedMatrix.pxd -@@ -25,7 +25,7 @@ cdef extern from "ICoinPackedMatrix.hpp": - - - cdef class CyCoinPackedMatrix: -- cpdef CppCoinPackedMatrix* CppSelf -+ cdef CppCoinPackedMatrix* CppSelf - #cpdef getIndices(self) - #cpdef getElements(self) - #cpdef getNumElements(self) - -From 3bbeb732034b7797a3ef218d84230b6513fc264c Mon Sep 17 00:00:00 2001 -From: Matthias Koeppe -Date: Wed, 11 Oct 2023 21:45:33 -0700 -Subject: [PATCH 5/5] cylp/cy/CyCbcModel.pxd: Update exception specs for Cython - 3 - ---- - cylp/cy/CyCbcModel.pxd | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/cylp/cy/CyCbcModel.pxd b/cylp/cy/CyCbcModel.pxd -index 5e43922..f19a50b 100644 ---- a/cylp/cy/CyCbcModel.pxd -+++ b/cylp/cy/CyCbcModel.pxd -@@ -10,12 +10,12 @@ cdef extern from "CbcCompareUser.hpp": - cdef cppclass CppCbcCompareUser "CbcCompareUser": - pass - ctypedef int (*runTest_t)(void* instance, CppICbcNode* x, -- CppICbcNode* y) -+ CppICbcNode* y) except? -1 - ctypedef bint (*runNewSolution_t)(void*instance, CppICbcModel* model, - double objectiveAtContinuous, -- int numberInfeasibilitiesAtContinuous) -+ int numberInfeasibilitiesAtContinuous) except? -1 - ctypedef int (*runEvery1000Nodes_t)(void* instance, -- CppICbcModel* model, int numberNodes) -+ CppICbcModel* model, int numberNodes) except? -1 - bint equalityTest(CppICbcNode* x, CppICbcNode* y) - - From 5279474a5de774ef5d83062330d7a8a78a7b9ec2 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Thu, 2 Nov 2023 10:24:45 -0700 Subject: [PATCH 139/145] build/pkgs/cylp: Update to 0.92.2 --- build/pkgs/cylp/checksums.ini | 6 +++--- build/pkgs/cylp/package-version.txt | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build/pkgs/cylp/checksums.ini b/build/pkgs/cylp/checksums.ini index af3bfec5106..570be6d38a8 100644 --- a/build/pkgs/cylp/checksums.ini +++ b/build/pkgs/cylp/checksums.ini @@ -1,5 +1,5 @@ tarball=cylp-VERSION.tar.gz -sha1=58a611bf775ed40e9a1ed90f2a0ae2a24781e8d3 -md5=0b967d6144bd6012fadfa28ead64bcc2 -cksum=3545374197 +sha1=22398052ca88123b77e691a0045806a030c9b259 +md5=ac00f775af15afcee1b7932144441ec0 +cksum=2746382211 upstream_url=https://pypi.io/packages/source/c/cylp/cylp-VERSION.tar.gz diff --git a/build/pkgs/cylp/package-version.txt b/build/pkgs/cylp/package-version.txt index da011ce41e1..1afbfdb8a4c 100644 --- a/build/pkgs/cylp/package-version.txt +++ b/build/pkgs/cylp/package-version.txt @@ -1 +1 @@ -0.92.1 +0.92.2 From d91ccbb797171f137edb88c0845d93a022cdc58b Mon Sep 17 00:00:00 2001 From: Dima Pasechnik Date: Mon, 11 Dec 2023 14:18:25 +0000 Subject: [PATCH 140/145] allow -0.0 as well as 0.0 --- src/sage/numerical/backends/cvxopt_backend.pyx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sage/numerical/backends/cvxopt_backend.pyx b/src/sage/numerical/backends/cvxopt_backend.pyx index 0e2f3b82896..045c661b9c8 100644 --- a/src/sage/numerical/backends/cvxopt_backend.pyx +++ b/src/sage/numerical/backends/cvxopt_backend.pyx @@ -487,9 +487,9 @@ cdef class CVXOPTBackend(GenericBackend): 100.0 sage: N(g.solve(), digits=4) 100.0 - sage: N(g.get_values(xg[0]), 2) + sage: N(g.get_values(xg[0]), 2) # abstol 1e-15 0.00 - sage: N(g.get_values(xg[1]), 2) + sage: N(g.get_values(xg[1]), 2) # abstol 1e-15 0.00 sage: N(g.get_values(xg[2]), digits=4) 100.0 From 3bc7ea6a2579fb1b9ba4501fe6024178f74190e3 Mon Sep 17 00:00:00 2001 From: Dima Pasechnik Date: Mon, 11 Dec 2023 14:27:07 +0000 Subject: [PATCH 141/145] doctest fix --- src/sage/numerical/backends/cvxpy_backend.pyx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/sage/numerical/backends/cvxpy_backend.pyx b/src/sage/numerical/backends/cvxpy_backend.pyx index 1cbba9f6375..c07d33e5ae7 100644 --- a/src/sage/numerical/backends/cvxpy_backend.pyx +++ b/src/sage/numerical/backends/cvxpy_backend.pyx @@ -155,6 +155,8 @@ cdef class CVXPYBackend: sage: p.set_objective(b[1] + b[2]) sage: cp = copy(p.get_backend()) sage: cp.solve() + doctest:warning...: + FutureWarning:... 0 sage: cp.get_objective_value() # abs tol 1e-7 6.0 From 9641ecad81906920aa8b9956bb36fd29cb4943f9 Mon Sep 17 00:00:00 2001 From: Aman Date: Mon, 11 Dec 2023 23:05:09 +0530 Subject: [PATCH 142/145] sorted the roots based only on img part --- src/sage/rings/polynomial/polynomial_element.pyx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/sage/rings/polynomial/polynomial_element.pyx b/src/sage/rings/polynomial/polynomial_element.pyx index 5d61c12660f..f143092e2c8 100644 --- a/src/sage/rings/polynomial/polynomial_element.pyx +++ b/src/sage/rings/polynomial/polynomial_element.pyx @@ -8105,7 +8105,7 @@ cdef class Polynomial(CommutativePolynomial): ....: f2 = x2^3 - fld_out(2) ....: for algo in (None, 'pari', 'numpy'): ....: rts = f.roots(ring=fld_out, multiplicities=False) - ....: rts = sorted(rts, key=lambda x: (x.real(), x.imag())) + ....: rts = sorted(rts, key=lambda x: x.imag()) ....: if fld_in == fld_out and algo is None: ....: print("{} {}".format(fld_in, rts)) ....: for rt in rts: @@ -8114,9 +8114,9 @@ cdef class Polynomial(CommutativePolynomial): Real Field with 53 bits of precision [1.25992104989487] Real Double Field [1.25992104989...] Real Field with 100 bits of precision [1.2599210498948731647672106073] - Complex Field with 53 bits of precision [-0.62996052494743... - 1.09112363597172*I, -0.62996052494743... + 1.09112363597172*I, 1.25992104989487] - Complex Double Field [-0.629960524947... - 1.0911236359717...*I, -0.629960524947... + 1.0911236359717...*I, 1.25992104989...] - Complex Field with 100 bits of precision [-0.62996052494743658238360530364 - 1.0911236359717214035600726142*I, -0.62996052494743658238360530364 + 1.0911236359717214035600726142*I, 1.2599210498948731647672106073] + Complex Field with 53 bits of precision [-0.62996052494743... - 1.09112363597172*I, 1.25992104989487, -0.62996052494743... + 1.09112363597172*I] + Complex Double Field [-0.629960524947... - 1.091123635971722*I, 1.2599210498948736, -0.629960524947... + 1.0911236359717218*I] + Complex Field with 100 bits of precision [-0.62996052494743658238360530364 - 1.0911236359717214035600726142*I, 1.2599210498948731647672106073, -0.62996052494743658238360530364 + 1.0911236359717214035600726142*I] Note that we can find the roots of a polynomial with algebraic coefficients:: From a921710a93d005286c9617d37f889d0ec2f600f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= Date: Mon, 11 Dec 2023 15:19:37 -0300 Subject: [PATCH 143/145] Fix doctest for giac 1.9.0-73 --- src/sage/calculus/calculus.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sage/calculus/calculus.py b/src/sage/calculus/calculus.py index dfaafb4353f..8d62ade24c8 100644 --- a/src/sage/calculus/calculus.py +++ b/src/sage/calculus/calculus.py @@ -568,8 +568,8 @@ def symbolic_sum(expression, v, a, b, algorithm='maxima', hold=False): An example of this summation with Giac:: - sage: symbolic_sum(1/(1+k^2), k, -oo, oo, algorithm='giac') - (pi*e^(2*pi) - pi*e^(-2*pi))/(e^(2*pi) + e^(-2*pi) - 2) + sage: symbolic_sum(1/(1+k^2), k, -oo, oo, algorithm='giac').factor() + pi*(e^(2*pi) + 1)/((e^pi + 1)*(e^pi - 1)) The same summation is solved by SymPy:: From 4c46019cf97c219d3aecd65991d52fa47248ee0d Mon Sep 17 00:00:00 2001 From: Aman Date: Tue, 12 Dec 2023 06:29:31 +0530 Subject: [PATCH 144/145] corrected the test cases --- src/sage/rings/polynomial/polynomial_element.pyx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sage/rings/polynomial/polynomial_element.pyx b/src/sage/rings/polynomial/polynomial_element.pyx index f143092e2c8..94d6aac82b5 100644 --- a/src/sage/rings/polynomial/polynomial_element.pyx +++ b/src/sage/rings/polynomial/polynomial_element.pyx @@ -8115,7 +8115,7 @@ cdef class Polynomial(CommutativePolynomial): Real Double Field [1.25992104989...] Real Field with 100 bits of precision [1.2599210498948731647672106073] Complex Field with 53 bits of precision [-0.62996052494743... - 1.09112363597172*I, 1.25992104989487, -0.62996052494743... + 1.09112363597172*I] - Complex Double Field [-0.629960524947... - 1.091123635971722*I, 1.2599210498948736, -0.629960524947... + 1.0911236359717218*I] + Complex Double Field [-0.629960524947... - 1.0911236359717...*I, 1.25992104989487..., -0.629960524947... + 1.0911236359717...*I] Complex Field with 100 bits of precision [-0.62996052494743658238360530364 - 1.0911236359717214035600726142*I, 1.2599210498948731647672106073, -0.62996052494743658238360530364 + 1.0911236359717214035600726142*I] Note that we can find the roots of a polynomial with algebraic From e2e0f8db21e0dc1aafbf79b4c38b507ba78a97aa Mon Sep 17 00:00:00 2001 From: Release Manager Date: Thu, 14 Dec 2023 00:55:41 +0100 Subject: [PATCH 145/145] Updated SageMath version to 10.3.beta2 --- CITATION.cff | 4 ++-- VERSION.txt | 2 +- build/pkgs/configure/checksums.ini | 6 +++--- build/pkgs/configure/package-version.txt | 2 +- build/pkgs/sage_conf/install-requires.txt | 2 +- build/pkgs/sage_docbuild/install-requires.txt | 2 +- build/pkgs/sage_setup/install-requires.txt | 2 +- build/pkgs/sage_sws2rst/install-requires.txt | 2 +- build/pkgs/sagelib/install-requires.txt | 2 +- build/pkgs/sagemath_bliss/install-requires.txt | 2 +- build/pkgs/sagemath_categories/install-requires.txt | 2 +- build/pkgs/sagemath_coxeter3/install-requires.txt | 2 +- build/pkgs/sagemath_environment/install-requires.txt | 2 +- build/pkgs/sagemath_mcqd/install-requires.txt | 2 +- build/pkgs/sagemath_meataxe/install-requires.txt | 2 +- build/pkgs/sagemath_objects/install-requires.txt | 2 +- build/pkgs/sagemath_repl/install-requires.txt | 2 +- build/pkgs/sagemath_sirocco/install-requires.txt | 2 +- build/pkgs/sagemath_tdlib/install-requires.txt | 2 +- pkgs/sage-conf/VERSION.txt | 2 +- pkgs/sage-conf_conda/VERSION.txt | 2 +- pkgs/sage-conf_pypi/VERSION.txt | 2 +- pkgs/sage-docbuild/VERSION.txt | 2 +- pkgs/sage-setup/VERSION.txt | 2 +- pkgs/sage-sws2rst/VERSION.txt | 2 +- pkgs/sagemath-bliss/VERSION.txt | 2 +- pkgs/sagemath-categories/VERSION.txt | 2 +- pkgs/sagemath-coxeter3/VERSION.txt | 2 +- pkgs/sagemath-environment/VERSION.txt | 2 +- pkgs/sagemath-mcqd/VERSION.txt | 2 +- pkgs/sagemath-meataxe/VERSION.txt | 2 +- pkgs/sagemath-objects/VERSION.txt | 2 +- pkgs/sagemath-repl/VERSION.txt | 2 +- pkgs/sagemath-sirocco/VERSION.txt | 2 +- pkgs/sagemath-tdlib/VERSION.txt | 2 +- src/VERSION.txt | 2 +- src/bin/sage-version.sh | 6 +++--- src/sage/version.py | 6 +++--- 38 files changed, 45 insertions(+), 45 deletions(-) diff --git a/CITATION.cff b/CITATION.cff index b4e265090f4..d05315fa584 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -4,8 +4,8 @@ title: SageMath abstract: SageMath is a free open-source mathematics software system. authors: - name: "The SageMath Developers" -version: 10.3.beta1 +version: 10.3.beta2 doi: 10.5281/zenodo.593563 -date-released: 2023-12-10 +date-released: 2023-12-13 repository-code: "https://github.com/sagemath/sage" url: "https://www.sagemath.org/" diff --git a/VERSION.txt b/VERSION.txt index dc0e750e611..a6d9f480c1e 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -SageMath version 10.3.beta1, Release Date: 2023-12-10 +SageMath version 10.3.beta2, Release Date: 2023-12-13 diff --git a/build/pkgs/configure/checksums.ini b/build/pkgs/configure/checksums.ini index 01815d04ac7..deadbf67dc3 100644 --- a/build/pkgs/configure/checksums.ini +++ b/build/pkgs/configure/checksums.ini @@ -1,4 +1,4 @@ tarball=configure-VERSION.tar.gz -sha1=5bb6e594b35fce9bc66e06f620018bd18eb8346e -md5=33c8854fa8d6f356c99ebfc55c2cf884 -cksum=1833053275 +sha1=7f2fe8137f5998559f8d3a0a7f965adf6d5ebc78 +md5=586738771174a2d26d29ce7ba571a95d +cksum=1156937644 diff --git a/build/pkgs/configure/package-version.txt b/build/pkgs/configure/package-version.txt index 5b92f21bd3c..1596e721179 100644 --- a/build/pkgs/configure/package-version.txt +++ b/build/pkgs/configure/package-version.txt @@ -1 +1 @@ -e8571725a77eee05f130807f4638ad9043412d52 +2395f7bb45fd7da537a953055df5e0a70dd96c6a diff --git a/build/pkgs/sage_conf/install-requires.txt b/build/pkgs/sage_conf/install-requires.txt index e21358d2d6c..b136f4a2aff 100644 --- a/build/pkgs/sage_conf/install-requires.txt +++ b/build/pkgs/sage_conf/install-requires.txt @@ -1,2 +1,2 @@ # This file is updated on every release by the sage-update-version script -sage-conf ~= 10.3b1 +sage-conf ~= 10.3b2 diff --git a/build/pkgs/sage_docbuild/install-requires.txt b/build/pkgs/sage_docbuild/install-requires.txt index f1e8ac83886..a9f3dad3be9 100644 --- a/build/pkgs/sage_docbuild/install-requires.txt +++ b/build/pkgs/sage_docbuild/install-requires.txt @@ -1,2 +1,2 @@ # This file is updated on every release by the sage-update-version script -sage-docbuild ~= 10.3b1 +sage-docbuild ~= 10.3b2 diff --git a/build/pkgs/sage_setup/install-requires.txt b/build/pkgs/sage_setup/install-requires.txt index 2cee4def9db..398467294a7 100644 --- a/build/pkgs/sage_setup/install-requires.txt +++ b/build/pkgs/sage_setup/install-requires.txt @@ -1,2 +1,2 @@ # This file is updated on every release by the sage-update-version script -sage-setup ~= 10.3b1 +sage-setup ~= 10.3b2 diff --git a/build/pkgs/sage_sws2rst/install-requires.txt b/build/pkgs/sage_sws2rst/install-requires.txt index fe18058a251..86ccd89829a 100644 --- a/build/pkgs/sage_sws2rst/install-requires.txt +++ b/build/pkgs/sage_sws2rst/install-requires.txt @@ -1,2 +1,2 @@ # This file is updated on every release by the sage-update-version script -sage-sws2rst ~= 10.3b1 +sage-sws2rst ~= 10.3b2 diff --git a/build/pkgs/sagelib/install-requires.txt b/build/pkgs/sagelib/install-requires.txt index 5ef8b7febd4..4760acdf3a5 100644 --- a/build/pkgs/sagelib/install-requires.txt +++ b/build/pkgs/sagelib/install-requires.txt @@ -1,2 +1,2 @@ # This file is updated on every release by the sage-update-version script -sagemath-standard ~= 10.3b1 +sagemath-standard ~= 10.3b2 diff --git a/build/pkgs/sagemath_bliss/install-requires.txt b/build/pkgs/sagemath_bliss/install-requires.txt index 434216dc8ef..78450942be8 100644 --- a/build/pkgs/sagemath_bliss/install-requires.txt +++ b/build/pkgs/sagemath_bliss/install-requires.txt @@ -1,2 +1,2 @@ # This file is updated on every release by the sage-update-version script -sagemath-bliss ~= 10.3b1 +sagemath-bliss ~= 10.3b2 diff --git a/build/pkgs/sagemath_categories/install-requires.txt b/build/pkgs/sagemath_categories/install-requires.txt index 57a3530c389..dd5175f57fe 100644 --- a/build/pkgs/sagemath_categories/install-requires.txt +++ b/build/pkgs/sagemath_categories/install-requires.txt @@ -1,2 +1,2 @@ # This file is updated on every release by the sage-update-version script -sagemath-categories ~= 10.3b1 +sagemath-categories ~= 10.3b2 diff --git a/build/pkgs/sagemath_coxeter3/install-requires.txt b/build/pkgs/sagemath_coxeter3/install-requires.txt index 395192023e6..05f8575b6a0 100644 --- a/build/pkgs/sagemath_coxeter3/install-requires.txt +++ b/build/pkgs/sagemath_coxeter3/install-requires.txt @@ -1,2 +1,2 @@ # This file is updated on every release by the sage-update-version script -sagemath-coxeter3 ~= 10.3b1 +sagemath-coxeter3 ~= 10.3b2 diff --git a/build/pkgs/sagemath_environment/install-requires.txt b/build/pkgs/sagemath_environment/install-requires.txt index f44a3871358..1eb9fe7e808 100644 --- a/build/pkgs/sagemath_environment/install-requires.txt +++ b/build/pkgs/sagemath_environment/install-requires.txt @@ -1,2 +1,2 @@ # This file is updated on every release by the sage-update-version script -sagemath-environment ~= 10.3b1 +sagemath-environment ~= 10.3b2 diff --git a/build/pkgs/sagemath_mcqd/install-requires.txt b/build/pkgs/sagemath_mcqd/install-requires.txt index 04eb1f48c9f..cc46fb68674 100644 --- a/build/pkgs/sagemath_mcqd/install-requires.txt +++ b/build/pkgs/sagemath_mcqd/install-requires.txt @@ -1,2 +1,2 @@ # This file is updated on every release by the sage-update-version script -sagemath-mcqd ~= 10.3b1 +sagemath-mcqd ~= 10.3b2 diff --git a/build/pkgs/sagemath_meataxe/install-requires.txt b/build/pkgs/sagemath_meataxe/install-requires.txt index 83a3c23ac0c..76fc2369cb1 100644 --- a/build/pkgs/sagemath_meataxe/install-requires.txt +++ b/build/pkgs/sagemath_meataxe/install-requires.txt @@ -1,2 +1,2 @@ # This file is updated on every release by the sage-update-version script -sagemath-meataxe ~= 10.3b1 +sagemath-meataxe ~= 10.3b2 diff --git a/build/pkgs/sagemath_objects/install-requires.txt b/build/pkgs/sagemath_objects/install-requires.txt index 46ec6f8eb68..b1d01c37823 100644 --- a/build/pkgs/sagemath_objects/install-requires.txt +++ b/build/pkgs/sagemath_objects/install-requires.txt @@ -1,2 +1,2 @@ # This file is updated on every release by the sage-update-version script -sagemath-objects ~= 10.3b1 +sagemath-objects ~= 10.3b2 diff --git a/build/pkgs/sagemath_repl/install-requires.txt b/build/pkgs/sagemath_repl/install-requires.txt index 4d3da43b2cf..ce22d36e261 100644 --- a/build/pkgs/sagemath_repl/install-requires.txt +++ b/build/pkgs/sagemath_repl/install-requires.txt @@ -1,2 +1,2 @@ # This file is updated on every release by the sage-update-version script -sagemath-repl ~= 10.3b1 +sagemath-repl ~= 10.3b2 diff --git a/build/pkgs/sagemath_sirocco/install-requires.txt b/build/pkgs/sagemath_sirocco/install-requires.txt index fa923dda429..40949dd944f 100644 --- a/build/pkgs/sagemath_sirocco/install-requires.txt +++ b/build/pkgs/sagemath_sirocco/install-requires.txt @@ -1,2 +1,2 @@ # This file is updated on every release by the sage-update-version script -sagemath-sirocco ~= 10.3b1 +sagemath-sirocco ~= 10.3b2 diff --git a/build/pkgs/sagemath_tdlib/install-requires.txt b/build/pkgs/sagemath_tdlib/install-requires.txt index 913c85d2233..cab1a072642 100644 --- a/build/pkgs/sagemath_tdlib/install-requires.txt +++ b/build/pkgs/sagemath_tdlib/install-requires.txt @@ -1,2 +1,2 @@ # This file is updated on every release by the sage-update-version script -sagemath-tdlib ~= 10.3b1 +sagemath-tdlib ~= 10.3b2 diff --git a/pkgs/sage-conf/VERSION.txt b/pkgs/sage-conf/VERSION.txt index 84e7588ad82..4d40853d20c 100644 --- a/pkgs/sage-conf/VERSION.txt +++ b/pkgs/sage-conf/VERSION.txt @@ -1 +1 @@ -10.3.beta1 +10.3.beta2 diff --git a/pkgs/sage-conf_conda/VERSION.txt b/pkgs/sage-conf_conda/VERSION.txt index 84e7588ad82..4d40853d20c 100644 --- a/pkgs/sage-conf_conda/VERSION.txt +++ b/pkgs/sage-conf_conda/VERSION.txt @@ -1 +1 @@ -10.3.beta1 +10.3.beta2 diff --git a/pkgs/sage-conf_pypi/VERSION.txt b/pkgs/sage-conf_pypi/VERSION.txt index 84e7588ad82..4d40853d20c 100644 --- a/pkgs/sage-conf_pypi/VERSION.txt +++ b/pkgs/sage-conf_pypi/VERSION.txt @@ -1 +1 @@ -10.3.beta1 +10.3.beta2 diff --git a/pkgs/sage-docbuild/VERSION.txt b/pkgs/sage-docbuild/VERSION.txt index 84e7588ad82..4d40853d20c 100644 --- a/pkgs/sage-docbuild/VERSION.txt +++ b/pkgs/sage-docbuild/VERSION.txt @@ -1 +1 @@ -10.3.beta1 +10.3.beta2 diff --git a/pkgs/sage-setup/VERSION.txt b/pkgs/sage-setup/VERSION.txt index 84e7588ad82..4d40853d20c 100644 --- a/pkgs/sage-setup/VERSION.txt +++ b/pkgs/sage-setup/VERSION.txt @@ -1 +1 @@ -10.3.beta1 +10.3.beta2 diff --git a/pkgs/sage-sws2rst/VERSION.txt b/pkgs/sage-sws2rst/VERSION.txt index 84e7588ad82..4d40853d20c 100644 --- a/pkgs/sage-sws2rst/VERSION.txt +++ b/pkgs/sage-sws2rst/VERSION.txt @@ -1 +1 @@ -10.3.beta1 +10.3.beta2 diff --git a/pkgs/sagemath-bliss/VERSION.txt b/pkgs/sagemath-bliss/VERSION.txt index 84e7588ad82..4d40853d20c 100644 --- a/pkgs/sagemath-bliss/VERSION.txt +++ b/pkgs/sagemath-bliss/VERSION.txt @@ -1 +1 @@ -10.3.beta1 +10.3.beta2 diff --git a/pkgs/sagemath-categories/VERSION.txt b/pkgs/sagemath-categories/VERSION.txt index 84e7588ad82..4d40853d20c 100644 --- a/pkgs/sagemath-categories/VERSION.txt +++ b/pkgs/sagemath-categories/VERSION.txt @@ -1 +1 @@ -10.3.beta1 +10.3.beta2 diff --git a/pkgs/sagemath-coxeter3/VERSION.txt b/pkgs/sagemath-coxeter3/VERSION.txt index 84e7588ad82..4d40853d20c 100644 --- a/pkgs/sagemath-coxeter3/VERSION.txt +++ b/pkgs/sagemath-coxeter3/VERSION.txt @@ -1 +1 @@ -10.3.beta1 +10.3.beta2 diff --git a/pkgs/sagemath-environment/VERSION.txt b/pkgs/sagemath-environment/VERSION.txt index 84e7588ad82..4d40853d20c 100644 --- a/pkgs/sagemath-environment/VERSION.txt +++ b/pkgs/sagemath-environment/VERSION.txt @@ -1 +1 @@ -10.3.beta1 +10.3.beta2 diff --git a/pkgs/sagemath-mcqd/VERSION.txt b/pkgs/sagemath-mcqd/VERSION.txt index 84e7588ad82..4d40853d20c 100644 --- a/pkgs/sagemath-mcqd/VERSION.txt +++ b/pkgs/sagemath-mcqd/VERSION.txt @@ -1 +1 @@ -10.3.beta1 +10.3.beta2 diff --git a/pkgs/sagemath-meataxe/VERSION.txt b/pkgs/sagemath-meataxe/VERSION.txt index 84e7588ad82..4d40853d20c 100644 --- a/pkgs/sagemath-meataxe/VERSION.txt +++ b/pkgs/sagemath-meataxe/VERSION.txt @@ -1 +1 @@ -10.3.beta1 +10.3.beta2 diff --git a/pkgs/sagemath-objects/VERSION.txt b/pkgs/sagemath-objects/VERSION.txt index 84e7588ad82..4d40853d20c 100644 --- a/pkgs/sagemath-objects/VERSION.txt +++ b/pkgs/sagemath-objects/VERSION.txt @@ -1 +1 @@ -10.3.beta1 +10.3.beta2 diff --git a/pkgs/sagemath-repl/VERSION.txt b/pkgs/sagemath-repl/VERSION.txt index 84e7588ad82..4d40853d20c 100644 --- a/pkgs/sagemath-repl/VERSION.txt +++ b/pkgs/sagemath-repl/VERSION.txt @@ -1 +1 @@ -10.3.beta1 +10.3.beta2 diff --git a/pkgs/sagemath-sirocco/VERSION.txt b/pkgs/sagemath-sirocco/VERSION.txt index 84e7588ad82..4d40853d20c 100644 --- a/pkgs/sagemath-sirocco/VERSION.txt +++ b/pkgs/sagemath-sirocco/VERSION.txt @@ -1 +1 @@ -10.3.beta1 +10.3.beta2 diff --git a/pkgs/sagemath-tdlib/VERSION.txt b/pkgs/sagemath-tdlib/VERSION.txt index 84e7588ad82..4d40853d20c 100644 --- a/pkgs/sagemath-tdlib/VERSION.txt +++ b/pkgs/sagemath-tdlib/VERSION.txt @@ -1 +1 @@ -10.3.beta1 +10.3.beta2 diff --git a/src/VERSION.txt b/src/VERSION.txt index 84e7588ad82..4d40853d20c 100644 --- a/src/VERSION.txt +++ b/src/VERSION.txt @@ -1 +1 @@ -10.3.beta1 +10.3.beta2 diff --git a/src/bin/sage-version.sh b/src/bin/sage-version.sh index d97ae9d5c1a..7d38e167623 100644 --- a/src/bin/sage-version.sh +++ b/src/bin/sage-version.sh @@ -4,6 +4,6 @@ # which stops "setup.py develop" from rewriting it as a Python file. : # This file is auto-generated by the sage-update-version script, do not edit! -SAGE_VERSION='10.3.beta1' -SAGE_RELEASE_DATE='2023-12-10' -SAGE_VERSION_BANNER='SageMath version 10.3.beta1, Release Date: 2023-12-10' +SAGE_VERSION='10.3.beta2' +SAGE_RELEASE_DATE='2023-12-13' +SAGE_VERSION_BANNER='SageMath version 10.3.beta2, Release Date: 2023-12-13' diff --git a/src/sage/version.py b/src/sage/version.py index b7ee40a93da..92ef577e70a 100644 --- a/src/sage/version.py +++ b/src/sage/version.py @@ -1,5 +1,5 @@ # Sage version information for Python scripts # This file is auto-generated by the sage-update-version script, do not edit! -version = '10.3.beta1' -date = '2023-12-10' -banner = 'SageMath version 10.3.beta1, Release Date: 2023-12-10' +version = '10.3.beta2' +date = '2023-12-13' +banner = 'SageMath version 10.3.beta2, Release Date: 2023-12-13'