summaryrefslogtreecommitdiff
path: root/dev-python/numpy/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2021-12-05 02:47:11 +0000
committerV3n3RiX <venerix@koprulu.sector>2021-12-05 02:47:11 +0000
commit2771f79232c273bc2a57d23bf335dd81ccf6af28 (patch)
treec8af0fd04194aed03cf067d44e53c7edd3e9ab84 /dev-python/numpy/files
parente9d044d4b9b71200a96adfa280848858c0f468c9 (diff)
gentoo resync : 05.12.2021
Diffstat (limited to 'dev-python/numpy/files')
-rw-r--r--dev-python/numpy/files/numpy-1.21.4-build-compiler-args-ceph.patch49
-rw-r--r--dev-python/numpy/files/numpy-1.21.4-copy-python-3.9.patch52
2 files changed, 101 insertions, 0 deletions
diff --git a/dev-python/numpy/files/numpy-1.21.4-build-compiler-args-ceph.patch b/dev-python/numpy/files/numpy-1.21.4-build-compiler-args-ceph.patch
new file mode 100644
index 000000000000..6a31d2efe970
--- /dev/null
+++ b/dev-python/numpy/files/numpy-1.21.4-build-compiler-args-ceph.patch
@@ -0,0 +1,49 @@
+https://github.com/numpy/numpy/commit/689d905f501b7abbddf0fdef241fa586a83e5cd6
+https://github.com/numpy/numpy/pull/20116
+https://bugs.gentoo.org/802150
+
+From 7dcf62379f41407d8f9583d1c2016e3d8ec48384 Mon Sep 17 00:00:00 2001
+From: Hector Martin <marcan@marcan.st>
+Date: Thu, 14 Oct 2021 14:58:52 +0900
+Subject: [PATCH] MAINT: Fix issue with C compiler args containing spaces
+
+Instead of doing a dumb string split, use shlex to make sure args
+containing spaces are handled properly.
+---
+ numpy/distutils/unixccompiler.py | 13 +++++++------
+ 1 file changed, 7 insertions(+), 6 deletions(-)
+
+diff --git a/numpy/distutils/unixccompiler.py b/numpy/distutils/unixccompiler.py
+index 733a9fc5094..4884960fdf2 100644
+--- a/numpy/distutils/unixccompiler.py
++++ b/numpy/distutils/unixccompiler.py
+@@ -5,6 +5,7 @@
+ import os
+ import sys
+ import subprocess
++import shlex
+
+ from distutils.errors import CompileError, DistutilsExecError, LibError
+ from distutils.unixccompiler import UnixCCompiler
+@@ -30,15 +31,15 @@ def UnixCCompiler__compile(self, obj, src, ext, cc_args, extra_postargs, pp_opts
+ if 'OPT' in os.environ:
+ # XXX who uses this?
+ from sysconfig import get_config_vars
+- opt = " ".join(os.environ['OPT'].split())
+- gcv_opt = " ".join(get_config_vars('OPT')[0].split())
+- ccomp_s = " ".join(self.compiler_so)
++ opt = shlex.join(shlex.split(os.environ['OPT']))
++ gcv_opt = shlex.join(shlex.split(get_config_vars('OPT')[0]))
++ ccomp_s = shlex.join(self.compiler_so)
+ if opt not in ccomp_s:
+ ccomp_s = ccomp_s.replace(gcv_opt, opt)
+- self.compiler_so = ccomp_s.split()
+- llink_s = " ".join(self.linker_so)
++ self.compiler_so = shlex.split(ccomp_s)
++ llink_s = shlex.join(self.linker_so)
+ if opt not in llink_s:
+- self.linker_so = llink_s.split() + opt.split()
++ self.linker_so = self.linker_so + shlex.split(opt)
+
+ display = '%s: %s' % (os.path.basename(self.compiler_so[0]), src)
+
diff --git a/dev-python/numpy/files/numpy-1.21.4-copy-python-3.9.patch b/dev-python/numpy/files/numpy-1.21.4-copy-python-3.9.patch
new file mode 100644
index 000000000000..81464151e753
--- /dev/null
+++ b/dev-python/numpy/files/numpy-1.21.4-copy-python-3.9.patch
@@ -0,0 +1,52 @@
+https://github.com/numpy/numpy/commit/50823973e857363f7d8052768276c2e86f004d61
+https://github.com/numpy/numpy/pull/20357
+
+From: Bas van Beek <b.f.van.beek@vu.nl>
+Date: Wed, 10 Nov 2021 15:36:00 +0100
+Subject: [PATCH] MAINT: Do not forward `__(deep)copy__` calls of
+ `_GenericAlias` to the wrapped type
+
+Adapt to the python 3.9.8 changes made in bpo-45167.
+--- a/numpy/typing/_generic_alias.py
++++ b/numpy/typing/_generic_alias.py
+@@ -178,6 +178,8 @@ def __eq__(self, value: object) -> bool:
+ "__mro_entries__",
+ "__reduce__",
+ "__reduce_ex__",
++ "__copy__",
++ "__deepcopy__",
+ })
+
+ def __getattribute__(self, name: str) -> Any:
+--- a/numpy/typing/tests/test_generic_alias.py
++++ b/numpy/typing/tests/test_generic_alias.py
+@@ -1,6 +1,7 @@
+ from __future__ import annotations
+
+ import sys
++import copy
+ import types
+ import pickle
+ import weakref
+@@ -74,6 +75,21 @@ def test_pass(self, name: str, func: FuncType) -> None:
+ value_ref = func(NDArray_ref)
+ assert value == value_ref
+
++ @pytest.mark.parametrize("name,func", [
++ ("__copy__", lambda n: n == copy.copy(n)),
++ ("__deepcopy__", lambda n: n == copy.deepcopy(n)),
++ ])
++ def test_copy(self, name: str, func: FuncType) -> None:
++ value = func(NDArray)
++
++ # xref bpo-45167
++ GE_398 = (
++ sys.version_info[:2] == (3, 9) and sys.version_info >= (3, 9, 8)
++ )
++ if GE_398 or sys.version_info >= (3, 10, 1):
++ value_ref = func(NDArray_ref)
++ assert value == value_ref
++
+ def test_weakref(self) -> None:
+ """Test ``__weakref__``."""
+ value = weakref.ref(NDArray)()