sagemath/sage

Update numpy to 1.22.x, scipy 1.8.x, networkx 2.8.x

Closed this issue · 81 comments

These updates:

SciPy also has stricter compiler requirements: C++14 support. According to https://scipy.github.io/devdocs/dev/toolchain.html, GCC >= 6.3.

Related:

  • #32105 Update numpy 1.21.x, scipy 1.7.x;
  • #30384 NEP 29
  • #29756 Meta-ticket: Review of Python 3 features that sagelib should use systematically

Next updates:

Depends on #32937
Depends on #33316
Depends on #33782
Depends on #34017

CC: @dimpase @kiwifb @sagetrac-tmonteil

Component: packages: standard

Author: Matthias Koeppe

Branch/Commit: 2534f5a

Reviewer: Dima Pasechnik

Issue created by migration from https://trac.sagemath.org/ticket/32423

Description changed:

--- 
+++ 
@@ -1,9 +1,10 @@
 These updates:
 - `numpy` 1.22.0 https://numpy.org/devdocs/release/1.22.0-notes.html
-- `scipy` 1.8.0 
+- `scipy` 1.8.0 https://scipy.github.io/devdocs/release.1.8.0.html
 will require us to drop python 3.7 support.
 
 Related: 
+- #32105 Update numpy 1.21.x, scipy 1.7.x;
 - #30384 NEP 29
 - #29756 Meta-ticket: Review of Python 3 features that sagelib should use systematically
 
slel commented

Changed dependencies from #32105 to #32105, #32937

Changed dependencies from #32105, #32937 to #32937, #33049

Description changed:

--- 
+++ 
@@ -2,6 +2,8 @@
 - `numpy` 1.22.0 https://numpy.org/devdocs/release/1.22.0-notes.html
 - `scipy` 1.8.0 https://scipy.github.io/devdocs/release.1.8.0.html
 will require us to drop python 3.7 support.
+
+SciPy also has stricter compiler requirements: C++14 support. According to https://docs.scipy.org/doc/scipy/reference/dev/toolchain.html#c-and-c-language-standards, GCC >= 5.x and according to https://github.com/scipy/scipy/releases, GCC >= 6.3.
 
 Related: 
 - #32105 Update numpy 1.21.x, scipy 1.7.x;

Description changed:

--- 
+++ 
@@ -1,5 +1,5 @@
 These updates:
-- `numpy` 1.22.0 https://numpy.org/devdocs/release/1.22.0-notes.html
+- `numpy` 1.22.0 https://numpy.org/devdocs/release/1.22.0-notes.html, https://github.com/numpy/numpy/releases
 - `scipy` 1.8.0 https://scipy.github.io/devdocs/release.1.8.0.html
 will require us to drop python 3.7 support.
 
comment:7

Untested on sage-the-distro, this works on Arch. Should be rebased after #33049 is merged I guess.


New commits:

46ff9f1Update numpy to 1.22.2
039c5e4Update scipy to 1.8.0
cab17dcFix deprecation warning with scipy 1.8

Author: Antonio Rojas

comment:8

Is the fix for the deprecation warning also OK for early scipy?
Then it's better to put it on a separate ticket that can be merged earlier.

(I think I would want to hold off on the scipy 1.8 upgrade for a little while - maybe it should go into Sage 9.7, not 9.6)

Description changed:

--- 
+++ 
@@ -3,7 +3,7 @@
 - `scipy` 1.8.0 https://scipy.github.io/devdocs/release.1.8.0.html
 will require us to drop python 3.7 support.
 
-SciPy also has stricter compiler requirements: C++14 support. According to https://docs.scipy.org/doc/scipy/reference/dev/toolchain.html#c-and-c-language-standards, GCC >= 5.x and according to https://github.com/scipy/scipy/releases, GCC >= 6.3.
+SciPy also has stricter compiler requirements: C++14 support. According to https://scipy.github.io/devdocs/dev/toolchain.html, GCC >= 6.3.
 
 Related: 
 - #32105 Update numpy 1.21.x, scipy 1.7.x;

Changed dependencies from #32937, #33049 to #32937, #33049, #33316

