aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/python/numpy/py3
diff options
context:
space:
mode:
authormaxim-yurchuk <maxim-yurchuk@yandex-team.com>2024-10-09 12:29:46 +0300
committermaxim-yurchuk <maxim-yurchuk@yandex-team.com>2024-10-09 13:14:22 +0300
commit9731d8a4bb7ee2cc8554eaf133bb85498a4c7d80 (patch)
treea8fb3181d5947c0d78cf402aa56e686130179049 /contrib/python/numpy/py3
parenta44b779cd359f06c3ebbef4ec98c6b38609d9d85 (diff)
downloadydb-9731d8a4bb7ee2cc8554eaf133bb85498a4c7d80.tar.gz
publishFullContrib: true for ydb
<HIDDEN_URL> commit_hash:c82a80ac4594723cebf2c7387dec9c60217f603e
Diffstat (limited to 'contrib/python/numpy/py3')
-rw-r--r--contrib/python/numpy/py3/patches/01-fix-include-simd.h.patch105
-rw-r--r--contrib/python/numpy/py3/patches/02-fix-doc.patch15
-rw-r--r--contrib/python/numpy/py3/patches/03-fix-name.patch22
-rw-r--r--contrib/python/numpy/py3/patches/04-fix-tests.patch281
-rw-r--r--contrib/python/numpy/py3/patches/05-fix-win-build.patch38
-rw-r--r--contrib/python/numpy/py3/patches/06-fix-config.h.patch19
-rw-r--r--contrib/python/numpy/py3/patches/09-hack-for-matplotlib.patch12
-rw-r--r--contrib/python/numpy/py3/patches/12-arrch64.patch327
-rw-r--r--contrib/python/numpy/py3/patches/14-libunwind.h.patch22
-rw-r--r--contrib/python/numpy/py3/patches/15-support-python-3.12.patch11
10 files changed, 852 insertions, 0 deletions
diff --git a/contrib/python/numpy/py3/patches/01-fix-include-simd.h.patch b/contrib/python/numpy/py3/patches/01-fix-include-simd.h.patch
new file mode 100644
index 0000000000..9857c9e3c6
--- /dev/null
+++ b/contrib/python/numpy/py3/patches/01-fix-include-simd.h.patch
@@ -0,0 +1,105 @@
+--- contrib/python/numpy/py3/numpy/core/src/multiarray/compiled_base.c (index)
++++ contrib/python/numpy/py3/numpy/core/src/multiarray/compiled_base.c (working tree)
+@@ -14,1 +14,1 @@
+-#include "simd/simd.h"
++#include "contrib/python/numpy/py3/numpy/core/src/common/simd/simd.h"
+--- contrib/python/numpy/py3/numpy/core/src/multiarray/einsum_sumprod.c (index)
++++ contrib/python/numpy/py3/numpy/core/src/multiarray/einsum_sumprod.c (working tree)
+@@ -27,1 +27,1 @@
+-#include "simd/simd.h"
++#include "contrib/python/numpy/py3/numpy/core/src/common/simd/simd.h"
+--- contrib/python/numpy/py3/numpy/core/src/multiarray/item_selection.c (index)
++++ contrib/python/numpy/py3/numpy/core/src/multiarray/item_selection.c (working tree)
+@@ -28,1 +28,1 @@
+-#include "simd/simd.h"
++#include "contrib/python/numpy/py3/numpy/core/src/common/simd/simd.h"
+--- contrib/python/numpy/py3/numpy/core/src/umath/loops_arithm_fp.dispatch.c (index)
++++ contrib/python/numpy/py3/numpy/core/src/umath/loops_arithm_fp.dispatch.c (working tree)
+@@ -16,1 +16,1 @@
+-#include "simd/simd.h"
++#include "contrib/python/numpy/py3/numpy/core/src/common/simd/simd.h"
+--- contrib/python/numpy/py3/numpy/core/src/umath/loops_arithmetic.dispatch.c (index)
++++ contrib/python/numpy/py3/numpy/core/src/umath/loops_arithmetic.dispatch.c (working tree)
+@@ -18,1 +18,1 @@
+-#include "simd/simd.h"
++#include "contrib/python/numpy/py3/numpy/core/src/common/simd/simd.h"
+--- contrib/python/numpy/py3/numpy/core/src/umath/loops_exponent_log.dispatch.c (index)
++++ contrib/python/numpy/py3/numpy/core/src/umath/loops_exponent_log.dispatch.c (working tree)
+@@ -20,1 +20,1 @@
+-#include "simd/simd.h"
++#include "contrib/python/numpy/py3/numpy/core/src/common/simd/simd.h"
+--- contrib/python/numpy/py3/numpy/core/src/umath/loops_trigonometric.dispatch.c (index)
++++ contrib/python/numpy/py3/numpy/core/src/umath/loops_trigonometric.dispatch.c (working tree)
+@@ -15,1 +15,1 @@
+-#include "simd/simd.h"
++#include "contrib/python/numpy/py3/numpy/core/src/common/simd/simd.h"
+--- contrib/python/numpy/py3/numpy/core/src/umath/loops_unary_fp.dispatch.c (index)
++++ contrib/python/numpy/py3/numpy/core/src/umath/loops_unary_fp.dispatch.c (working tree)
+@@ -22,1 +22,1 @@
+-#include "simd/simd.h"
++#include "contrib/python/numpy/py3/numpy/core/src/common/simd/simd.h"
+--- contrib/python/numpy/py3/numpy/core/src/_simd/_simd_inc.h (index)
++++ contrib/python/numpy/py3/numpy/core/src/_simd/_simd_inc.h (working tree)
+@@ -12,1 +12,1 @@
+-#include "simd/simd.h"
++#include "contrib/python/numpy/py3/numpy/core/src/common/simd/simd.h"
+--- contrib/python/numpy/py3/numpy/core/src/umath/loops_umath_fp.dispatch.c (index)
++++ contrib/python/numpy/py3/numpy/core/src/umath/loops_umath_fp.dispatch.c (working tree)
+@@ -12,1 +12,1 @@
+-#include "simd/simd.h"
++#include "contrib/python/numpy/py3/numpy/core/src/common/simd/simd.h"
+--- contrib/python/numpy/py3/numpy/core/src/multiarray/argfunc.dispatch.c (index)
++++ contrib/python/numpy/py3/numpy/core/src/multiarray/argfunc.dispatch.c (working tree)
+@@ -18,1 +18,1 @@
+-#include "simd/simd.h"
++#include "contrib/python/numpy/py3/numpy/core/src/common/simd/simd.h"
+--- contrib/python/numpy/py3/numpy/core/src/umath/loops_hyperbolic.dispatch.c (index)
++++ contrib/python/numpy/py3/numpy/core/src/umath/loops_hyperbolic.dispatch.c (working tree)
+@@ -15,1 +15,1 @@
+-#include "simd/simd.h"
++#include "contrib/python/numpy/py3/numpy/core/src/common/simd/simd.h"
+--- contrib/python/numpy/py3/numpy/core/src/umath/loops_minmax.dispatch.c (index)
++++ contrib/python/numpy/py3/numpy/core/src/umath/loops_minmax.dispatch.c (working tree)
+@@ -18,1 +18,1 @@
+-#include "simd/simd.h"
++#include "contrib/python/numpy/py3/numpy/core/src/common/simd/simd.h"
+--- contrib/python/numpy/py3/numpy/core/src/umath/loops_modulo.dispatch.c (index)
++++ contrib/python/numpy/py3/numpy/core/src/umath/loops_modulo.dispatch.c (working tree)
+@@ -15,1 +15,1 @@
+-#include "simd/simd.h"
++#include "contrib/python/numpy/py3/numpy/core/src/common/simd/simd.h"
+--- contrib/python/numpy/py3/numpy/core/src/umath/loops_comparison.dispatch.c (index)
++++ contrib/python/numpy/py3/numpy/core/src/umath/loops_comparison.dispatch.c (working tree)
+@@ -15,1 +15,1 @@
+-#include "simd/simd.h"
++#include "contrib/python/numpy/py3/numpy/core/src/common/simd/simd.h"
+--- contrib/python/numpy/py3/numpy/core/src/umath/fast_loop_macros.h (index)
++++ contrib/python/numpy/py3/numpy/core/src/umath/fast_loop_macros.h (working tree)
+@@ -15 +15 @@
+-#include "simd/simd.h"
++#include "contrib/python/numpy/py3/numpy/core/src/common/simd/simd.h"
+--- contrib/python/numpy/py3/numpy/core/src/umath/loops_autovec.dispatch.c (index)
++++ contrib/python/numpy/py3/numpy/core/src/umath/loops_autovec.dispatch.c (working tree)
+@@ -22 +22 @@
+-#include "simd/simd.h"
++#include "contrib/python/numpy/py3/numpy/core/src/common/simd/simd.h"
+--- contrib/python/numpy/py3/numpy/core/src/umath/loops_logical.dispatch.c (index)
++++ contrib/python/numpy/py3/numpy/core/src/umath/loops_logical.dispatch.c (working tree)
+@@ -22 +22 @@
+-#include "simd/simd.h"
++#include "contrib/python/numpy/py3/numpy/core/src/common/simd/simd.h"
+--- contrib/python/numpy/py3/numpy/core/src/umath/loops_unary.dispatch.c (index)
++++ contrib/python/numpy/py3/numpy/core/src/umath/loops_unary.dispatch.c (working tree)
+@@ -24 +24 @@
+-#include "simd/simd.h"
++#include "contrib/python/numpy/py3/numpy/core/src/common/simd/simd.h"
+--- contrib/python/numpy/py3/numpy/core/src/umath/loops_unary_complex.dispatch.c (index)
++++ contrib/python/numpy/py3/numpy/core/src/umath/loops_unary_complex.dispatch.c (working tree)
+@@ -22 +22 @@
+-#include "simd/simd.h"
++#include "contrib/python/numpy/py3/numpy/core/src/common/simd/simd.h"
+--- contrib/python/numpy/py3/numpy/core/src/umath/loops_unary_fp_le.dispatch.c (index)
++++ contrib/python/numpy/py3/numpy/core/src/umath/loops_unary_fp_le.dispatch.c (working tree)
+@@ -30 +30 @@
+-#include "simd/simd.h"
++#include "contrib/python/numpy/py3/numpy/core/src/common/simd/simd.h"
diff --git a/contrib/python/numpy/py3/patches/02-fix-doc.patch b/contrib/python/numpy/py3/patches/02-fix-doc.patch
new file mode 100644
index 0000000000..205e1f6d94
--- /dev/null
+++ b/contrib/python/numpy/py3/patches/02-fix-doc.patch
@@ -0,0 +1,15 @@
+--- contrib/python/numpy/py3/numpy/doc/__init__.py (index)
++++ contrib/python/numpy/py3/numpy/doc/__init__.py (working tree)
+@@ -2,8 +2,10 @@ import os
+
+ ref_dir = os.path.join(os.path.dirname(__file__))
+
+-__all__ = sorted(f[:-3] for f in os.listdir(ref_dir) if f.endswith('.py') and
+- not f.startswith('__'))
++__all__ = [
++ "constants",
++ "ufuncs",
++]
+
+ for f in __all__:
+ __import__(__name__ + '.' + f)
diff --git a/contrib/python/numpy/py3/patches/03-fix-name.patch b/contrib/python/numpy/py3/patches/03-fix-name.patch
new file mode 100644
index 0000000000..120ece8037
--- /dev/null
+++ b/contrib/python/numpy/py3/patches/03-fix-name.patch
@@ -0,0 +1,22 @@
+--- contrib/python/numpy/py3/numpy/core/src/umath/_rational_tests.c (index)
++++ contrib/python/numpy/py3/numpy/core/src/umath/_rational_tests.c (working tree)
+@@ -1106,8 +1106,8 @@ rational_ufunc_test_add_rationals(char** args, npy_intp const *dimensions,
+ }
+ }
+
+-
+-PyMethodDef module_methods[] = {
++// XXX Arcadia confilct with contrib/python/pygit2
++PyMethodDef rational_module_methods[] = {
+ {0} /* sentinel */
+ };
+
+@@ -1116,7 +1116,7 @@ static struct PyModuleDef moduledef = {
+ "_rational_tests",
+ NULL,
+ -1,
+- module_methods,
++ rational_module_methods,
+ NULL,
+ NULL,
+ NULL,
diff --git a/contrib/python/numpy/py3/patches/04-fix-tests.patch b/contrib/python/numpy/py3/patches/04-fix-tests.patch
new file mode 100644
index 0000000000..d13669b9ad
--- /dev/null
+++ b/contrib/python/numpy/py3/patches/04-fix-tests.patch
@@ -0,0 +1,281 @@
+--- contrib/python/numpy/py3/numpy/core/tests/test_longdouble.py (index)
++++ contrib/python/numpy/py3/numpy/core/tests/test_longdouble.py (working tree)
+@@ -9,1 +9,1 @@ from numpy.testing import (
+-from numpy.core.tests._locales import CommaDecimalPointLocale
++from __tests__.numpy.core.tests._locales import CommaDecimalPointLocale
+--- contrib/python/numpy/py3/numpy/core/tests/test_multiarray.py (index)
++++ contrib/python/numpy/py3/numpy/core/tests/test_multiarray.py (working tree)
+@@ -32,1 +32,1 @@ from numpy.testing import (
+-from numpy.core.tests._locales import CommaDecimalPointLocale
++from __tests__.numpy.core.tests._locales import CommaDecimalPointLocale
+--- contrib/python/numpy/py3/numpy/core/tests/test_print.py (index)
++++ contrib/python/numpy/py3/numpy/core/tests/test_print.py (working tree)
+@@ -7,1 +7,1 @@ import pytest
+-from numpy.core.tests._locales import CommaDecimalPointLocale
++from __tests__.numpy.core.tests._locales import CommaDecimalPointLocale
+--- contrib/python/numpy/py3/numpy/matrixlib/tests/test_matrix_linalg.py (index)
++++ contrib/python/numpy/py3/numpy/matrixlib/tests/test_matrix_linalg.py (working tree)
+@@ -4,1 +4,1 @@
+-from numpy.linalg.tests.test_linalg import (
++from __tests__.numpy.linalg.tests.test_linalg import (
+--- contrib/python/numpy/py3/numpy/array_api/tests/test_array_object.py (index)
++++ contrib/python/numpy/py3/numpy/array_api/tests/test_array_object.py (working tree)
+@@ -6,3 +6,3 @@ import operator
+-from .. import ones, asarray, reshape, result_type, all, equal
+-from .._array_object import Array
+-from .._dtypes import (
++from numpy.array_api import ones, asarray, reshape, result_type, all, equal
++from numpy.array_api._array_object import Array
++from numpy.array_api._dtypes import (
+--- contrib/python/numpy/py3/numpy/array_api/tests/test_creation_functions.py (index)
++++ contrib/python/numpy/py3/numpy/array_api/tests/test_creation_functions.py (working tree)
+@@ -4,2 +4,2 @@
+-from .. import all
+-from .._creation_functions import (
++from numpy.array_api import all
++from numpy.array_api._creation_functions import (
+@@ -20,2 +20,2 @@ from .._creation_functions import (
+-from .._dtypes import float32, float64
+-from .._array_object import Array
++from numpy.array_api._dtypes import float32, float64
++from numpy.array_api._array_object import Array
+--- contrib/python/numpy/py3/numpy/array_api/tests/test_elementwise_functions.py (index)
++++ contrib/python/numpy/py3/numpy/array_api/tests/test_elementwise_functions.py (working tree)
+@@ -5,3 +5,3 @@ from inspect import getfullargspec
+-from .. import asarray, _elementwise_functions
+-from .._elementwise_functions import bitwise_left_shift, bitwise_right_shift
+-from .._dtypes import (
++from numpy.array_api import asarray, _elementwise_functions
++from numpy.array_api._elementwise_functions import bitwise_left_shift, bitwise_right_shift
++from numpy.array_api._dtypes import (
+--- contrib/python/numpy/py3/numpy/array_api/tests/test_manipulation_functions.py (index)
++++ contrib/python/numpy/py3/numpy/array_api/tests/test_manipulation_functions.py (working tree)
+@@ -4,4 +4,4 @@
+-from .. import all
+-from .._creation_functions import asarray
+-from .._dtypes import float64, int8
+-from .._manipulation_functions import (
++from numpy.array_api import all
++from numpy.array_api._creation_functions import asarray
++from numpy.array_api._dtypes import float64, int8
++from numpy.array_api._manipulation_functions import (
+--- contrib/python/numpy/py3/numpy/core/tests/test_records.py (index)
++++ contrib/python/numpy/py3/numpy/core/tests/test_records.py (working tree)
+@@ -73,1 +75,2 @@ class TestFromrecords:
+- data_dir = path.join(path.dirname(__file__), 'data')
++ import yatest.common as yc
++ data_dir = yc.source_path(path.join(path.dirname(__file__), 'data'))
+--- contrib/python/numpy/py3/numpy/core/tests/test_regression.py (index)
++++ contrib/python/numpy/py3/numpy/core/tests/test_regression.py (working tree)
+@@ -1099,1 +1101,2 @@ class TestRegression:
+- data_dir = path.join(path.dirname(__file__), 'data')
++ import yatest.common as yc
++ data_dir = yc.source_path(path.join(path.dirname(__file__), 'data'))
+--- contrib/python/numpy/py3/numpy/core/tests/test_umath_accuracy.py (index)
++++ contrib/python/numpy/py3/numpy/core/tests/test_umath_accuracy.py (working tree)
+@@ -33,1 +35,2 @@ class TestAccuracy:
+- data_dir = path.join(path.dirname(__file__), 'data')
++ import yatest.common as yc
++ data_dir = yc.source_path(path.join(path.dirname(__file__), 'data'))
+--- contrib/python/numpy/py3/numpy/random/tests/test_direct.py (index)
++++ contrib/python/numpy/py3/numpy/random/tests/test_direct.py (working tree)
+@@ -33,1 +33,2 @@ if sys.flags.optimize > 1:
+-pwd = os.path.dirname(os.path.abspath(__file__))
++import yatest.common as yc
++pwd = yc.source_path(os.path.dirname(__file__))
+--- contrib/python/numpy/py3/numpy/core/tests/test_numpy_2_0_compat.py (index)
++++ contrib/python/numpy/py3/numpy/core/tests/test_numpy_2_0_compat.py (working tree)
+@@ -4,2 +4,3 @@ import pickle
+ import numpy as np
++import yatest.common as yc
+
+@@ -9 +10 @@ class TestNumPy2Compatibility:
+- data_dir = path.join(path.dirname(__file__), "data")
++ data_dir = yc.source_path(path.join(path.dirname(__file__), "data"))
+--- contrib/python/numpy/py3/numpy/lib/tests/test_format.py (index)
++++ contrib/python/numpy/py3/numpy/lib/tests/test_format.py (working tree)
+@@ -90 +90 @@ Test the magic string writing.
+- '\x93NUMPY\x01\x00'
++ b'\x93NUMPY\x01\x00'
+@@ -92 +92 @@ Test the magic string writing.
+- '\x93NUMPY\x00\x00'
++ b'\x93NUMPY\x00\x00'
+@@ -94 +94 @@ Test the magic string writing.
+- '\x93NUMPY\xff\xff'
++ b'\x93NUMPY\xff\xff'
+@@ -96 +96 @@ Test the magic string writing.
+- '\x93NUMPY\x02\x05'
++ b'\x93NUMPY\x02\x05'
+@@ -111 +111 @@ Test the header writing.
+- >>> for arr in basic_arrays + record_arrays:
++ >>> for arr in basic_arrays + record_arrays: # doctest: +SKIP
+@@ -287,6 +11,8 @@ from numpy.testing import (
+ )
+ from numpy.lib import format
+
++import yatest.common as yc
++
+
+ # Generate some basic arrays to test with.
+ scalars = [
+@@ -526,1 +252,1 @@ def test_load_padded_dtype(tmpdir, dt):
+- path = os.path.join(os.path.dirname(__file__), 'data', fname)
++ path = yc.source_path(os.path.join(os.path.dirname(__file__), 'data', fname))
+@@ -536,1 +262,1 @@ def test_load_padded_dtype(tmpdir, dt):
+- data_dir = os.path.join(os.path.dirname(__file__), 'data')
++ data_dir = yc.source_path(os.path.join(os.path.dirname(__file__), 'data'))
+@@ -578,1 +304,1 @@ def test_pickle_python2_python3():
+- data_dir = os.path.join(os.path.dirname(__file__), 'data')
++ data_dir = yc.source_path(os.path.join(os.path.dirname(__file__), 'data'))
+--- contrib/python/numpy/py3/numpy/tests/test_public_api.py (index)
++++ contrib/python/numpy/py3/numpy/tests/test_public_api.py (working tree)
+@@ -34,16 +34,16 @@ def test_numpy_namespace():
+ # None of these objects are publicly documented to be part of the main
+ # NumPy namespace (some are useful though, others need to be cleaned up)
+ undocumented = {
+- '_add_newdoc_ufunc': 'numpy.core._multiarray_umath._add_newdoc_ufunc',
+- 'add_docstring': 'numpy.core._multiarray_umath.add_docstring',
++ '_add_newdoc_ufunc': '_multiarray_umath._add_newdoc_ufunc',
++ 'add_docstring': '_multiarray_umath.add_docstring',
+ 'add_newdoc': 'numpy.core.function_base.add_newdoc',
+- 'add_newdoc_ufunc': 'numpy.core._multiarray_umath._add_newdoc_ufunc',
++ 'add_newdoc_ufunc': '_multiarray_umath._add_newdoc_ufunc',
+ 'byte_bounds': 'numpy.lib.utils.byte_bounds',
+- 'compare_chararrays': 'numpy.core._multiarray_umath.compare_chararrays',
++ 'compare_chararrays': '_multiarray_umath.compare_chararrays',
+ 'deprecate': 'numpy.lib.utils.deprecate',
+ 'deprecate_with_doc': 'numpy.lib.utils.deprecate_with_doc',
+ 'disp': 'numpy.lib.function_base.disp',
+- 'fastCopyAndTranspose': 'numpy.core._multiarray_umath.fastCopyAndTranspose',
++ 'fastCopyAndTranspose': '_multiarray_umath.fastCopyAndTranspose',
+ 'get_array_wrap': 'numpy.lib.shape_base.get_array_wrap',
+ 'get_include': 'numpy.lib.utils.get_include',
+ 'recfromcsv': 'numpy.lib.npyio.recfromcsv',
+@@ -61,6 +61,7 @@ def test_numpy_namespace():
+ assert bad_results == allowlist
+
+
++@pytest.mark.skip
+ @pytest.mark.skipif(IS_WASM, reason="can't start subprocess")
+ @pytest.mark.parametrize('name', ['testing'])
+ def test_import_lazy_import(name):
+@@ -99,6 +100,7 @@ def test_numpy_fft():
+ assert bad_results == {}
+
+
++@pytest.mark.skip
+ @pytest.mark.skipif(ctypes is None,
+ reason="ctypes not available in this python")
+ def test_NPY_NO_EXPORT():
+--- contrib/python/numpy/py3/numpy/core/tests/test_nditer.py (index)
++++ contrib/python/numpy/py3/numpy/core/tests/test_nditer.py (working tree)
+@@ -2031,8 +2031,11 @@ def test_buffered_cast_error_paths_unraisable():
+ buf[...] = "a"
+ del buf, it # Flushing only happens during deallocate right now.
+ """)
++ import os
++ env = os.environ.copy()
++ env['Y_PYTHON_ENTRY_POINT'] = ':main'
+ res = subprocess.check_output([sys.executable, "-c", code],
+- stderr=subprocess.STDOUT, text=True)
++ stderr=subprocess.STDOUT, text=True, env=env)
+ assert "ValueError" in res
+
+
+--- contrib/python/numpy/py3/numpy/core/tests/test_protocols.py (index)
++++ contrib/python/numpy/py3/numpy/core/tests/test_protocols.py (working tree)
+@@ -4,4 +4,5 @@ import warnings
+
+
++@pytest.mark.skip
+ @pytest.mark.filterwarnings("error")
+ def test_getattr_warning():
+--- contrib/python/numpy/py3/numpy/linalg/tests/test_linalg.py (index)
++++ contrib/python/numpy/py3/numpy/linalg/tests/test_linalg.py (working tree)
+@@ -1898,6 +1898,7 @@ def test_xerbla_override():
+ pytest.skip('Numpy xerbla not linked in.')
+
+
++@pytest.mark.skip
+ @pytest.mark.skipif(IS_WASM, reason="Cannot start subprocess")
+ @pytest.mark.slow
+ def test_sdot_bug_8577():
+--- contrib/python/numpy/py3/numpy/tests/test_reloading.py (index)
++++ contrib/python/numpy/py3/numpy/tests/test_reloading.py (working tree)
+@@ -37,6 +37,7 @@ def test_novalue():
+ protocol=proto)) is np._NoValue)
+
+
++@pytest.mark.skip
+ @pytest.mark.skipif(IS_WASM, reason="can't start subprocess")
+ def test_full_reimport():
+ """At the time of writing this, it is *not* truly supported, but
+--- contrib/python/numpy/py3/numpy/core/tests/test_limited_api.py (index)
++++ contrib/python/numpy/py3/numpy/core/tests/test_limited_api.py (working tree)
+@@ -6,6 +6,7 @@ import sysconfig
+ import pytest
+
+
++@pytest.mark.skip
+ @pytest.mark.skipif(IS_WASM, reason="Can't start subprocess")
+ @pytest.mark.xfail(
+ sysconfig.get_config_var("Py_DEBUG"),
+--- contrib/python/numpy/py3/numpy/linalg/tests/test_linalg.py (index)
++++ contrib/python/numpy/py3/numpy/linalg/tests/test_linalg.py (working tree)
+@@ -1754,6 +1754,7 @@ class TestQR:
+ assert_(isinstance(r2, a_type))
+ assert_almost_equal(r2, r1)
+
++ @pytest.mark.skip
+ @pytest.mark.parametrize("size", [
+ (3, 4), (4, 3), (4, 4),
+ (3, 0), (0, 3)])
+--- contrib/python/numpy/py3/numpy/lib/tests/test_loadtxt.py (index)
++++ contrib/python/numpy/py3/numpy/lib/tests/test_loadtxt.py (working tree)
+@@ -388,6 +388,7 @@ def test_bool():
+ assert_array_equal(res.view(np.uint8), [[1, 0], [1, 1]])
+
+
++@pytest.mark.skip
+ @pytest.mark.skipif(IS_PYPY and sys.implementation.version <= (7, 3, 8),
+ reason="PyPy bug in error formatting")
+ @pytest.mark.parametrize("dtype", np.typecodes["AllInteger"])
+@@ -406,6 +407,7 @@ def test_integer_signs(dtype):
+ np.loadtxt([f"{sign}2\n"], dtype=dtype)
+
+
++@pytest.mark.skip
+ @pytest.mark.skipif(IS_PYPY and sys.implementation.version <= (7, 3, 8),
+ reason="PyPy bug in error formatting")
+ @pytest.mark.parametrize("dtype", np.typecodes["AllInteger"])
+--- contrib/python/numpy/py3/numpy/core/tests/test_nep50_promotions.py (index)
++++ contrib/python/numpy/py3/numpy/core/tests/test_nep50_promotions.py (working tree)
+@@ -20,6 +20,7 @@ def _weak_promotion_enabled():
+ np._set_promotion_state(state)
+
+
++@pytest.mark.skip
+ @pytest.mark.skipif(IS_WASM, reason="wasm doesn't have support for fp errors")
+ def test_nep50_examples():
+ with pytest.warns(UserWarning, match="result dtype changed"):
+--- contrib/python/numpy/py3/numpy/core/tests/test_cpu_features.py (index)
++++ contrib/python/numpy/py3/numpy/core/tests/test_cpu_features.py (working tree)
+@@ -122,6 +122,7 @@ class AbstractTest:
+ " therefore this test class cannot be properly executed."
+ ),
+ )
++@pytest.mark.xfail
+ class TestEnvPrivation:
+ cwd = pathlib.Path(__file__).parent.resolve()
+ env = os.environ.copy()
+--- contrib/python/numpy/py3/numpy/core/tests/test_numeric.py (index)
++++ contrib/python/numpy/py3/numpy/core/tests/test_numeric.py (working tree)
+@@ -2352,7 +2352,7 @@ class TestClip:
+ actual = np.clip(arr, amin, amax)
+ assert_equal(actual, expected)
+
+- @pytest.mark.xfail(reason="propagation doesn't match spec")
++ @pytest.mark.skip(reason="propagation doesn't match spec")
+ @pytest.mark.parametrize("arr, amin, amax", [
+ (np.array([1] * 10, dtype='m8'),
+ np.timedelta64('NaT'),
diff --git a/contrib/python/numpy/py3/patches/05-fix-win-build.patch b/contrib/python/numpy/py3/patches/05-fix-win-build.patch
new file mode 100644
index 0000000000..c628efec95
--- /dev/null
+++ b/contrib/python/numpy/py3/patches/05-fix-win-build.patch
@@ -0,0 +1,38 @@
+--- contrib/python/numpy/py3/numpy/core/src/npymath/npy_math_private.h (index)
++++ contrib/python/numpy/py3/numpy/core/src/npymath/npy_math_private.h (working tree)
+@@ -34,6 +34,10 @@
+ #include "numpy/npy_endian.h"
+ #include "numpy/npy_common.h"
+
++#ifdef _MSC_VER // windows in ucrt\math.h makes #define complex _complex
++#undef complex
++#endif
++
+ /*
+ * The original fdlibm code used statements like:
+ * n0 = ((*(int*)&one)>>29)^1; * index of high word *
+--- contrib/python/numpy/py3/numpy/distutils/include/npy_cpu_dispatch_config.x86_64.h (index)
++++ contrib/python/numpy/py3/numpy/distutils/include/npy_cpu_dispatch_config.x86_64.h (working tree)
+@@ -53,7 +53,11 @@
+ #ifdef NPY__CPU_TARGET_POPCNT
+ /** POPCNT **/
+ #define NPY_HAVE_POPCNT 1
++#ifdef _MSC_VER
++ #include <nmmintrin.h>
++#else
+ #include <popcntintrin.h>
++#endif
+ #endif /*NPY__CPU_TARGET_POPCNT*/
+ #ifdef NPY__CPU_TARGET_SSE42
+ /** SSE42 **/
+--- contrib/python/numpy/py3/numpy/core/src/common/numpyos.c (index)
++++ contrib/python/numpy/py3/numpy/core/src/common/numpyos.c (working tree)
+@@ -783,7 +783,7 @@ NumPyOS_strtoull(const char *str, char **endptr, int base)
+
+ #include <stdlib.h>
+
+-#if _MSC_VER >= 1900
++#if _MSC_VER >= 1900 && 0
+ /* npy3k_compat.h uses this function in the _Py_BEGIN/END_SUPPRESS_IPH
+ * macros. It does not need to be defined when building using MSVC
+ * earlier than 14.0 (_MSC_VER == 1900).
diff --git a/contrib/python/numpy/py3/patches/06-fix-config.h.patch b/contrib/python/numpy/py3/patches/06-fix-config.h.patch
new file mode 100644
index 0000000000..baddbda087
--- /dev/null
+++ b/contrib/python/numpy/py3/patches/06-fix-config.h.patch
@@ -0,0 +1,19 @@
+--- contrib/python/numpy/py3/numpy/core/include/numpy/config-linux-x86_64.h (index)
++++ contrib/python/numpy/py3/numpy/core/include/numpy/config-linux-x86_64.h (working tree)
+@@ -31,3 +31,5 @@
+ #define HAVE_FALLOCATE 1
++/* breake test_extension_incref_elide and test_extension_incref_elide_stack
+ #define HAVE_BACKTRACE 1
++*/
+ #define HAVE_MADVISE 1
+@@ -90 +90 @@
+-#define NPY_CAN_LINK_SVML 1
++//#define NPY_CAN_LINK_SVML 1
+--- contrib/python/numpy/py3/numpy/core/include/numpy/config-osx-x86_64.h (index)
++++ contrib/python/numpy/py3/numpy/core/include/numpy/config-osx-x86_64.h (working tree)
+@@ -5,3 +5,5 @@
+ #define MATHLIB
++/* breake test_extension_incref_elide and test_extension_incref_elide_stack
+ #define HAVE_BACKTRACE 1
++*/
+ #define HAVE_MADVISE 1
diff --git a/contrib/python/numpy/py3/patches/09-hack-for-matplotlib.patch b/contrib/python/numpy/py3/patches/09-hack-for-matplotlib.patch
new file mode 100644
index 0000000000..1ef1f33bca
--- /dev/null
+++ b/contrib/python/numpy/py3/patches/09-hack-for-matplotlib.patch
@@ -0,0 +1,12 @@
+--- contrib/python/numpy/py3/numpy/core/include/numpy/__multiarray_api.h (index)
++++ contrib/python/numpy/py3/numpy/core/include/numpy/__multiarray_api.h (working tree)
+@@ -1,6 +1,9 @@
+
+ #if defined(_MULTIARRAYMODULE) || defined(WITH_CPYCHECKER_STEALS_REFERENCE_TO_ARG_ATTRIBUTE)
+
++// XXX: dummy import to simplify static build
++static int import_array() { return 0; }
++
+ typedef struct {
+ PyObject_HEAD
+ npy_bool obval;
diff --git a/contrib/python/numpy/py3/patches/12-arrch64.patch b/contrib/python/numpy/py3/patches/12-arrch64.patch
new file mode 100644
index 0000000000..4c1cf87244
--- /dev/null
+++ b/contrib/python/numpy/py3/patches/12-arrch64.patch
@@ -0,0 +1,327 @@
+--- contrib/python/numpy/py3/numpy/core/src/_simd/_simd.dispatch.h (index)
++++ contrib/python/numpy/py3/numpy/core/src/_simd/_simd.dispatch.h (working tree)
+@@ -10,8 +10,13 @@
+ #undef NPY__CPU_DISPATCH_CALL
+ #define NPY__CPU_DISPATCH_BASELINE_CALL(CB, ...) \
+ NPY__CPU_DISPATCH_EXPAND_(CB(__VA_ARGS__))
++#if defined(__x86_64__) || defined(_M_X64)
+ #define NPY__CPU_DISPATCH_CALL(CHK, CB, ...) \
+ NPY__CPU_DISPATCH_EXPAND_(CB((CHK(AVX512_SKX)), AVX512_SKX, __VA_ARGS__)) \
+ NPY__CPU_DISPATCH_EXPAND_(CB((CHK(AVX512F)), AVX512F, __VA_ARGS__)) \
+ NPY__CPU_DISPATCH_EXPAND_(CB((CHK(AVX)&&CHK(F16C)&&CHK(FMA3)&&CHK(AVX2)), FMA3__AVX2, __VA_ARGS__)) \
+ NPY__CPU_DISPATCH_EXPAND_(CB((CHK(SSE)&&CHK(SSE2)&&CHK(SSE3)&&CHK(SSSE3)&&CHK(SSE41)&&CHK(POPCNT)&&CHK(SSE42)), SSE42, __VA_ARGS__))
++#elif defined(__aarch64__)
++#define NPY__CPU_DISPATCH_CALL(CHK, CB, ...) \
++
++#endif
+--- contrib/python/numpy/py3/numpy/core/src/umath/_umath_tests.dispatch.h (index)
++++ contrib/python/numpy/py3/numpy/core/src/umath/_umath_tests.dispatch.h (working tree)
+@@ -10,6 +10,11 @@
+ #undef NPY__CPU_DISPATCH_CALL
+ #define NPY__CPU_DISPATCH_BASELINE_CALL(CB, ...) \
+ NPY__CPU_DISPATCH_EXPAND_(CB(__VA_ARGS__))
++#if defined(__x86_64__) || defined(_M_X64)
+ #define NPY__CPU_DISPATCH_CALL(CHK, CB, ...) \
+ NPY__CPU_DISPATCH_EXPAND_(CB((CHK(AVX)&&CHK(F16C)&&CHK(AVX2)), AVX2, __VA_ARGS__)) \
+ NPY__CPU_DISPATCH_EXPAND_(CB((CHK(SSE)&&CHK(SSE2)&&CHK(SSE3)&&CHK(SSSE3)&&CHK(SSE41)), SSE41, __VA_ARGS__))
++#elif defined(__aarch64__)
++#define NPY__CPU_DISPATCH_CALL(CHK, CB, ...) \
++ NPY__CPU_DISPATCH_EXPAND_(CB((CHK(ASIMD)&&CHK(ASIMDHP)), ASIMDHP, __VA_ARGS__))
++#endif
+--- contrib/python/numpy/py3/numpy/core/src/umath/loops_arithm_fp.dispatch.h (index)
++++ contrib/python/numpy/py3/numpy/core/src/umath/loops_arithm_fp.dispatch.h (working tree)
+@@ -10,5 +10,10 @@
+ #undef NPY__CPU_DISPATCH_CALL
+ #define NPY__CPU_DISPATCH_BASELINE_CALL(CB, ...) \
+ NPY__CPU_DISPATCH_EXPAND_(CB(__VA_ARGS__))
++#if defined(__x86_64__) || defined(_M_X64)
+ #define NPY__CPU_DISPATCH_CALL(CHK, CB, ...) \
+ NPY__CPU_DISPATCH_EXPAND_(CB((CHK(AVX)&&CHK(F16C)&&CHK(FMA3)&&CHK(AVX2)), FMA3__AVX2, __VA_ARGS__))
++#elif defined(__aarch64__)
++#define NPY__CPU_DISPATCH_CALL(CHK, CB, ...) \
++
++#endif
+--- contrib/python/numpy/py3/numpy/core/src/umath/loops_arithmetic.dispatch.h (index)
++++ contrib/python/numpy/py3/numpy/core/src/umath/loops_arithmetic.dispatch.h (working tree)
+@@ -10,8 +10,13 @@
+ #undef NPY__CPU_DISPATCH_CALL
+ #define NPY__CPU_DISPATCH_BASELINE_CALL(CB, ...) \
+ NPY__CPU_DISPATCH_EXPAND_(CB(__VA_ARGS__))
++#if defined(__x86_64__) || defined(_M_X64)
+ #define NPY__CPU_DISPATCH_CALL(CHK, CB, ...) \
+ NPY__CPU_DISPATCH_EXPAND_(CB((CHK(AVX512_SKX)), AVX512_SKX, __VA_ARGS__)) \
+ NPY__CPU_DISPATCH_EXPAND_(CB((CHK(AVX512F)), AVX512F, __VA_ARGS__)) \
+ NPY__CPU_DISPATCH_EXPAND_(CB((CHK(AVX)&&CHK(F16C)&&CHK(AVX2)), AVX2, __VA_ARGS__)) \
+ NPY__CPU_DISPATCH_EXPAND_(CB((CHK(SSE)&&CHK(SSE2)&&CHK(SSE3)&&CHK(SSSE3)&&CHK(SSE41)), SSE41, __VA_ARGS__))
++#elif defined(__aarch64__)
++#define NPY__CPU_DISPATCH_CALL(CHK, CB, ...) \
++
++#endif
+--- contrib/python/numpy/py3/numpy/core/src/umath/loops_exponent_log.dispatch.h (index)
++++ contrib/python/numpy/py3/numpy/core/src/umath/loops_exponent_log.dispatch.h (working tree)
+@@ -10,7 +10,12 @@
+ #undef NPY__CPU_DISPATCH_CALL
+ #define NPY__CPU_DISPATCH_BASELINE_CALL(CB, ...) \
+ NPY__CPU_DISPATCH_EXPAND_(CB(__VA_ARGS__))
++#if defined(__x86_64__) || defined(_M_X64)
+ #define NPY__CPU_DISPATCH_CALL(CHK, CB, ...) \
+ NPY__CPU_DISPATCH_EXPAND_(CB((CHK(AVX512_SKX)), AVX512_SKX, __VA_ARGS__)) \
+ NPY__CPU_DISPATCH_EXPAND_(CB((CHK(AVX512F)), AVX512F, __VA_ARGS__)) \
+ NPY__CPU_DISPATCH_EXPAND_(CB((CHK(AVX)&&CHK(F16C)&&CHK(FMA3)&&CHK(AVX2)), FMA3__AVX2, __VA_ARGS__))
++#elif defined(__aarch64__)
++#define NPY__CPU_DISPATCH_CALL(CHK, CB, ...) \
++
++#endif
+--- contrib/python/numpy/py3/numpy/core/src/umath/loops_trigonometric.dispatch.h (index)
++++ contrib/python/numpy/py3/numpy/core/src/umath/loops_trigonometric.dispatch.h (working tree)
+@@ -10,6 +10,11 @@
+ #undef NPY__CPU_DISPATCH_CALL
+ #define NPY__CPU_DISPATCH_BASELINE_CALL(CB, ...) \
+ NPY__CPU_DISPATCH_EXPAND_(CB(__VA_ARGS__))
++#if defined(__x86_64__) || defined(_M_X64)
+ #define NPY__CPU_DISPATCH_CALL(CHK, CB, ...) \
+ NPY__CPU_DISPATCH_EXPAND_(CB((CHK(AVX512F)), AVX512F, __VA_ARGS__)) \
+ NPY__CPU_DISPATCH_EXPAND_(CB((CHK(AVX)&&CHK(F16C)&&CHK(FMA3)&&CHK(AVX2)), FMA3__AVX2, __VA_ARGS__))
++#elif defined(__aarch64__)
++#define NPY__CPU_DISPATCH_CALL(CHK, CB, ...) \
++
++#endif
+--- contrib/python/numpy/py3/numpy/core/src/umath/loops_umath_fp.dispatch.h (index)
++++ contrib/python/numpy/py3/numpy/core/src/umath/loops_umath_fp.dispatch.h (working tree)
+@@ -10,5 +10,10 @@
+ #undef NPY__CPU_DISPATCH_CALL
+ #define NPY__CPU_DISPATCH_BASELINE_CALL(CB, ...) \
+ NPY__CPU_DISPATCH_EXPAND_(CB(__VA_ARGS__))
++#if defined(__x86_64__) || defined(_M_X64)
+ #define NPY__CPU_DISPATCH_CALL(CHK, CB, ...) \
+ NPY__CPU_DISPATCH_EXPAND_(CB((CHK(AVX512_SKX)), AVX512_SKX, __VA_ARGS__))
++#elif defined(__aarch64__)
++#define NPY__CPU_DISPATCH_CALL(CHK, CB, ...) \
++
++#endif
+--- contrib/python/numpy/py3/numpy/core/src/umath/loops_unary_fp.dispatch.h (index)
++++ contrib/python/numpy/py3/numpy/core/src/umath/loops_unary_fp.dispatch.h (working tree)
+@@ -10,5 +10,10 @@
+ #undef NPY__CPU_DISPATCH_CALL
+ #define NPY__CPU_DISPATCH_BASELINE_CALL(CB, ...) \
+ NPY__CPU_DISPATCH_EXPAND_(CB(__VA_ARGS__))
++#if defined(__x86_64__) || defined(_M_X64)
+ #define NPY__CPU_DISPATCH_CALL(CHK, CB, ...) \
+ NPY__CPU_DISPATCH_EXPAND_(CB((CHK(SSE)&&CHK(SSE2)&&CHK(SSE3)&&CHK(SSSE3)&&CHK(SSE41)), SSE41, __VA_ARGS__))
++#elif defined(__aarch64__)
++#define NPY__CPU_DISPATCH_CALL(CHK, CB, ...) \
++
++#endif
+--- contrib/python/numpy/py3/numpy/core/src/multiarray/argfunc.dispatch.h (index)
++++ contrib/python/numpy/py3/numpy/core/src/multiarray/argfunc.dispatch.h (working tree)
+@@ -10,7 +10,12 @@
+ #undef NPY__CPU_DISPATCH_CALL
+ #define NPY__CPU_DISPATCH_BASELINE_CALL(CB, ...) \
+ NPY__CPU_DISPATCH_EXPAND_(CB(__VA_ARGS__))
++#if defined(__x86_64__) || defined(_M_X64)
+ #define NPY__CPU_DISPATCH_CALL(CHK, CB, ...) \
+ NPY__CPU_DISPATCH_EXPAND_(CB((CHK(AVX512_SKX)), AVX512_SKX, __VA_ARGS__)) \
+ NPY__CPU_DISPATCH_EXPAND_(CB((CHK(AVX)&&CHK(F16C)&&CHK(AVX2)), AVX2, __VA_ARGS__)) \
+ NPY__CPU_DISPATCH_EXPAND_(CB((CHK(SSE)&&CHK(SSE2)&&CHK(SSE3)&&CHK(SSSE3)&&CHK(SSE41)&&CHK(POPCNT)&&CHK(SSE42)), SSE42, __VA_ARGS__))
++#elif defined(__aarch64__)
++#define NPY__CPU_DISPATCH_CALL(CHK, CB, ...) \
++
++#endif
+--- contrib/python/numpy/py3/numpy/core/src/umath/loops_hyperbolic.dispatch.h (index)
++++ contrib/python/numpy/py3/numpy/core/src/umath/loops_hyperbolic.dispatch.h (working tree)
+@@ -10,6 +10,11 @@
+ #undef NPY__CPU_DISPATCH_CALL
+ #define NPY__CPU_DISPATCH_BASELINE_CALL(CB, ...) \
+ NPY__CPU_DISPATCH_EXPAND_(CB(__VA_ARGS__))
++#if defined(__x86_64__) || defined(_M_X64)
+ #define NPY__CPU_DISPATCH_CALL(CHK, CB, ...) \
+ NPY__CPU_DISPATCH_EXPAND_(CB((CHK(AVX512_SKX)), AVX512_SKX, __VA_ARGS__)) \
+ NPY__CPU_DISPATCH_EXPAND_(CB((CHK(AVX)&&CHK(F16C)&&CHK(FMA3)&&CHK(AVX2)), FMA3__AVX2, __VA_ARGS__))
++#elif defined(__aarch64__)
++#define NPY__CPU_DISPATCH_CALL(CHK, CB, ...) \
++
++#endif
+--- contrib/python/numpy/py3/numpy/core/src/umath/loops_minmax.dispatch.h (index)
++++ contrib/python/numpy/py3/numpy/core/src/umath/loops_minmax.dispatch.h (working tree)
+@@ -10,6 +10,11 @@
+ #undef NPY__CPU_DISPATCH_CALL
+ #define NPY__CPU_DISPATCH_BASELINE_CALL(CB, ...) \
+ NPY__CPU_DISPATCH_EXPAND_(CB(__VA_ARGS__))
++#if defined(__x86_64__) || defined(_M_X64)
+ #define NPY__CPU_DISPATCH_CALL(CHK, CB, ...) \
+ NPY__CPU_DISPATCH_EXPAND_(CB((CHK(AVX512_SKX)), AVX512_SKX, __VA_ARGS__)) \
+ NPY__CPU_DISPATCH_EXPAND_(CB((CHK(AVX)&&CHK(F16C)&&CHK(AVX2)), AVX2, __VA_ARGS__))
++#elif defined(__aarch64__)
++#define NPY__CPU_DISPATCH_CALL(CHK, CB, ...) \
++
++#endif
+--- contrib/python/numpy/py3/numpy/core/src/umath/loops_comparison.dispatch.h (index)
++++ contrib/python/numpy/py3/numpy/core/src/umath/loops_comparison.dispatch.h (working tree)
+@@ -10,8 +10,13 @@
+ #undef NPY__CPU_DISPATCH_CALL
+ #define NPY__CPU_DISPATCH_BASELINE_CALL(CB, ...) \
+ NPY__CPU_DISPATCH_EXPAND_(CB(__VA_ARGS__))
++#if defined(__x86_64__) || defined(_M_X64)
+ #define NPY__CPU_DISPATCH_CALL(CHK, CB, ...) \
+ NPY__CPU_DISPATCH_EXPAND_(CB((CHK(AVX512_SKX)), AVX512_SKX, __VA_ARGS__)) \
+ NPY__CPU_DISPATCH_EXPAND_(CB((CHK(AVX512F)), AVX512F, __VA_ARGS__)) \
+ NPY__CPU_DISPATCH_EXPAND_(CB((CHK(AVX)&&CHK(F16C)&&CHK(AVX2)), AVX2, __VA_ARGS__)) \
+ NPY__CPU_DISPATCH_EXPAND_(CB((CHK(SSE)&&CHK(SSE2)&&CHK(SSE3)&&CHK(SSSE3)&&CHK(SSE41)&&CHK(POPCNT)&&CHK(SSE42)), SSE42, __VA_ARGS__))
++#elif defined(__aarch64__)
++#define NPY__CPU_DISPATCH_CALL(CHK, CB, ...) \
++
++#endif
+--- contrib/python/numpy/py3/numpy/core/src/umath/_umath_tests.dispatch.asimdhp.c (index)
++++ contrib/python/numpy/py3/numpy/core/src/umath/_umath_tests.dispatch.asimdhp.c (working tree)
+@@ -0,0 +1,12 @@
++/**
++ * AUTOGENERATED DON'T EDIT
++ * Please make changes to the code generator (distutils/ccompiler_opt.py)
++ */
++#define NPY__CPU_TARGET_MODE
++#define NPY__CPU_TARGET_CURRENT ASIMDHP
++#define NPY__CPU_TARGET_NEON
++#define NPY__CPU_TARGET_NEON_FP16
++#define NPY__CPU_TARGET_NEON_VFPV4
++#define NPY__CPU_TARGET_ASIMD
++#define NPY__CPU_TARGET_ASIMDHP
++#include "_umath_tests.dispatch.c"
+--- contrib/python/numpy/py3/numpy/distutils/include/npy_cpu_dispatch_config.aarch64.h (index)
++++ contrib/python/numpy/py3/numpy/distutils/include/npy_cpu_dispatch_config.aarch64.h (working tree)
+@@ -0,0 +1,42 @@
++/*
++ * AUTOGENERATED DON'T EDIT
++ * Please make changes to the code generator (distutils/ccompiler_opt.py)
++*/
++#define NPY_WITH_CPU_BASELINE "NEON NEON_FP16 NEON_VFPV4 ASIMD"
++#define NPY_WITH_CPU_DISPATCH "ASIMDHP ASIMDDP ASIMDFHM"
++#define NPY_WITH_CPU_BASELINE_N 4
++#define NPY_WITH_CPU_DISPATCH_N 3
++#define NPY_WITH_CPU_EXPAND_(X) X
++#define NPY_WITH_CPU_BASELINE_CALL(MACRO_TO_CALL, ...) \
++ NPY_WITH_CPU_EXPAND_(MACRO_TO_CALL(NEON, __VA_ARGS__)) \
++ NPY_WITH_CPU_EXPAND_(MACRO_TO_CALL(NEON_FP16, __VA_ARGS__)) \
++ NPY_WITH_CPU_EXPAND_(MACRO_TO_CALL(NEON_VFPV4, __VA_ARGS__)) \
++ NPY_WITH_CPU_EXPAND_(MACRO_TO_CALL(ASIMD, __VA_ARGS__))
++#define NPY_WITH_CPU_DISPATCH_CALL(MACRO_TO_CALL, ...) \
++ NPY_WITH_CPU_EXPAND_(MACRO_TO_CALL(ASIMDHP, __VA_ARGS__)) \
++ NPY_WITH_CPU_EXPAND_(MACRO_TO_CALL(ASIMDDP, __VA_ARGS__)) \
++ NPY_WITH_CPU_EXPAND_(MACRO_TO_CALL(ASIMDFHM, __VA_ARGS__))
++/******* baseline features *******/
++ /** NEON **/
++ #define NPY_HAVE_NEON 1
++ #include <arm_neon.h>
++ /** NEON_FP16 **/
++ #define NPY_HAVE_NEON_FP16 1
++ /** NEON_VFPV4 **/
++ #define NPY_HAVE_NEON_VFPV4 1
++ /** ASIMD **/
++ #define NPY_HAVE_ASIMD 1
++
++/******* dispatch features *******/
++#ifdef NPY__CPU_TARGET_ASIMDHP
++ /** ASIMDHP **/
++ #define NPY_HAVE_ASIMDHP 1
++#endif /*NPY__CPU_TARGET_ASIMDHP*/
++#ifdef NPY__CPU_TARGET_ASIMDDP
++ /** ASIMDDP **/
++ #define NPY_HAVE_ASIMDDP 1
++#endif /*NPY__CPU_TARGET_ASIMDDP*/
++#ifdef NPY__CPU_TARGET_ASIMDFHM
++ /** ASIMDFHM **/
++ #define NPY_HAVE_ASIMDFHM 1
++#endif /*NPY__CPU_TARGET_ASIMDFHM*/
+--- contrib/python/numpy/py3/numpy/core/src/npysort/simd_qsort.dispatch.h (index)
++++ contrib/python/numpy/py3/numpy/core/src/npysort/simd_qsort.dispatch.h (working tree)
+@@ -10,5 +10,10 @@
+ #undef NPY__CPU_DISPATCH_CALL
+ #define NPY__CPU_DISPATCH_BASELINE_CALL(CB, ...) \
+
++#if defined(__x86_64__) || defined(_M_X64)
+ #define NPY__CPU_DISPATCH_CALL(CHK, CB, ...) \
+ NPY__CPU_DISPATCH_EXPAND_(CB((CHK(AVX512_SKX)), AVX512_SKX, __VA_ARGS__))
++#elif defined(__aarch64__)
++#define NPY__CPU_DISPATCH_CALL(CHK, CB, ...) \
++
++#endif
+--- contrib/python/numpy/py3/numpy/core/src/npysort/simd_qsort_16bit.dispatch.h (index)
++++ contrib/python/numpy/py3/numpy/core/src/npysort/simd_qsort_16bit.dispatch.h (working tree)
+@@ -10,5 +10,10 @@
+ #undef NPY__CPU_DISPATCH_CALL
+ #define NPY__CPU_DISPATCH_BASELINE_CALL(CB, ...) \
+
++#if defined(__x86_64__) || defined(_M_X64)
+ #define NPY__CPU_DISPATCH_CALL(CHK, CB, ...) \
+ NPY__CPU_DISPATCH_EXPAND_(CB((CHK(AVX512_ICL)), AVX512_ICL, __VA_ARGS__))
++#elif defined(__aarch64__)
++#define NPY__CPU_DISPATCH_CALL(CHK, CB, ...) \
++
++#endif
+--- contrib/python/numpy/py3/numpy/core/src/umath/loops_autovec.dispatch.h (index)
++++ contrib/python/numpy/py3/numpy/core/src/umath/loops_autovec.dispatch.h (working tree)
+@@ -10,5 +10,10 @@
+ #undef NPY__CPU_DISPATCH_CALL
+ #define NPY__CPU_DISPATCH_BASELINE_CALL(CB, ...) \
+ NPY__CPU_DISPATCH_EXPAND_(CB(__VA_ARGS__))
++#if defined(__x86_64__) || defined(_M_X64)
+ #define NPY__CPU_DISPATCH_CALL(CHK, CB, ...) \
+ NPY__CPU_DISPATCH_EXPAND_(CB((CHK(AVX)&&CHK(F16C)&&CHK(AVX2)), AVX2, __VA_ARGS__))
++#elif defined(__aarch64__)
++#define NPY__CPU_DISPATCH_CALL(CHK, CB, ...) \
++
++#endif
+--- contrib/python/numpy/py3/numpy/core/src/umath/loops_logical.dispatch.h (index)
++++ contrib/python/numpy/py3/numpy/core/src/umath/loops_logical.dispatch.h (working tree)
+@@ -10,6 +10,11 @@
+ #undef NPY__CPU_DISPATCH_CALL
+ #define NPY__CPU_DISPATCH_BASELINE_CALL(CB, ...) \
+ NPY__CPU_DISPATCH_EXPAND_(CB(__VA_ARGS__))
++#if defined(__x86_64__) || defined(_M_X64)
+ #define NPY__CPU_DISPATCH_CALL(CHK, CB, ...) \
+ NPY__CPU_DISPATCH_EXPAND_(CB((CHK(AVX512_SKX)), AVX512_SKX, __VA_ARGS__)) \
+ NPY__CPU_DISPATCH_EXPAND_(CB((CHK(AVX)&&CHK(F16C)&&CHK(AVX2)), AVX2, __VA_ARGS__))
++#elif defined(__aarch64__)
++#define NPY__CPU_DISPATCH_CALL(CHK, CB, ...) \
++
++#endif
+--- contrib/python/numpy/py3/numpy/core/src/umath/loops_unary.dispatch.h (index)
++++ contrib/python/numpy/py3/numpy/core/src/umath/loops_unary.dispatch.h (working tree)
+@@ -10,6 +10,11 @@
+ #undef NPY__CPU_DISPATCH_CALL
+ #define NPY__CPU_DISPATCH_BASELINE_CALL(CB, ...) \
+ NPY__CPU_DISPATCH_EXPAND_(CB(__VA_ARGS__))
++#if defined(__x86_64__) || defined(_M_X64)
+ #define NPY__CPU_DISPATCH_CALL(CHK, CB, ...) \
+ NPY__CPU_DISPATCH_EXPAND_(CB((CHK(AVX512_SKX)), AVX512_SKX, __VA_ARGS__)) \
+ NPY__CPU_DISPATCH_EXPAND_(CB((CHK(AVX)&&CHK(F16C)&&CHK(AVX2)), AVX2, __VA_ARGS__))
++#elif defined(__aarch64__)
++#define NPY__CPU_DISPATCH_CALL(CHK, CB, ...) \
++
++#endif
+--- contrib/python/numpy/py3/numpy/core/src/umath/loops_unary_complex.dispatch.h (index)
++++ contrib/python/numpy/py3/numpy/core/src/umath/loops_unary_complex.dispatch.h (working tree)
+@@ -10,6 +10,11 @@
+ #undef NPY__CPU_DISPATCH_CALL
+ #define NPY__CPU_DISPATCH_BASELINE_CALL(CB, ...) \
+ NPY__CPU_DISPATCH_EXPAND_(CB(__VA_ARGS__))
++#if defined(__x86_64__) || defined(_M_X64)
+ #define NPY__CPU_DISPATCH_CALL(CHK, CB, ...) \
+ NPY__CPU_DISPATCH_EXPAND_(CB((CHK(AVX512F)), AVX512F, __VA_ARGS__)) \
+ NPY__CPU_DISPATCH_EXPAND_(CB((CHK(AVX)&&CHK(F16C)&&CHK(FMA3)&&CHK(AVX2)), FMA3__AVX2, __VA_ARGS__))
++#elif defined(__aarch64__)
++#define NPY__CPU_DISPATCH_CALL(CHK, CB, ...) \
++
++#endif
+--- contrib/python/numpy/py3/numpy/core/src/umath/loops_unary_fp_le.dispatch.h (index)
++++ contrib/python/numpy/py3/numpy/core/src/umath/loops_unary_fp_le.dispatch.h (working tree)
+@@ -10,5 +10,10 @@
+ #undef NPY__CPU_DISPATCH_CALL
+ #define NPY__CPU_DISPATCH_BASELINE_CALL(CB, ...) \
+ NPY__CPU_DISPATCH_EXPAND_(CB(__VA_ARGS__))
++#if defined(__x86_64__) || defined(_M_X64)
+ #define NPY__CPU_DISPATCH_CALL(CHK, CB, ...) \
+ NPY__CPU_DISPATCH_EXPAND_(CB((CHK(SSE)&&CHK(SSE2)&&CHK(SSE3)&&CHK(SSSE3)&&CHK(SSE41)), SSE41, __VA_ARGS__))
++#elif defined(__aarch64__)
++#define NPY__CPU_DISPATCH_CALL(CHK, CB, ...) \
++
++#endif
diff --git a/contrib/python/numpy/py3/patches/14-libunwind.h.patch b/contrib/python/numpy/py3/patches/14-libunwind.h.patch
new file mode 100644
index 0000000000..85b0f871ae
--- /dev/null
+++ b/contrib/python/numpy/py3/patches/14-libunwind.h.patch
@@ -0,0 +1,22 @@
+--- contrib/python/numpy/py3/numpy/core/src/multiarray/temp_elide.c (index)
++++ contrib/python/numpy/py3/numpy/core/src/multiarray/temp_elide.c (working tree)
+@@ -86,7 +86,7 @@
+ #if defined HAVE_EXECINFO_H
+ #include <execinfo.h>
+ #elif defined HAVE_LIBUNWIND_H
+-#include <libunwind.h>
++#error #include <libunwind.h>
+ #endif
+
+ /*
+--- contrib/python/numpy/py3/numpy/linalg/umath_linalg.cpp (index)
++++ contrib/python/numpy/py3/numpy/linalg/umath_linalg.cpp (working tree)
+@@ -54,7 +54,7 @@ using dispatch_scalar = typename std::conditional<std::is_scalar<typ>::value, sc
+ #if defined HAVE_EXECINFO_H
+ #include <execinfo.h>
+ #elif defined HAVE_LIBUNWIND_H
+-#include <libunwind.h>
++#error #include <libunwind.h>
+ #endif
+ void
+ dbg_stack_trace()
diff --git a/contrib/python/numpy/py3/patches/15-support-python-3.12.patch b/contrib/python/numpy/py3/patches/15-support-python-3.12.patch
new file mode 100644
index 0000000000..5deb065a44
--- /dev/null
+++ b/contrib/python/numpy/py3/patches/15-support-python-3.12.patch
@@ -0,0 +1,11 @@
+--- contrib/python/numpy/py3/numpy/tests/test_public_api.py (index)
++++ contrib/python/numpy/py3/numpy/tests/test_public_api.py (working tree)
+@@ -339,6 +339,8 @@ SKIP_LIST = [
+ ]
+ if sys.version_info < (3, 12):
+ SKIP_LIST += ["numpy.distutils.msvc9compiler"]
++else:
++ SKIP_LIST += ["numpy.distutils"]
+
+
+ # suppressing warnings from deprecated modules