Remove obsolete patches

This commit is contained in:
Yaakov Selkowitz 2023-12-25 22:43:52 -05:00
parent 4c5b5aa12c
commit 02a79cd78f
5 changed files with 0 additions and 434 deletions

View File

@ -1,24 +0,0 @@
From 01b83b4d4e54881f68eb6edca6fb65b133825002 Mon Sep 17 00:00:00 2001
From: Charles Bousseau <cbousseau@anaconda.com>
Date: Thu, 21 Sep 2023 15:24:07 -0400
Subject: [PATCH] align test_dispatcher s390x targets with
_umath_tests_mtargets
---
numpy/core/tests/test_cpu_dispatcher.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/numpy/core/tests/test_cpu_dispatcher.py b/numpy/core/tests/test_cpu_dispatcher.py
index 2f7eac7e8e9..41a60d5c395 100644
--- a/numpy/core/tests/test_cpu_dispatcher.py
+++ b/numpy/core/tests/test_cpu_dispatcher.py
@@ -9,7 +9,8 @@ def test_dispatcher():
targets = (
"SSE2", "SSE41", "AVX2",
"VSX", "VSX2", "VSX3",
- "NEON", "ASIMD", "ASIMDHP"
+ "NEON", "ASIMD", "ASIMDHP",
+ "VX", "VXE"
)
highest_sfx = "" # no suffix for the baseline
all_sfx = []

View File

@ -1,22 +0,0 @@
From 8f8a4a4a54d63ce7d9ed8aca024561e6820d8970 Mon Sep 17 00:00:00 2001
From: Sayed Adel <seiko@imavr.com>
Date: Fri, 22 Sep 2023 11:30:49 +0400
Subject: [PATCH] BUG: Fix SIMD f32 trunc test on s390x when baseline is none
---
numpy/core/tests/test_simd_module.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/numpy/core/tests/test_simd_module.py b/numpy/core/tests/test_simd_module.py
index 44dc58dac09..4fbaa9f3008 100644
--- a/numpy/core/tests/test_simd_module.py
+++ b/numpy/core/tests/test_simd_module.py
@@ -86,6 +86,8 @@ def test_signed_overflow(self, sfx):
assert lanes == [0] * nlanes
def test_truncate_f32(self):
+ if not npyv.simd_f32:
+ pytest.skip("F32 isn't support by the SIMD extension")
f32 = npyv.setall_f32(0.1)[0]
assert f32 != 0.1
assert round(f32, 1) == 0.1

View File