comment:12

Replying to @mkoeppe:

Is the fix for the deprecation warning also OK for early scipy?
Then it's better to put it on a separate ticket that can be merged earlier.

Done #33336

Branch pushed to git repo; I updated commit sha1. New commits:

02d017fMove deprecation warning fix to another ticket

Changed commit from cab17dc to 02d017f

Description changed:

--- 
+++ 
@@ -2,6 +2,7 @@
 - `numpy` 1.22.0 https://numpy.org/devdocs/release/1.22.0-notes.html, https://github.com/numpy/numpy/releases
 - `scipy` 1.8.0 https://scipy.github.io/devdocs/release.1.8.0.html
 will require us to drop python 3.7 support.
+- `networkx` 1.7.0 https://github.com/networkx/networkx/blob/main/doc/release/release_2.7.rst requires us to drop python 3.7 support too
 
 SciPy also has stricter compiler requirements: C++14 support. According to https://scipy.github.io/devdocs/dev/toolchain.html, GCC >= 6.3.
 
comment:15

Opened #33495 to fix test regressions with networkx 2.7

Changed dependencies from #32937, #33049, #33316 to #32937, #33049, #33316, #33495

Description changed:

--- 
+++ 
@@ -2,7 +2,7 @@
 - `numpy` 1.22.0 https://numpy.org/devdocs/release/1.22.0-notes.html, https://github.com/numpy/numpy/releases
 - `scipy` 1.8.0 https://scipy.github.io/devdocs/release.1.8.0.html
 will require us to drop python 3.7 support.
-- `networkx` 1.7.0 https://github.com/networkx/networkx/blob/main/doc/release/release_2.7.rst requires us to drop python 3.7 support too
+- `networkx` 2.8.0 https://github.com/networkx/networkx/blob/main/doc/release/release_2.7.rst requires us to drop python 3.7 support too
 
 SciPy also has stricter compiler requirements: C++14 support. According to https://scipy.github.io/devdocs/dev/toolchain.html, GCC >= 6.3.
 

Changed commit from 02d017f to 1a46a28

Last 10 new commits:

9419f7bMerge #33088
b21789bDrop Python 3.7 support
25f04c3Merge #32937
1124dedbuild/pkgs/gcc/spkg-configure.m4: Bump minimum version to 6.3
4e8b2c2README.md, src/doc/en/installation/source.rst: Update info on GCC versions
9b388ea.github/workflows/tox*.yml: Update platforms for drop of GCC < 6.3
b93f750Merge #33316
ab734aabuild/pkgs/numpy: Update to 1.22.3
570aac9build/pkgs/pybind11: Update to 1.8.0
1a46a28build/pkgs/networkx: Update to 2.8

Changed author from Antonio Rojas to Matthias Koeppe

Changed dependencies from #32937, #33049, #33316, #33495 to #32937, #33316

Branch pushed to git repo; I updated commit sha1. New commits:

e68a28fbuild/pkgs/gcc/spkg-configure.m4: Fixup

Changed commit from 1a46a28 to e68a28f

Changed commit from e68a28f to 7619755

Branch pushed to git repo; I updated commit sha1. New commits:

cb7518fMerge tag '9.6.rc3' into t/32937/drop_python_3_7_support
e7ff2a8build/pkgs/gcc/spkg-configure.m4: Fixup
0713f53.github/workflows/tox*.yml: Replace ubuntu-xenial by ubuntu-xenial-toolchain-gcc_9
d650177Merge tag '9.6.rc2' into t/33316/drop_support_for_gcc___6_3_in_sage_9_7
a0e037fbuild/bin/write-dockerfile.sh [debian]: Handle EXTRA_PATH, EXTRA_SYSTEM_PACKAGES
dae2d08tox.ini (ubuntu-trusty-toolchain): Use binutils-2.26
33ca131tox.ini, .github/workflows/tox*.yml: Add ubuntu-kinetic, linuxmint-21, fedora-37
ec32489Merge #33316
65cfa33Python 3.7->3.8. in few places; bump Sage version to 9.7 in tutorial
7619755Merge #32937

Branch pushed to git repo; I updated commit sha1. New commits:

253a8f2Merge tag '9.6.rc4' into t/32423/update_numpy_to_1_22_x__scipy_1_8_x___requires_dropping_python_3_7

Changed commit from 7619755 to 253a8f2

Changed dependencies from #32937, #33316 to #32937, #33316, #33782

Changed commit from 253a8f2 to d188705

Branch pushed to git repo; I updated commit sha1. New commits:

301b1df.github/workflows/ci-cygwin*.yml: Use python3.9 for tox
d188705Merge #33782
comment:29

scipy fails on cygwin-standard -
https://github.com/sagemath/sagetrac-mirror/runs/6436093618?check_suite_focus=true

  scipy/stats/_hypotests_pythran.cpp: At global scope:
  scipy/stats/_hypotests_pythran.cpp:256:10: error: expected identifier before numeric constant
    256 |   struct _P
        |          ^~
  scipy/stats/_hypotests_pythran.cpp:256:10: error: expected unqualified-id before numeric constant
  scipy/stats/_hypotests_pythran.cpp:584:12: error: expected nested-name-specifier before numeric constant
    584 |   typename _P::type<argument_type0>::result_type _P::operator()(argument_type0&& A) const
        |            ^~
  scipy/stats/_hypotests_pythran.cpp:584:12: error: expected unqualified-id before numeric constant
  scipy/stats/_hypotests_pythran.cpp:790:40: error: expected identifier before numeric constant
    790 | typename __pythran__hypotests_pythran::_P::type<pythonic::types::ndarray<long,pythonic::types::pshape<long,long>>>::result_type _P0(pythonic::types::ndarray<long,pythonic::types::pshape<long,long>>&& A)
        |                                        ^~
  scipy/stats/_hypotests_pythran.cpp:790:40: error: expected unqualified-id before numeric constant
  scipy/stats/_hypotests_pythran.cpp:806:40: error: expected identifier before numeric constant
    806 | typename 
comment:30

Likely the same macro name clash as #33284

comment:31

Fixed upstream in scipy/scipy#15580

comment:32

There's no backport to the 1.8.x branch yet

Changed commit from d188705 to 1a79feb

Branch pushed to git repo; I updated commit sha1. New commits:

2e9fab0build/pkgs/scipy/patches: Add upstream patch #15580
1a79febbuild/pkgs/scipy: Update to 1.8.1

Changed commit from 1a79feb to 2a7d18d

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

2a7d18dbuild/pkgs/scipy: Update to 1.8.1

Branch pushed to git repo; I updated commit sha1. New commits:

d4ac6a2build/pkgs/gast: Update to 0.5.3

Changed commit from 2a7d18d to d4ac6a2

Changed commit from d4ac6a2 to cad42bf

Branch pushed to git repo; I updated commit sha1. New commits:

b053039Merge tag '9.7.beta1' into t/32423/update_numpy_to_1_22_x__scipy_1_8_x___requires_dropping_python_3_7
cad42bfbuild/pkgs/networkx: Update to 2.8.3

Branch pushed to git repo; I updated commit sha1. New commits:

7f85581build/pkgs/numpy: Update to 1.22.4
acdebeebuild/pkgs/networkx: Update to 2.8.4

Changed commit from cad42bf to acdebee

Changed commit from acdebee to 97557e1

Branch pushed to git repo; I updated commit sha1. New commits:

97557e1Merge tag '9.7.beta3' into t/32423/update_numpy_to_1_22_x__scipy_1_8_x___requires_dropping_python_3_7

Description changed:

--- 
+++ 
@@ -11,5 +11,8 @@
 - #30384 NEP 29
 - #29756 Meta-ticket: Review of Python 3 features that sagelib should use systematically
 
+Next update:
+- #34081 numpy 1.23.x, scipy 1.9.x
 
 
+
comment:42

