Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade numpy to 1.26.0, setuptools to 68.2.2 #36123

Merged
merged 22 commits into from
Oct 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
ef27469
Merge branch 'scipy_1_11' into numpy_1_26
mkoeppe Aug 22, 2023
ad83ed9
build/pkgs/numpy: Update to 1.26.0b1
mkoeppe Aug 22, 2023
2e652c0
build/pkgs/numpy: Switch build system to meson_python, back out worka…
mkoeppe Aug 22, 2023
5db5acc
build/pkgs/setuptools[_wheel]: Update from 63.4.3/65.6.3 to 68.1.2, s…
mkoeppe Aug 22, 2023
009b496
build/pkgs/pip: Update to 23.2.1
mkoeppe Aug 22, 2023
07e2648
build/pkgs/numpy/spkg-install.in: Remove incompatible -std=... from CXX
mkoeppe Aug 22, 2023
7ea4ee4
build/pkgs/numpy/patches: Add https://github.com/numpy/numpy/pull/24511
mkoeppe Aug 23, 2023
811ea7f
build/pkgs/numpy/patches: Add https://github.com/numpy/numpy/pull/24515
mkoeppe Aug 24, 2023
057823f
build/pkgs/numpy: Update to 1.26.0rc1, remove patches
mkoeppe Sep 7, 2023
ea43f34
Merge tag '10.2.beta1' into numpy_1_26
mkoeppe Sep 7, 2023
4713f28
Merge branch 'use-cython-3' into numpy_1_26
mkoeppe Sep 7, 2023
e403486
build/pkgs/numpy/patches/cython3-legacy.patch: Remove
mkoeppe Sep 7, 2023
def1e4c
Merge branch 'use-cython-3' into numpy_1_26
mkoeppe Sep 10, 2023
0dcefb8
Merge branch 'numpy-1.25-warnings' into numpy_1_26
mkoeppe Sep 14, 2023
1c781e3
Merge branch 'pyproject_toml_setuptools' into numpy_1_26
mkoeppe Sep 14, 2023
e583943
Merge tag '10.2.beta3' into numpy_1_26
mkoeppe Sep 17, 2023
3485e3e
build/pkgs/numpy: Update to 1.26.0
mkoeppe Sep 17, 2023
acaa018
Merge branch 'use-cython-3' into numpy_1_26
mkoeppe Sep 18, 2023
7ef7249
build/pkgs/setuptools[_wheel]/install-requires.txt: >= 68.1.1
mkoeppe Sep 16, 2023
1774d74
build/pkgs/setuptools: Update to 68.2.2
mkoeppe Sep 20, 2023
0b995cf
src/sage/repl/ipython_kernel/kernel.py: hide a PEP 420 warning
orlitzky Sep 21, 2023
2eb2250
Merge branch 'develop' into numpy_1_26
mkoeppe Sep 27, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions build/pkgs/numpy/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
tarball=numpy-VERSION.tar.gz
sha1=6c7f2278b4ddd113b30821e7e4d5f246dc3ee735
md5=8b2692a511a3795f3af8af2cd7566a15
cksum=3950457778
sha1=a3f9d79d7852f5d35ff35693fc31d17ea270d2d0
md5=69bd28f07afbeed2bb6ecd467afcd469
cksum=3599108965
upstream_url=https://pypi.io/packages/source/n/numpy/numpy-VERSION.tar.gz
2 changes: 1 addition & 1 deletion build/pkgs/numpy/dependencies
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$(BLAS) gfortran | $(PYTHON_TOOLCHAIN) pkgconfig cython $(PYTHON)
$(BLAS) gfortran | $(PYTHON_TOOLCHAIN) pkgconfig cython meson_python $(PYTHON)

----------
All lines of this file are ignored except the first.
37 changes: 0 additions & 37 deletions build/pkgs/numpy/lapack_conf.py

This file was deleted.

2 changes: 1 addition & 1 deletion build/pkgs/numpy/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.23.5
1.26.0
31 changes: 0 additions & 31 deletions build/pkgs/numpy/patches/21891.patch

This file was deleted.

12 changes: 0 additions & 12 deletions build/pkgs/numpy/patches/cython3-legacy.patch

This file was deleted.

60 changes: 18 additions & 42 deletions build/pkgs/numpy/spkg-install.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,57 +3,33 @@ cd src

set -e

if [ `uname` = "Darwin" ]; then
unset ATLAS
unset BLAS
unset LAPACK
# https://github.com/sagemath/sage/issues/34110#comment:35
# The fix for "reciprocal" (affected by a clang compiler bug) in
# https://github.com/numpy/numpy/pull/19926 relies on -ftrapping-math
# being used when Apple clang v12+ is used.
# But numpy.distutils.ccompiler only sets this flag when
# $CC contains the string "clang" -- missing the case CC=/usr/bin/gcc.
# So we set it here explicitly if the compiler supports the flag.
export CFLAGS="$(testcflags.sh $CFLAGS -ftrapping-math)"
else
export {ATLAS,PTATLAS,OPENBLAS,MKL,MKLROOT}=None
export LDFLAGS="${LDFLAGS} -shared"
fi
# https://github.com/scipy/scipy/issues/16536 - meson breaks when CXX="g++ -std=gnu++11"
# -- 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

# Trac #32746: pkg-config omits -I and -L flags that refer to directories
# that are already on CPATH, LIBRARY_PATH.
# But our script tries to obtain the list of include_dirs and library_dirs
# from pkg-config!
(unset CPATH LIBRARY_PATH; python3 ../lapack_conf.py)