@ -1,46 +0,0 @@
From b0872b858e2e6ebc394e95c81a024dcf1573c690 Mon Sep 17 00:00:00 2001
From: Ralf Gommers <ralf.gommers@gmail.com>
Date: Mon, 19 Jun 2023 11:07:19 +0200
Subject: [PATCH] TST: skip refcount related tests on py312
Python 3.12 has immortal refcounts; the initial and final
values will be the same when accessing `sys.getrefcount` inside a
test.
Closes gh-23986
---
numpy/core/tests/test_dtype.py | 5 +++++
numpy/core/tests/test_regression.py | 4 ++++
2 files changed, 9 insertions(+)
diff --git a/numpy/core/tests/test_dtype.py b/numpy/core/tests/test_dtype.py
index 454bcfa7cc1..9c88ddb5cd7 100644
--- a/numpy/core/tests/test_dtype.py
+++ b/numpy/core/tests/test_dtype.py
@@ -755,6 +755,11 @@ def iter_struct_object_dtypes():
yield pytest.param(dt, p, 12, obj, id="<structured subarray 2>")
+@pytest.mark.skipif(
+ sys.version_info >= (3, 12),
+ reason="Python 3.12 has immortal refcounts, this test will no longer "
+ "work. See gh-23986"
+)
@pytest.mark.skipif(not HAS_REFCOUNT, reason="Python lacks refcounts")
class TestStructuredObjectRefcounting:
"""These tests cover various uses of complicated structured types which
diff --git a/numpy/core/tests/test_regression.py b/numpy/core/tests/test_regression.py
index e415ecccf9f..35763f843da 100644
--- a/numpy/core/tests/test_regression.py
+++ b/numpy/core/tests/test_regression.py
@@ -1465,6 +1465,10 @@ def test_structured_arrays_with_objects1(self):
x[x.nonzero()] = x.ravel()[:1]
assert_(x[0, 1] == x[0, 0])
+ @pytest.mark.skipif(
+ sys.version_info >= (3, 12),
+ reason="Python 3.12 has immortal refcounts, this test no longer works."
+ )
@pytest.mark.skipif(not HAS_REFCOUNT, reason="Python lacks refcounts")
def test_structured_arrays_with_objects2(self):
# Ticket #1299 second test

View File

@ -1,278 +0,0 @@
From 60720ee4d160fc2ae8ed74f98668f486ad862cef Mon Sep 17 00:00:00 2001
From: Stefan Behnel <stefan_ml@behnel.de>
Date: Thu, 4 May 2023 09:18:16 +0200
Subject: [PATCH] Add "noexcept" markers to functions that do not raise
exceptions
---
numpy/random/_common.pxd | 40 +++++++++++++++++++--------------------
numpy/random/_common.pyx | 2 +-
numpy/random/_mt19937.pyx | 8 ++++----
numpy/random/_pcg64.pyx | 6 +++---
numpy/random/_philox.pyx | 6 +++---
numpy/random/_sfc64.pyx | 6 +++---
6 files changed, 34 insertions(+), 34 deletions(-)
diff --git a/numpy/random/_common.pxd b/numpy/random/_common.pxd
index 3eaf39d..5419d63 100644
--- a/numpy/random/_common.pxd
+++ b/numpy/random/_common.pxd
@@ -39,32 +39,32 @@ cdef extern from "include/aligned_malloc.h":
cdef void *PyArray_calloc_aligned(size_t n, size_t s)
cdef void PyArray_free_aligned(void *p)
-ctypedef void (*random_double_fill)(bitgen_t *state, np.npy_intp count, double* out) nogil
-ctypedef double (*random_double_0)(void *state) nogil
-ctypedef double (*random_double_1)(void *state, double a) nogil
-ctypedef double (*random_double_2)(void *state, double a, double b) nogil
-ctypedef double (*random_double_3)(void *state, double a, double b, double c) nogil
+ctypedef void (*random_double_fill)(bitgen_t *state, np.npy_intp count, double* out) noexcept nogil
+ctypedef double (*random_double_0)(void *state) noexcept nogil
+ctypedef double (*random_double_1)(void *state, double a) noexcept nogil
+ctypedef double (*random_double_2)(void *state, double a, double b) noexcept nogil
+ctypedef double (*random_double_3)(void *state, double a, double b, double c) noexcept nogil
-ctypedef void (*random_float_fill)(bitgen_t *state, np.npy_intp count, float* out) nogil
-ctypedef float (*random_float_0)(bitgen_t *state) nogil
-ctypedef float (*random_float_1)(bitgen_t *state, float a) nogil
+ctypedef void (*random_float_fill)(bitgen_t *state, np.npy_intp count, float* out) noexcept nogil
+ctypedef float (*random_float_0)(bitgen_t *state) noexcept nogil
+ctypedef float (*random_float_1)(bitgen_t *state, float a) noexcept nogil
-ctypedef int64_t (*random_uint_0)(void *state) nogil
-ctypedef int64_t (*random_uint_d)(void *state, double a) nogil
-ctypedef int64_t (*random_uint_dd)(void *state, double a, double b) nogil
-ctypedef int64_t (*random_uint_di)(void *state, double a, uint64_t b) nogil
-ctypedef int64_t (*random_uint_i)(void *state, int64_t a) nogil
-ctypedef int64_t (*random_uint_iii)(void *state, int64_t a, int64_t b, int64_t c) nogil
+ctypedef int64_t (*random_uint_0)(void *state) noexcept nogil
+ctypedef int64_t (*random_uint_d)(void *state, double a) noexcept nogil
+ctypedef int64_t (*random_uint_dd)(void *state, double a, double b) noexcept nogil
+ctypedef int64_t (*random_uint_di)(void *state, double a, uint64_t b) noexcept nogil
+ctypedef int64_t (*random_uint_i)(void *state, int64_t a) noexcept nogil
+ctypedef int64_t (*random_uint_iii)(void *state, int64_t a, int64_t b, int64_t c) noexcept nogil
-ctypedef uint32_t (*random_uint_0_32)(bitgen_t *state) nogil
-ctypedef uint32_t (*random_uint_1_i_32)(bitgen_t *state, uint32_t a) nogil
+ctypedef uint32_t (*random_uint_0_32)(bitgen_t *state) noexcept nogil
+ctypedef uint32_t (*random_uint_1_i_32)(bitgen_t *state, uint32_t a) noexcept nogil
-ctypedef int32_t (*random_int_2_i_32)(bitgen_t *state, int32_t a, int32_t b) nogil
-ctypedef int64_t (*random_int_2_i)(bitgen_t *state, int64_t a, int64_t b) nogil
+ctypedef int32_t (*random_int_2_i_32)(bitgen_t *state, int32_t a, int32_t b) noexcept nogil
+ctypedef int64_t (*random_int_2_i)(bitgen_t *state, int64_t a, int64_t b) noexcept nogil
-cdef double kahan_sum(double *darr, np.npy_intp n)
+cdef double kahan_sum(double *darr, np.npy_intp n) noexcept
-cdef inline double uint64_to_double(uint64_t rnd) nogil:
+cdef inline double uint64_to_double(uint64_t rnd) noexcept nogil:
return (rnd >> 11) * (1.0 / 9007199254740992.0)
cdef object double_fill(void *func, bitgen_t *state, object size, object lock, object out)
diff --git a/numpy/random/_common.pyx b/numpy/random/_common.pyx
index 7b6f693..c5e4e32 100644
--- a/numpy/random/_common.pyx
+++ b/numpy/random/_common.pyx
@@ -171,7 +171,7 @@ cdef object prepare_ctypes(bitgen_t *bitgen):
ctypes.c_void_p(<uintptr_t>bitgen))
return _ctypes
-cdef double kahan_sum(double *darr, np.npy_intp n):
+cdef double kahan_sum(double *darr, np.npy_intp n) noexcept:
"""
Parameters
----------
diff --git a/numpy/random/_mt19937.pyx b/numpy/random/_mt19937.pyx
index 5a8d52e..8b99125 100644
--- a/numpy/random/_mt19937.pyx
+++ b/numpy/random/_mt19937.pyx
@@ -28,16 +28,16 @@ cdef extern from "src/mt19937/mt19937.h":
enum:
RK_STATE_LEN
-cdef uint64_t mt19937_uint64(void *st) nogil:
+cdef uint64_t mt19937_uint64(void *st) noexcept nogil:
return mt19937_next64(<mt19937_state *> st)
-cdef uint32_t mt19937_uint32(void *st) nogil:
+cdef uint32_t mt19937_uint32(void *st) noexcept nogil:
return mt19937_next32(<mt19937_state *> st)
-cdef double mt19937_double(void *st) nogil:
+cdef double mt19937_double(void *st) noexcept nogil:
return mt19937_next_double(<mt19937_state *> st)
-cdef uint64_t mt19937_raw(void *st) nogil:
+cdef uint64_t mt19937_raw(void *st) noexcept nogil:
return <uint64_t>mt19937_next32(<mt19937_state *> st)
cdef class MT19937(BitGenerator):
diff --git a/numpy/random/_pcg64.pyx b/numpy/random/_pcg64.pyx
index c0a10a8..dee38c0 100644
--- a/numpy/random/_pcg64.pyx
+++ b/numpy/random/_pcg64.pyx
@@ -30,13 +30,13 @@ cdef extern from "src/pcg64/pcg64.h":
uint32_t pcg64_cm_next32(pcg64_state *state) nogil
void pcg64_cm_advance(pcg64_state *state, uint64_t *step)
-cdef uint64_t pcg64_uint64(void* st) nogil:
+cdef uint64_t pcg64_uint64(void* st) noexcept nogil:
return pcg64_next64(<pcg64_state *>st)
-cdef uint32_t pcg64_uint32(void *st) nogil:
+cdef uint32_t pcg64_uint32(void *st) noexcept nogil:
return pcg64_next32(<pcg64_state *> st)
-cdef double pcg64_double(void* st) nogil:
+cdef double pcg64_double(void* st) noexcept nogil:
return uint64_to_double(pcg64_next64(<pcg64_state *>st))
cdef uint64_t pcg64_cm_uint64(void* st) nogil:
diff --git a/numpy/random/_philox.pyx b/numpy/random/_philox.pyx
index d9a366e..e0c0504 100644
--- a/numpy/random/_philox.pyx
+++ b/numpy/random/_philox.pyx
@@ -42,13 +42,13 @@ cdef extern from 'src/philox/philox.h':
void philox_advance(uint64_t *step, philox_state *state)
-cdef uint64_t philox_uint64(void*st) nogil:
+cdef uint64_t philox_uint64(void*st) noexcept nogil:
return philox_next64(<philox_state *> st)
-cdef uint32_t philox_uint32(void *st) nogil:
+cdef uint32_t philox_uint32(void *st) noexcept nogil:
return philox_next32(<philox_state *> st)
-cdef double philox_double(void*st) nogil:
+cdef double philox_double(void*st) noexcept nogil:
return uint64_to_double(philox_next64(<philox_state *> st))
cdef class Philox(BitGenerator):
diff --git a/numpy/random/_sfc64.pyx b/numpy/random/_sfc64.pyx
index 1daee34..419045c 100644
--- a/numpy/random/_sfc64.pyx
+++ b/numpy/random/_sfc64.pyx
@@ -21,13 +21,13 @@ cdef extern from "src/sfc64/sfc64.h":
void sfc64_set_state(sfc64_state *state, uint64_t *state_arr, int has_uint32, uint32_t uinteger)
-cdef uint64_t sfc64_uint64(void* st) nogil:
+cdef uint64_t sfc64_uint64(void* st) noexcept nogil:
return sfc64_next64(<sfc64_state *>st)
-cdef uint32_t sfc64_uint32(void *st) nogil:
+cdef uint32_t sfc64_uint32(void *st) noexcept nogil:
return sfc64_next32(<sfc64_state *> st)
-cdef double sfc64_double(void* st) nogil:
+cdef double sfc64_double(void* st) noexcept nogil:
return uint64_to_double(sfc64_next64(<sfc64_state *>st))
--
2.40.1
From 910aff8c5827e13a7b8bb32e22604cf5e35943fc Mon Sep 17 00:00:00 2001
From: Thomas A Caswell <tcaswell@gmail.com>
Date: Sat, 13 May 2023 21:33:45 -0400
Subject: [PATCH] MNT: compatibility with cython3
This is fallout from https://github.com/cython/cython/pull/5386
---
numpy/random/_pcg64.pyx | 11 +++++------
numpy/random/_philox.pyx | 4 ++--
2 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/numpy/random/_pcg64.pyx b/numpy/random/_pcg64.pyx
index dee38c0..f7891aa 100644
--- a/numpy/random/_pcg64.pyx
+++ b/numpy/random/_pcg64.pyx
@@ -26,8 +26,8 @@ cdef extern from "src/pcg64/pcg64.h":
void pcg64_get_state(pcg64_state *state, uint64_t *state_arr, int *has_uint32, uint32_t *uinteger)
void pcg64_set_state(pcg64_state *state, uint64_t *state_arr, int has_uint32, uint32_t uinteger)
- uint64_t pcg64_cm_next64(pcg64_state *state) nogil
- uint32_t pcg64_cm_next32(pcg64_state *state) nogil
+ uint64_t pcg64_cm_next64(pcg64_state *state) noexcept nogil
+ uint32_t pcg64_cm_next32(pcg64_state *state) noexcept nogil
void pcg64_cm_advance(pcg64_state *state, uint64_t *step)
cdef uint64_t pcg64_uint64(void* st) noexcept nogil:
@@ -39,13 +39,13 @@ cdef uint32_t pcg64_uint32(void *st) noexcept nogil:
cdef double pcg64_double(void* st) noexcept nogil:
return uint64_to_double(pcg64_next64(<pcg64_state *>st))
-cdef uint64_t pcg64_cm_uint64(void* st) nogil:
+cdef uint64_t pcg64_cm_uint64(void* st) noexcept nogil:
return pcg64_cm_next64(<pcg64_state *>st)
-cdef uint32_t pcg64_cm_uint32(void *st) nogil:
+cdef uint32_t pcg64_cm_uint32(void *st) noexcept nogil:
return pcg64_cm_next32(<pcg64_state *> st)
-cdef double pcg64_cm_double(void* st) nogil:
+cdef double pcg64_cm_double(void* st) noexcept nogil:
return uint64_to_double(pcg64_cm_next64(<pcg64_state *>st))
cdef class PCG64(BitGenerator):
@@ -515,4 +515,3 @@ cdef class PCG64DXSM(BitGenerator):
pcg64_cm_advance(&self.rng_state, <uint64_t *>np.PyArray_DATA(d))
self._reset_state_variables()
return self
-
diff --git a/numpy/random/_philox.pyx b/numpy/random/_philox.pyx
index e0c0504..e535346 100644
--- a/numpy/random/_philox.pyx
+++ b/numpy/random/_philox.pyx
@@ -36,8 +36,8 @@ cdef extern from 'src/philox/philox.h':
ctypedef s_philox_state philox_state
- uint64_t philox_next64(philox_state *state) nogil
- uint32_t philox_next32(philox_state *state) nogil
+ uint64_t philox_next64(philox_state *state) noexcept nogil
+ uint32_t philox_next32(philox_state *state) noexcept nogil
void philox_jump(philox_state *state)
void philox_advance(uint64_t *step, philox_state *state)
--
2.40.1
From 83d7c201d7ad01fcacb8a3a8da3206f77a01f274 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz>
Date: Mon, 31 Jul 2023 11:46:23 +0200
Subject: [PATCH] Unpin Cython to allow 3
---
pyproject.toml | 2 +-
test_requirements.txt | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/pyproject.toml b/pyproject.toml
index 60e7f58..557ae21 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -3,7 +3,7 @@
requires = [
"setuptools==59.2.0",
"wheel==0.37.0",
- "Cython>=0.29.30,<3.0",
+ "Cython>=0.29.34",
]
diff --git a/test_requirements.txt b/test_requirements.txt
index 67b6a48..a065e99 100644
--- a/test_requirements.txt
+++ b/test_requirements.txt
@@ -1,4 +1,4 @@
-cython>=0.29.30,<3.0
+cython>=0.29.34
wheel==0.37.0
setuptools==59.2.0
hypothesis==6.24.1
--
2.40.1