This appears to break 32bit platforms - for example ubuntu-bionic-i386 (https://github.com/mkoeppe/sage/runs/7056480485?check_suite_focus=true) - numpy's build system appears to think it's building for x86_64

comment:44

Same problem with numpy 1.23.0

comment:45

This looks similar to numpy/numpy#14233 - recommendation there is to upgrade binutils 2.25 or higher

comment:46

However, ubuntu-bionic-i386 uses binutils 2.30

comment:47

Actually it's numpy/numpy#20736

comment:48

The workaround export NPY_DISABLE_SVML=1 works

Changed commit from 97557e1 to ee79c2e

Branch pushed to git repo; I updated commit sha1. New commits:

443b3d3build/pkgs/numpy/spkg-install.in: Fix 32bit build on x86_64
58d62f4build/bin/write-dockerfile.sh: ADD src/VERSION.txt
9cd5ea6Merge #34017
ee79c2ebuild/pkgs/numpy/spkg-install.in: Fix 32bit build on x86_64 (fixup)

Changed dependencies from #32937, #33316, #33782 to #32937, #33316, #33782, #34017

comment:53

Fails on local-macos (2, homebrew-macos-usrlocal-standard, default, macos-latest) https://github.com/mkoeppe/sage/runs/7121386623
(tested with #33530, thus with the setuptools upgrade!)

comment:54

from the log:

Processing /Users/runner/work/sage/sage/.tox/local-homebrew-macos-usrlocal-standard/local/var/tmp/sage/build/numpy-1.22.4/src
  Preparing metadata (setup.py): started
  Running command python setup.py egg_info
  Running from numpy source directory.
  Traceback (most recent call last):
    File "<string>", line 2, in <module>
    File "<pip-setuptools-caller>", line 34, in <module>
    File "/Users/runner/work/sage/sage/.tox/local-homebrew-macos-usrlocal-standard/local/var/tmp/sage/build/numpy-1.22.4/src/setup.py", line 92, in <module>
      raise RuntimeError("setuptools versions >= '60.0.0' require "
  RuntimeError: setuptools versions >= '60.0.0' require SETUPTOOLS_USE_DISTUTILS=stdlib in the environment
  error: subprocess-exited-with-error
  
  × python setup.py egg_info did not run successfully.
comment:56

We are setting SETUPTOOLS_USE_DISTUTILS=local on homebrew to avoid homebrew's distutils.cfg, which is still present (and broken) in pre-3.10 versions:

$ find /usr/local/opt/python@3.7/ -name distutils.cfg
/usr/local/opt/python@3.7//Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/distutils.cfg
$ find /usr/local/opt/python@3.8/ -name distutils.cfg
/usr/local/opt/python@3.8//Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/distutils.cfg
$ find /usr/local/opt/python@3.9/ -name distutils.cfg
/usr/local/opt/python@3.9//Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/distutils.cfg
$ find /usr/local/opt/python@3.10/ -name distutils.cfg
$ cat /usr/local/opt/python@3.9//Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/distutils.cfg
[install]
prefix=/usr/local
[build_ext]
include_dirs=/usr/local/include:/usr/local/opt/openssl@1.1/include:/usr/local/opt/sqlite/include
library_dirs=/usr/local/lib:/usr/local/opt/openssl@1.1/lib:/usr/local/opt/sqlite/lib
comment:57

This code is from numpy/numpy#20963. I'll just patch it out.

comment:58

That's now numpy/numpy#21891

Changed commit from ee79c2e to 2534f5a

Branch pushed to git repo; I updated commit sha1. New commits:

2534f5abuild/pkgs/numpy/patches/21891.patch: New
comment:61

Replying to @mkoeppe:

The workaround export NPY_DISABLE_SVML=1 works

Upstream PR to make this workaround unnecessary (for i386 on x86_64): numpy/numpy#21896

comment:62

Let's get this upgrade in please

Description changed:

--- 
+++ 
@@ -11,8 +11,9 @@
 - #30384 NEP 29
 - #29756 Meta-ticket: Review of Python 3 features that sagelib should use systematically
 
-Next update:
-- #34081 numpy 1.23.x, scipy 1.9.x
+Next updates:
+- #34110 numpy 1.23.x
+- #34081 scipy 1.9.x
 
 
 
comment:64

lgtm

Changed reviewer from https://github.com/mkoeppe/sage/actions/runs/2593290132 to Dima Pasechnik

comment:65

Thanks!