# Make sure that the fortran objects are compiled with -fPIC
export FFLAGS="$FFLAGS -fPIC"
export FCFLAGS="$FCFLAGS -fPIC"

if [ "$SAGE_FAT_BINARY" = "yes" ]; then
export NUMPY_FCONFIG="--cpu-baseline=NONE"
else
export NUMPY_FCONFIG=""
fi

# Trac #32423: Fix 32-bit builds on x86_64
ARCH=$($CC -dumpmachine 2>/dev/null || echo unknown)
case "$ARCH" in
*x86_64*)
;;
*)
export NPY_DISABLE_SVML=1
;;
esac

################################################

# Trac #33138: numpy is a PEP 517 package, so the crucial "--build-option"s would be ignored.
eval sdh_pip_install --no-use-pep517 \
$(eval sdh_prefix_args "--build-option" build ${NUMPY_CONFIG} ${NUMPY_FCONFIG}) \
.
### Per https://github.com/numpy/numpy/releases/tag/v1.26.0b1
### "NumPy-specific build customization":
###
### The NPY_* environment variables which control BLAS/LAPACK, SIMD,
### threading, and other such options are no longer supported, nor is
### a site.cfg file to select BLAS and LAPACK. Instead, there are
### command-line flags that can be passed to the build via pip/build's
### config-settings interface. These flags are all listed in
### https://github.com/numpy/numpy/blob/main/meson_options.txt
###
### 1.26.0b1 temporarily vendors Meson and meson-python
### http://scipy.github.io/devdocs/building/index.html


sdh_pip_install .
6 changes: 3 additions & 3 deletions build/pkgs/pip/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
tarball=pip-VERSION.tar.gz
sha1=29167fffe19874a74247fe92f4fdba1bb1221c61
md5=996f58a94fe0b8b82b6795c42bd171ba
cksum=537001443
sha1=4bdfd8e976b5122cf55f4f4740f7305f1ffa4310
md5=e9b1226701a56ee3fcc81aba60d25d75
cksum=1940746834
upstream_url=https://pypi.io/packages/source/p/pip/pip-VERSION.tar.gz
2 changes: 1 addition & 1 deletion build/pkgs/pip/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
22.3.1
23.2.1
7 changes: 0 additions & 7 deletions build/pkgs/setuptools/SPKG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,6 @@ Description
setuptools is the classical build system for Python packages,
a collection of enhancements to the Python distutils.

This package represents version 63.x of ``setuptools``.
Sage installs this version to provide the build system
for non-PEP 517 packages. In particular, Sage uses it
for building ``numpy``, whose build system ``numpy.distutils``
is not compatible with newer versions of ``setuptools``,
see https://github.com/numpy/numpy/pull/22154

License
-------

Expand Down
6 changes: 3 additions & 3 deletions build/pkgs/setuptools/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
tarball=setuptools-VERSION.tar.gz
sha1=b14b8e2cf965fdb6870ebfccee50c751c056f757
md5=02a0e4dc4fa13168904e8769a077aa26
cksum=2734084418
sha1=b0c9b16863c57d70adc22651906eea7eaee09803
md5=d967ca2ba7f46db887daee2d5c9bd6a2
cksum=2346145273
upstream_url=https://pypi.io/packages/source/s/setuptools/setuptools-VERSION.tar.gz
4 changes: 3 additions & 1 deletion build/pkgs/setuptools/install-requires.txt
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
setuptools >=49.6.0, <64
# 68.1.0 Promote pyproject.toml's [tool.setuptools] out of beta.
# 68.1.1 Fix editable install finder handling of nested packages
setuptools >= 68.1.1
2 changes: 1 addition & 1 deletion build/pkgs/setuptools/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
63.4.3
68.2.2
3 changes: 0 additions & 3 deletions build/pkgs/setuptools_wheel/SPKG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,3 @@ setuptools_wheel: Build the setuptools package as a wheel

After installing setuptools and wheel, we build a wheel of setuptools
to complete the set of wheels stored in our wheelhouse.

This version of setuptools is suitable for PEP 517/518/660 builds,
but it is not suitable for building ``numpy``.
5 changes: 0 additions & 5 deletions build/pkgs/setuptools_wheel/checksums.ini

This file was deleted.

1 change: 1 addition & 0 deletions build/pkgs/setuptools_wheel/checksums.ini
1 change: 0 additions & 1 deletion build/pkgs/setuptools_wheel/install-requires.txt

This file was deleted.

1 change: 1 addition & 0 deletions build/pkgs/setuptools_wheel/install-requires.txt
1 change: 0 additions & 1 deletion build/pkgs/setuptools_wheel/package-version.txt

This file was deleted.

1 change: 1 addition & 0 deletions build/pkgs/setuptools_wheel/package-version.txt
13 changes: 12 additions & 1 deletion src/sage/repl/ipython_kernel/kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,18 @@
# ***************************************************************************

import sys
from ipykernel.ipkernel import IPythonKernel
import warnings
with warnings.catch_warnings():
# When upstream pydevd (as opposed to the bundled version) is used
# with debugpy, a PEP 420 warning is emitted. Debugpy and/or
# pydevd will eventually work around this, but as of September
# 2023, hiding the warning gives us more flexibility in the
# versions of those packages that we can accept.
warnings.filterwarnings("ignore",
message=r".*pkg_resources\.declare_namespace",
category=DeprecationWarning)
from ipykernel.ipkernel import IPythonKernel

from ipykernel.zmqshell import ZMQInteractiveShell
from traitlets import Type

Expand Down
Loading