View File

@ -1,64 +0,0 @@
From 7ade3828313dd437f4e2176ccbbc1ef52322de15 Mon Sep 17 00:00:00 2001
From: Ralf Gommers <ralf.gommers@gmail.com>
Date: Fri, 20 Oct 2023 17:29:26 +0200
Subject: [PATCH] Stop using removed `importlib.resources` functions on Python
>=3.13
Closes gh-12401
---
vendored-meson/meson/mesonbuild/dependencies/python.py | 8 +++++++-
vendored-meson/meson/mesonbuild/modules/python.py | 7 +++++--
2 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/vendored-meson/meson/mesonbuild/dependencies/python.py b/vendored-meson/meson/mesonbuild/dependencies/python.py
index 1607728883df..186a6830ddbf 100644
--- a/vendored-meson/meson/mesonbuild/dependencies/python.py
+++ b/vendored-meson/meson/mesonbuild/dependencies/python.py
@@ -15,6 +15,7 @@
import functools, json, os, textwrap
from pathlib import Path
+import sys
import typing as T
from .. import mesonlib, mlog
@@ -110,8 +111,13 @@ def sanity(self) -> bool:
# Sanity check, we expect to have something that at least quacks in tune
import importlib.resources
+ if sys.version_info >= (3, 13):
+ traversable = importlib.resources.files('mesonbuild.scripts').joinpath('python_info.py')
+ context_mgr = importlib.resources.as_file(traversable)
+ else:
+ context_mgr = importlib.resources.path('mesonbuild.scripts', 'python_info.py')
- with importlib.resources.path('mesonbuild.scripts', 'python_info.py') as f:
+ with context_mgr as f:
cmd = self.get_command() + [str(f)]
p, stdout, stderr = mesonlib.Popen_safe(cmd)
diff --git a/vendored-meson/meson/mesonbuild/modules/python.py b/vendored-meson/meson/mesonbuild/modules/python.py
index ac74e13dc5b7..baeb85936614 100644
--- a/vendored-meson/meson/mesonbuild/modules/python.py
+++ b/vendored-meson/meson/mesonbuild/modules/python.py
@@ -13,7 +13,7 @@
# limitations under the License.
from __future__ import annotations
-import copy, json, os, shutil
+import copy, json, os, shutil, sys
import typing as T
from . import ExtensionModule, ModuleInfo
@@ -329,7 +329,10 @@ def should_append(f, isdir: bool = False):
import importlib.resources
pycompile = os.path.join(self.interpreter.environment.get_scratch_dir(), 'pycompile.py')
with open(pycompile, 'wb') as f:
- f.write(importlib.resources.read_binary('mesonbuild.scripts', 'pycompile.py'))
+ if sys.version_info >= (3, 13):
+ f.write(importlib.resources.files('mesonbuild.scripts').joinpath('pycompile.py').read_bytes())
+ else:
+ f.write(importlib.resources.read_binary('mesonbuild.scripts', 'pycompile.py'))
for i in self.installations.values():
if isinstance(i, PythonExternalProgram) and i.run_bytecompile[i.info['version']]: