1 |
commit: a0809fc6c528672ee4eb88221bdf38d5cc3def16 |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Sep 8 05:58:23 2021 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Sep 8 05:58:23 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a0809fc6 |
7 |
|
8 |
dev-python/numpy: Remove old |
9 |
|
10 |
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org> |
11 |
|
12 |
dev-python/numpy/Manifest | 12 -- |
13 |
.../files/numpy-1.20.1-no-hardcode-blasv2.patch | 50 ------- |
14 |
.../files/numpy-1.20.2-fix-ccompiler-tests.patch | 36 ------ |
15 |
.../files/numpy-1.20.2-fix-popcnt-detection.patch | 103 --------------- |
16 |
.../files/numpy-1.20.3-float-hashing-py310.patch | 129 ------------------ |
17 |
dev-python/numpy/numpy-1.20.2-r1.ebuild | 144 --------------------- |
18 |
dev-python/numpy/numpy-1.20.3-r1.ebuild | 142 -------------------- |
19 |
dev-python/numpy/numpy-1.21.0.ebuild | 139 -------------------- |
20 |
8 files changed, 755 deletions(-) |
21 |
|
22 |
diff --git a/dev-python/numpy/Manifest b/dev-python/numpy/Manifest |
23 |
index 0c0ed744521..fbe95681182 100644 |
24 |
--- a/dev-python/numpy/Manifest |
25 |
+++ b/dev-python/numpy/Manifest |
26 |
@@ -1,20 +1,8 @@ |
27 |
-DIST numpy-1.20.2.zip 7756879 BLAKE2B 8b76942e04701e164029b145fed1747de72142ea4f5a8aa7472a01caeeed5e0b5b6d9e543106f9786e231df5a8afe3b7ad9256e69873e4f8876c659114bc494e SHA512 337a66d68c965da06f757a89b58d30b83ec0b2f3c7a3bb39496e5031e50fee6c4f2ec090202c3da9a20613864ea46d032ae75af1de5c33eebe515133ef37d40c |
28 |
-DIST numpy-1.20.3.zip 7761912 BLAKE2B a4da49f7c1aadca299acb1b6d92deb4f50b1881c4b131cd389524a88ffc70179b2acdc88235dccd1ffd09879893db45b16bf2f54ced9b9639b806e85f7346285 SHA512 897be1cd6f3880711149dcedd838357e2d937a3c5f36b2a0db6ceed341654acf96b8b775610e1b43bdb6eacb987bbc51aaa8906244ca02cc8c2eae359ccef405 |
29 |
-DIST numpy-1.21.0.zip 10252686 BLAKE2B 98f69855fae35f53a3bd467ca9bc0c06438519e6dc84808de829a4b1e41402b764c35ac4f94edba72496693241f85f488d6f91c81e7e5c3e33fdac264ce9ba56 SHA512 b4653ed78030d3c411fcafc08c6656072480704379810b7e3a4d907b55c255c27dcef6d519cdc0bb2dc79324c475baf0263248fb456be18a9ce80e3a2c5c7120 |
30 |
DIST numpy-1.21.1.zip 10259878 BLAKE2B ba5d8eb2d294e199c86d8e96026d148098f5716398e730e0fdfee3b710fd01cb6e877973471d7751a2e558c2eaeb626fe9ce5ea4b03a7e4f8e5dc42b852d5b7c SHA512 694100915f4e2917d70a83e7fcdad30c85ffad8f5ad8d164c89287846c1b746c2b577233bacf53e8d8ca5147391f46065a2cabf100957bb8841dee4a042bc1f5 |
31 |
DIST numpy-1.21.2.zip 10264801 BLAKE2B 2d88506faa5bc767a16c000f201559917d800fd205c75f30c1e61d4b34e214b376da9876e96186914f9fe23bf033a305bf9212f593841407e3bf4e516b5982a6 SHA512 ad08110d9a73a73ef1a546de5fcd6dfe600c17b396f629c3a19ade7b3f226688cf7524fed78c035fd4ddda135e2bcf9facb5e061fb59640b424da2ed070c4184 |
32 |
-DIST numpy-html-1.16.4.zip 12097069 BLAKE2B db1f897342fbc80a761fbaee7b0eee3761dbfa04ef6c46a137bb2392caaec8256580467ce06498cceeada2639151a1ec75dafab484d64cb897c008727d6d32a5 SHA512 c44c5e1e0cb22f9dd46fe9e302030292d85e567456178fee296746a414271634e906509fb6665ac63fbfebdd13c5383574f0aa47b4fbc639063da31addc3316a |
33 |
-DIST numpy-html-1.20.3.zip 22936526 BLAKE2B 9c0bf4edea0c34640a2f2d84f117aa383f8690f5c99eb9c504aa27c07195c1e5a4219efc798398d8de709803b67d4a41a2739b1319b6dd7aeba3e70e817c2488 SHA512 181ff49fcde40f2d260e480d4a90bd8b439aecafef4ea581749b5a432c7e8c163b1714a97fd447c512b550d5bf3d9b104c575b4939eb5c8b7b70bbce1153982a |
34 |
-DIST numpy-html-1.21.0.zip 24270531 BLAKE2B 8a7a531afa559aebeb7a7b7ef94b2248df60a60fdfc190ca002dda625003df8b432fed393d6dd0c0c00fafbeb5064a61e3d99bba1a6c41e1e6e34ce091a43c89 SHA512 a165b95729a13806a03464cf39c20a0e18cfcf7701f05cd7777cd115bfaf0972f7155d201c7bd8d4177c5761f8800c982b3e3c29729a5e9ed356059842a44dcc |
35 |
DIST numpy-html-1.21.1.zip 24270531 BLAKE2B 8a7a531afa559aebeb7a7b7ef94b2248df60a60fdfc190ca002dda625003df8b432fed393d6dd0c0c00fafbeb5064a61e3d99bba1a6c41e1e6e34ce091a43c89 SHA512 a165b95729a13806a03464cf39c20a0e18cfcf7701f05cd7777cd115bfaf0972f7155d201c7bd8d4177c5761f8800c982b3e3c29729a5e9ed356059842a44dcc |
36 |
DIST numpy-html-1.21.2.zip 24270531 BLAKE2B 8a7a531afa559aebeb7a7b7ef94b2248df60a60fdfc190ca002dda625003df8b432fed393d6dd0c0c00fafbeb5064a61e3d99bba1a6c41e1e6e34ce091a43c89 SHA512 a165b95729a13806a03464cf39c20a0e18cfcf7701f05cd7777cd115bfaf0972f7155d201c7bd8d4177c5761f8800c982b3e3c29729a5e9ed356059842a44dcc |
37 |
-DIST numpy-ref-1.16.4.pdf 5176571 BLAKE2B 9a875ebd1473b241d463d810a6d191581aef961158f2f82959671b554ace3ad482795e4f3e1cb7dd4632cff926c1e864c675a7624fb0f4e4f297948bf50f0564 SHA512 983ba0f34a70c011886bdbc9fd8f3f75a3a967ca29217acc76fa46e7da391296a5628c9a557ac76efb393271abfb8ee4f376d401c1cc1e5c30622e54b9325d09 |
38 |
-DIST numpy-ref-1.20.3.pdf 7362241 BLAKE2B bf17564d7aea0db25ca9ef6b24dbbd25093c09e2a93bb60b69220d4e666024c50f3373fdb65aac510c06420dc415102d552fb0435e1986330ffdc41e9e356098 SHA512 316e645402125ca41d1e8b4da33374703f4379c31cf572c8ad429e0e89b6968776f480f9159bce53b9fdec918f03b82e5bb6446f127f43f138d6c0990191af5a |
39 |
-DIST numpy-ref-1.21.0.pdf 7326979 BLAKE2B 3c1130a576c46e0705ca1f12e7a3345beb1acdd23de2a81448e4e9755636dec313e277a0d3167dc3b211332b3fc415ac0d96e7c99e859b51a16a589426814182 SHA512 5dd37ca03f1f098fffce80aa6a1a6eb8ec66df4322da1c620bd1f507e89ee2ceb222de32c9b7974f085ddf146f0a789ea8eb27d792a13c1aa8a893c00f94f75f |
40 |
DIST numpy-ref-1.21.1.pdf 7326979 BLAKE2B 3c1130a576c46e0705ca1f12e7a3345beb1acdd23de2a81448e4e9755636dec313e277a0d3167dc3b211332b3fc415ac0d96e7c99e859b51a16a589426814182 SHA512 5dd37ca03f1f098fffce80aa6a1a6eb8ec66df4322da1c620bd1f507e89ee2ceb222de32c9b7974f085ddf146f0a789ea8eb27d792a13c1aa8a893c00f94f75f |
41 |
DIST numpy-ref-1.21.2.pdf 7326979 BLAKE2B 3c1130a576c46e0705ca1f12e7a3345beb1acdd23de2a81448e4e9755636dec313e277a0d3167dc3b211332b3fc415ac0d96e7c99e859b51a16a589426814182 SHA512 5dd37ca03f1f098fffce80aa6a1a6eb8ec66df4322da1c620bd1f507e89ee2ceb222de32c9b7974f085ddf146f0a789ea8eb27d792a13c1aa8a893c00f94f75f |
42 |
-DIST numpy-user-1.16.4.pdf 596203 BLAKE2B da3ad1f0ec1c965d20656f73a970911cbb58efa73a5df89e2e6485e0dd763f483e35eea1395ac919bf35d496fb216cee954fc5d31edebc1796a24a2a7a2d12b9 SHA512 3083008547213bfa98ffa5cd8e2cea13f6947f42d83aef61502a2a852b0d5f27d727c76b42d281d7a2f4f76c78e88b12ee3d9b164b39fe1f0213ace7097357d6 |
43 |
-DIST numpy-user-1.20.3.pdf 4977046 BLAKE2B 3548463cc878645bb169255d3332681685d0f05e02abf4cfcdd03773826d34f5a25c020240652839867a76258b25ca601ed292462f80bdf18b92ecfb46710487 SHA512 f6c37152228eac1fb69ddfc3a37454066ed678d57f12a587e0edcfe0adb390cc0b470384c2751033f7407bac44df9f69b0da4f3da1c300e6fc02231035ff634c |
44 |
-DIST numpy-user-1.21.0.pdf 5142404 BLAKE2B d670f1eb0f060599a640c52bdeba53b1758007fc2090a5b8fb6e135e71114149a0085811e4bc21396eabb1123ffb9edd39f8192d0165ab42dd066a9747eb3a3f SHA512 dde264abff1787efd50e913b6facf83522b3344ed88fd15d6fe73ecd44c6a3db1e4ce4251c9674bbcb122f72ab86c64142b2f4f992a6449405041f8e1f5f1ace |
45 |
DIST numpy-user-1.21.1.pdf 5142404 BLAKE2B d670f1eb0f060599a640c52bdeba53b1758007fc2090a5b8fb6e135e71114149a0085811e4bc21396eabb1123ffb9edd39f8192d0165ab42dd066a9747eb3a3f SHA512 dde264abff1787efd50e913b6facf83522b3344ed88fd15d6fe73ecd44c6a3db1e4ce4251c9674bbcb122f72ab86c64142b2f4f992a6449405041f8e1f5f1ace |
46 |
DIST numpy-user-1.21.2.pdf 5142404 BLAKE2B d670f1eb0f060599a640c52bdeba53b1758007fc2090a5b8fb6e135e71114149a0085811e4bc21396eabb1123ffb9edd39f8192d0165ab42dd066a9747eb3a3f SHA512 dde264abff1787efd50e913b6facf83522b3344ed88fd15d6fe73ecd44c6a3db1e4ce4251c9674bbcb122f72ab86c64142b2f4f992a6449405041f8e1f5f1ace |
47 |
|
48 |
diff --git a/dev-python/numpy/files/numpy-1.20.1-no-hardcode-blasv2.patch b/dev-python/numpy/files/numpy-1.20.1-no-hardcode-blasv2.patch |
49 |
deleted file mode 100644 |
50 |
index e24e0edb926..00000000000 |
51 |
--- a/dev-python/numpy/files/numpy-1.20.1-no-hardcode-blasv2.patch |
52 |
+++ /dev/null |
53 |
@@ -1,50 +0,0 @@ |
54 |
-diff --git a/numpy/distutils/system_info.py b/numpy/distutils/system_info.py |
55 |
-index 13f9da0..b696ef5 100644 |
56 |
---- a/numpy/distutils/system_info.py |
57 |
-+++ b/numpy/distutils/system_info.py |
58 |
-@@ -505,32 +505,7 @@ def get_info(name, notfound_action=0): |
59 |
- 1 - display warning message |
60 |
- 2 - raise error |
61 |
- """ |
62 |
-- cl = {'atlas': atlas_info, # use lapack_opt or blas_opt instead |
63 |
-- 'atlas_threads': atlas_threads_info, # ditto |
64 |
-- 'atlas_blas': atlas_blas_info, |
65 |
-- 'atlas_blas_threads': atlas_blas_threads_info, |
66 |
-- 'lapack_atlas': lapack_atlas_info, # use lapack_opt instead |
67 |
-- 'lapack_atlas_threads': lapack_atlas_threads_info, # ditto |
68 |
-- 'atlas_3_10': atlas_3_10_info, # use lapack_opt or blas_opt instead |
69 |
-- 'atlas_3_10_threads': atlas_3_10_threads_info, # ditto |
70 |
-- 'atlas_3_10_blas': atlas_3_10_blas_info, |
71 |
-- 'atlas_3_10_blas_threads': atlas_3_10_blas_threads_info, |
72 |
-- 'lapack_atlas_3_10': lapack_atlas_3_10_info, # use lapack_opt instead |
73 |
-- 'lapack_atlas_3_10_threads': lapack_atlas_3_10_threads_info, # ditto |
74 |
-- 'flame': flame_info, # use lapack_opt instead |
75 |
-- 'mkl': mkl_info, |
76 |
-- # openblas which may or may not have embedded lapack |
77 |
-- 'openblas': openblas_info, # use blas_opt instead |
78 |
-- # openblas with embedded lapack |
79 |
-- 'openblas_lapack': openblas_lapack_info, # use blas_opt instead |
80 |
-- 'openblas_clapack': openblas_clapack_info, # use blas_opt instead |
81 |
-- 'blis': blis_info, # use blas_opt instead |
82 |
-- 'lapack_mkl': lapack_mkl_info, # use lapack_opt instead |
83 |
-- 'blas_mkl': blas_mkl_info, # use blas_opt instead |
84 |
-- 'openblas64_': openblas64__info, |
85 |
-- 'openblas64__lapack': openblas64__lapack_info, |
86 |
-- 'openblas_ilp64': openblas_ilp64_info, |
87 |
-- 'openblas_ilp64_lapack': openblas_ilp64_lapack_info, |
88 |
-+ cl = {'flame': flame_info, # use lapack_opt instead |
89 |
- 'x11': x11_info, |
90 |
- 'fft_opt': fft_opt_info, |
91 |
- 'fftw': fftw_info, |
92 |
-@@ -950,10 +925,7 @@ class system_info: |
93 |
- return [b for b in [a.strip() for a in libs.split(',')] if b] |
94 |
- |
95 |
- def get_libraries(self, key='libraries'): |
96 |
-- if hasattr(self, '_lib_names'): |
97 |
-- return self.get_libs(key, default=self._lib_names) |
98 |
-- else: |
99 |
-- return self.get_libs(key, '') |
100 |
-+ return self.get_libs(key, '') |
101 |
- |
102 |
- def library_extensions(self): |
103 |
- c = customized_ccompiler() |
104 |
|
105 |
diff --git a/dev-python/numpy/files/numpy-1.20.2-fix-ccompiler-tests.patch b/dev-python/numpy/files/numpy-1.20.2-fix-ccompiler-tests.patch |
106 |
deleted file mode 100644 |
107 |
index 2312dd89a9b..00000000000 |
108 |
--- a/dev-python/numpy/files/numpy-1.20.2-fix-ccompiler-tests.patch |
109 |
+++ /dev/null |
110 |
@@ -1,36 +0,0 @@ |
111 |
-From 6f2f26e08c6e0d476593c82ad31d13847f30cbf4 Mon Sep 17 00:00:00 2001 |
112 |
-From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@g.o> |
113 |
-Date: Sun, 28 Mar 2021 10:00:14 +0200 |
114 |
-Subject: [PATCH] BUG: Fix test_ccompiler_opt when path contains dots |
115 |
- |
116 |
-Fix test_ccompiler_opt not to be confused by dots occurring on the path |
117 |
-to the temporary directory, by using only the source file's basename |
118 |
-when grabbing options. Otherwise, the test can fail with mismatches |
119 |
-such as: |
120 |
- |
121 |
- E AssertionError: 'sources_status' returns different targets than the compiled targets |
122 |
- E ['AVX512F', 'AVX2'] != ['(20 2/TEMP/TMPB0YHSCAI/TEST_TARGETS AVX512F)', '(20 2/TEMP/TMPB0YHSCAI/TEST_TARGETS AVX2)'] |
123 |
- |
124 |
-This is because our TMPDIR value includes numpy version, i.e. 1.20.2. |
125 |
-The splitting happens on the first dot that is part of the directory |
126 |
-path rather than test filename. |
127 |
---- |
128 |
- numpy/distutils/tests/test_ccompiler_opt.py | 2 +- |
129 |
- 1 file changed, 1 insertion(+), 1 deletion(-) |
130 |
- |
131 |
-diff --git a/numpy/distutils/tests/test_ccompiler_opt.py b/numpy/distutils/tests/test_ccompiler_opt.py |
132 |
-index 287a683c8..d2b0a4c58 100644 |
133 |
---- a/numpy/distutils/tests/test_ccompiler_opt.py |
134 |
-+++ b/numpy/distutils/tests/test_ccompiler_opt.py |
135 |
-@@ -112,7 +112,7 @@ class _Test_CCompilerOpt(object): |
136 |
- gflags = {} |
137 |
- fake_objects = opt.try_dispatch([file]) |
138 |
- for source, flags in fake_objects: |
139 |
-- gtar = source.split('.')[1:-1] |
140 |
-+ gtar = path.basename(source).split('.')[1:-1] |
141 |
- glen = len(gtar) |
142 |
- if glen == 0: |
143 |
- gtar = "baseline" |
144 |
--- |
145 |
-2.31.1 |
146 |
- |
147 |
|
148 |
diff --git a/dev-python/numpy/files/numpy-1.20.2-fix-popcnt-detection.patch b/dev-python/numpy/files/numpy-1.20.2-fix-popcnt-detection.patch |
149 |
deleted file mode 100644 |
150 |
index 85f4bb11b76..00000000000 |
151 |
--- a/dev-python/numpy/files/numpy-1.20.2-fix-popcnt-detection.patch |
152 |
+++ /dev/null |
153 |
@@ -1,103 +0,0 @@ |
154 |
-https://github.com/numpy/numpy/pull/19074 |
155 |
-https://bugs.gentoo.org/788184 |
156 |
- |
157 |
-From 8dc768964b5578a8aa9db1ef2c55134a00731e10 Mon Sep 17 00:00:00 2001 |
158 |
-From: Carl Michal <michal@×××××××××××.ca> |
159 |
-Date: Sat, 22 May 2021 20:43:10 -0700 |
160 |
-Subject: [PATCH 1/2] Fix compile-time test of POPCNT |
161 |
- |
162 |
-The compile-time test of POPCNT, cpu_popcnt.c produced code that would |
163 |
-execute without error even if the machine didn't support the popcnt |
164 |
-instruction. This patch attempts to use popcnt on random numbers so the |
165 |
-compiler can't substitute the answer at compile time. |
166 |
---- |
167 |
- numpy/distutils/checks/cpu_popcnt.c | 14 ++++++++++---- |
168 |
- 1 file changed, 10 insertions(+), 4 deletions(-) |
169 |
- |
170 |
-diff --git a/numpy/distutils/checks/cpu_popcnt.c b/numpy/distutils/checks/cpu_popcnt.c |
171 |
-index e6a80fb40be4..f6c785dd2a97 100644 |
172 |
---- a/numpy/distutils/checks/cpu_popcnt.c |
173 |
-+++ b/numpy/distutils/checks/cpu_popcnt.c |
174 |
-@@ -4,20 +4,26 @@ |
175 |
- #include <popcntintrin.h> |
176 |
- #endif |
177 |
- |
178 |
-+#include <stdlib.h> |
179 |
-+ |
180 |
- int main(void) |
181 |
- { |
182 |
- long long a = 0; |
183 |
- int b; |
184 |
-+ |
185 |
-+ a = random(); |
186 |
-+ b = random(); |
187 |
-+ |
188 |
- #ifdef _MSC_VER |
189 |
- #ifdef _M_X64 |
190 |
-- a = _mm_popcnt_u64(1); |
191 |
-+ a = _mm_popcnt_u64(a); |
192 |
- #endif |
193 |
-- b = _mm_popcnt_u32(1); |
194 |
-+ b = _mm_popcnt_u32(b); |
195 |
- #else |
196 |
- #ifdef __x86_64__ |
197 |
-- a = __builtin_popcountll(1); |
198 |
-+ a = __builtin_popcountll(a); |
199 |
- #endif |
200 |
-- b = __builtin_popcount(1); |
201 |
-+ b = __builtin_popcount(b); |
202 |
- #endif |
203 |
- return (int)a + b; |
204 |
- } |
205 |
- |
206 |
-From 52d5fe1ede45083d0783c3e2bbaee5c44df9d553 Mon Sep 17 00:00:00 2001 |
207 |
-From: Carl Michal <michal@×××××××××××.ca> |
208 |
-Date: Sun, 23 May 2021 08:24:52 -0700 |
209 |
-Subject: [PATCH 2/2] Change fix of cpu_popcnt.c to use |
210 |
- _mm_popcnt_u64/_mm_popcnt_u32 on GCC |
211 |
- |
212 |
-_builtin_popcount is always available, so the compile-time check always |
213 |
-succeeds. |
214 |
---- |
215 |
- numpy/distutils/checks/cpu_popcnt.c | 26 ++++++++------------------ |
216 |
- 1 file changed, 8 insertions(+), 18 deletions(-) |
217 |
- |
218 |
-diff --git a/numpy/distutils/checks/cpu_popcnt.c b/numpy/distutils/checks/cpu_popcnt.c |
219 |
-index f6c785dd2a97..540c98dab05d 100644 |
220 |
---- a/numpy/distutils/checks/cpu_popcnt.c |
221 |
-+++ b/numpy/distutils/checks/cpu_popcnt.c |
222 |
-@@ -4,26 +4,16 @@ |
223 |
- #include <popcntintrin.h> |
224 |
- #endif |
225 |
- |
226 |
--#include <stdlib.h> |
227 |
-- |
228 |
--int main(void) |
229 |
-+int main(int argc, char **argv) |
230 |
- { |
231 |
-- long long a = 0; |
232 |
-- int b; |
233 |
-- |
234 |
-- a = random(); |
235 |
-- b = random(); |
236 |
-- |
237 |
--#ifdef _MSC_VER |
238 |
-- #ifdef _M_X64 |
239 |
-+ // To make sure popcnt instructions are generated |
240 |
-+ // and been tested against the assembler |
241 |
-+ unsigned long long a = *((unsigned long long*)argv[argc-1]); |
242 |
-+ unsigned int b = *((unsigned int*)argv[argc-2]); |
243 |
-+ |
244 |
-+#if defined(_M_X64) || defined(__x86_64__) |
245 |
- a = _mm_popcnt_u64(a); |
246 |
-- #endif |
247 |
-- b = _mm_popcnt_u32(b); |
248 |
--#else |
249 |
-- #ifdef __x86_64__ |
250 |
-- a = __builtin_popcountll(a); |
251 |
-- #endif |
252 |
-- b = __builtin_popcount(b); |
253 |
- #endif |
254 |
-+ b = _mm_popcnt_u32(b); |
255 |
- return (int)a + b; |
256 |
- } |
257 |
|
258 |
diff --git a/dev-python/numpy/files/numpy-1.20.3-float-hashing-py310.patch b/dev-python/numpy/files/numpy-1.20.3-float-hashing-py310.patch |
259 |
deleted file mode 100644 |
260 |
index f3b2ea3ef0c..00000000000 |
261 |
--- a/dev-python/numpy/files/numpy-1.20.3-float-hashing-py310.patch |
262 |
+++ /dev/null |
263 |
@@ -1,129 +0,0 @@ |
264 |
-From ad2a73c18dcff95d844c382c94ab7f73b5571cf3 Mon Sep 17 00:00:00 2001 |
265 |
-From: Sebastian Berg <sebastian@××××××××××××.net> |
266 |
-Date: Tue, 4 May 2021 17:43:26 -0500 |
267 |
-Subject: [PATCH] MAINT: Adjust NumPy float hashing to Python's slightly |
268 |
- changed hash |
269 |
- |
270 |
-This is necessary, since we use the Python double hash and the |
271 |
-semi-private function to calculate it in Python has a new signature |
272 |
-to return the identity-hash when the value is NaN. |
273 |
- |
274 |
-closes gh-18833, gh-18907 |
275 |
---- |
276 |
- numpy/core/src/common/npy_pycompat.h | 16 ++++++++++ |
277 |
- numpy/core/src/multiarray/scalartypes.c.src | 13 ++++---- |
278 |
- numpy/core/tests/test_scalarmath.py | 34 +++++++++++++++++++++ |
279 |
- 3 files changed, 57 insertions(+), 6 deletions(-) |
280 |
- |
281 |
-diff --git a/numpy/core/src/common/npy_pycompat.h b/numpy/core/src/common/npy_pycompat.h |
282 |
-index aa0b5c1224d..9e94a971090 100644 |
283 |
---- a/numpy/core/src/common/npy_pycompat.h |
284 |
-+++ b/numpy/core/src/common/npy_pycompat.h |
285 |
-@@ -3,4 +3,20 @@ |
286 |
- |
287 |
- #include "numpy/npy_3kcompat.h" |
288 |
- |
289 |
-+ |
290 |
-+/* |
291 |
-+ * In Python 3.10a7 (or b1), python started using the identity for the hash |
292 |
-+ * when a value is NaN. See https://bugs.python.org/issue43475 |
293 |
-+ */ |
294 |
-+#if PY_VERSION_HEX > 0x030a00a6 |
295 |
-+#define Npy_HashDouble _Py_HashDouble |
296 |
-+#else |
297 |
-+static NPY_INLINE Py_hash_t |
298 |
-+Npy_HashDouble(PyObject *NPY_UNUSED(identity), double val) |
299 |
-+{ |
300 |
-+ return _Py_HashDouble(val); |
301 |
-+} |
302 |
-+#endif |
303 |
-+ |
304 |
-+ |
305 |
- #endif /* _NPY_COMPAT_H_ */ |
306 |
-diff --git a/numpy/core/src/multiarray/scalartypes.c.src b/numpy/core/src/multiarray/scalartypes.c.src |
307 |
-index a001500b0a9..9930f7791d6 100644 |
308 |
---- a/numpy/core/src/multiarray/scalartypes.c.src |
309 |
-+++ b/numpy/core/src/multiarray/scalartypes.c.src |
310 |
-@@ -3172,7 +3172,7 @@ static npy_hash_t |
311 |
- static npy_hash_t |
312 |
- @lname@_arrtype_hash(PyObject *obj) |
313 |
- { |
314 |
-- return _Py_HashDouble((double) PyArrayScalar_VAL(obj, @name@)); |
315 |
-+ return Npy_HashDouble(obj, (double)PyArrayScalar_VAL(obj, @name@)); |
316 |
- } |
317 |
- |
318 |
- /* borrowed from complex_hash */ |
319 |
-@@ -3180,14 +3180,14 @@ static npy_hash_t |
320 |
- c@lname@_arrtype_hash(PyObject *obj) |
321 |
- { |
322 |
- npy_hash_t hashreal, hashimag, combined; |
323 |
-- hashreal = _Py_HashDouble((double) |
324 |
-- PyArrayScalar_VAL(obj, C@name@).real); |
325 |
-+ hashreal = Npy_HashDouble( |
326 |
-+ obj, (double)PyArrayScalar_VAL(obj, C@name@).real); |
327 |
- |
328 |
- if (hashreal == -1) { |
329 |
- return -1; |
330 |
- } |
331 |
-- hashimag = _Py_HashDouble((double) |
332 |
-- PyArrayScalar_VAL(obj, C@name@).imag); |
333 |
-+ hashimag = Npy_HashDouble( |
334 |
-+ obj, (double)PyArrayScalar_VAL(obj, C@name@).imag); |
335 |
- if (hashimag == -1) { |
336 |
- return -1; |
337 |
- } |
338 |
-@@ -3202,7 +3202,8 @@ c@lname@_arrtype_hash(PyObject *obj) |
339 |
- static npy_hash_t |
340 |
- half_arrtype_hash(PyObject *obj) |
341 |
- { |
342 |
-- return _Py_HashDouble(npy_half_to_double(PyArrayScalar_VAL(obj, Half))); |
343 |
-+ return Npy_HashDouble( |
344 |
-+ obj, npy_half_to_double(PyArrayScalar_VAL(obj, Half))); |
345 |
- } |
346 |
- |
347 |
- static npy_hash_t |
348 |
-diff --git a/numpy/core/tests/test_scalarmath.py b/numpy/core/tests/test_scalarmath.py |
349 |
-index d91b4a39146..09a734284a7 100644 |
350 |
---- a/numpy/core/tests/test_scalarmath.py |
351 |
-+++ b/numpy/core/tests/test_scalarmath.py |
352 |
-@@ -712,6 +712,40 @@ def test_shift_all_bits(self, type_code, op): |
353 |
- assert_equal(res_arr, res_scl) |
354 |
- |
355 |
- |
356 |
-+class TestHash: |
357 |
-+ @pytest.mark.parametrize("type_code", np.typecodes['AllInteger']) |
358 |
-+ def test_integer_hashes(self, type_code): |
359 |
-+ scalar = np.dtype(type_code).type |
360 |
-+ for i in range(128): |
361 |
-+ assert hash(i) == hash(scalar(i)) |
362 |
-+ |
363 |
-+ @pytest.mark.parametrize("type_code", np.typecodes['AllFloat']) |
364 |
-+ def test_float_and_complex_hashes(self, type_code): |
365 |
-+ scalar = np.dtype(type_code).type |
366 |
-+ for val in [np.pi, np.inf, 3, 6.]: |
367 |
-+ numpy_val = scalar(val) |
368 |
-+ # Cast back to Python, in case the NumPy scalar has less precision |
369 |
-+ if numpy_val.dtype.kind == 'c': |
370 |
-+ val = complex(numpy_val) |
371 |
-+ else: |
372 |
-+ val = float(numpy_val) |
373 |
-+ assert val == numpy_val |
374 |
-+ print(repr(numpy_val), repr(val)) |
375 |
-+ assert hash(val) == hash(numpy_val) |
376 |
-+ |
377 |
-+ if hash(float(np.nan)) != hash(float(np.nan)): |
378 |
-+ # If Python distinguises different NaNs we do so too (gh-18833) |
379 |
-+ assert hash(scalar(np.nan)) != hash(scalar(np.nan)) |
380 |
-+ |
381 |
-+ @pytest.mark.parametrize("type_code", np.typecodes['Complex']) |
382 |
-+ def test_complex_hashes(self, type_code): |
383 |
-+ # Test some complex valued hashes specifically: |
384 |
-+ scalar = np.dtype(type_code).type |
385 |
-+ for val in [np.pi+1j, np.inf-3j, 3j, 6.+1j]: |
386 |
-+ numpy_val = scalar(val) |
387 |
-+ assert hash(complex(numpy_val)) == hash(numpy_val) |
388 |
-+ |
389 |
-+ |
390 |
- @contextlib.contextmanager |
391 |
- def recursionlimit(n): |
392 |
- o = sys.getrecursionlimit() |
393 |
|
394 |
diff --git a/dev-python/numpy/numpy-1.20.2-r1.ebuild b/dev-python/numpy/numpy-1.20.2-r1.ebuild |
395 |
deleted file mode 100644 |
396 |
index 2e16936ea19..00000000000 |
397 |
--- a/dev-python/numpy/numpy-1.20.2-r1.ebuild |
398 |
+++ /dev/null |
399 |
@@ -1,144 +0,0 @@ |
400 |
-# Copyright 1999-2021 Gentoo Authors |
401 |
-# Distributed under the terms of the GNU General Public License v2 |
402 |
- |
403 |
-EAPI=7 |
404 |
- |
405 |
-PYTHON_COMPAT=( python3_{7..9} ) |
406 |
-PYTHON_REQ_USE="threads(+)" |
407 |
- |
408 |
-FORTRAN_NEEDED=lapack |
409 |
- |
410 |
-DISTUTILS_USE_SETUPTOOLS=rdepend |
411 |
- |
412 |
-inherit distutils-r1 flag-o-matic fortran-2 multiprocessing toolchain-funcs |
413 |
- |
414 |
-DOC_PV="1.16.4" |
415 |
-DESCRIPTION="Fast array and numerical python library" |
416 |
-HOMEPAGE="https://numpy.org/" |
417 |
-SRC_URI=" |
418 |
- mirror://pypi/${PN:0:1}/${PN}/${P}.zip |
419 |
- doc? ( |
420 |
- https://numpy.org/doc/$(ver_cut 1-2 ${DOC_PV})/numpy-html.zip -> numpy-html-${DOC_PV}.zip |
421 |
- https://numpy.org/doc/$(ver_cut 1-2 ${DOC_PV})/numpy-ref.pdf -> numpy-ref-${DOC_PV}.pdf |
422 |
- https://numpy.org/doc/$(ver_cut 1-2 ${DOC_PV})/numpy-user.pdf -> numpy-user-${DOC_PV}.pdf |
423 |
- )" |
424 |
-LICENSE="BSD" |
425 |
-SLOT="0" |
426 |
-KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~x64-solaris ~x86-solaris" |
427 |
-IUSE="doc lapack" |
428 |
- |
429 |
-RDEPEND=" |
430 |
- lapack? ( |
431 |
- >=virtual/cblas-3.8 |
432 |
- >=virtual/lapack-3.8 |
433 |
- ) |
434 |
-" |
435 |
-BDEPEND=" |
436 |
- ${RDEPEND} |
437 |
- app-arch/unzip |
438 |
- >=dev-python/cython-0.29.21[${PYTHON_USEDEP}] |
439 |
- lapack? ( virtual/pkgconfig ) |
440 |
- test? ( |
441 |
- >=dev-python/hypothesis-5.8.0[${PYTHON_USEDEP}] |
442 |
- >=dev-python/pytz-2019.3[${PYTHON_USEDEP}] |
443 |
- >=dev-python/cffi-1.14.0[${PYTHON_USEDEP}] |
444 |
- ) |
445 |
-" |
446 |
- |
447 |
-PATCHES=( |
448 |
- "${FILESDIR}"/numpy-1.20.1-no-hardcode-blasv2.patch |
449 |
- "${FILESDIR}"/numpy-1.20.2-fix-ccompiler-tests.patch |
450 |
- "${FILESDIR}"/numpy-1.20.2-fix-popcnt-detection.patch |
451 |
-) |
452 |
- |
453 |
-distutils_enable_tests pytest |
454 |
- |
455 |
-src_unpack() { |
456 |
- default |
457 |
- if use doc; then |
458 |
- unzip -qo "${DISTDIR}"/numpy-html-${DOC_PV}.zip -d html || die |
459 |
- fi |
460 |
-} |
461 |
- |
462 |
-python_prepare_all() { |
463 |
- if use lapack; then |
464 |
- local incdir="${EPREFIX}"/usr/include |
465 |
- local libdir="${EPREFIX}"/usr/$(get_libdir) |
466 |
- cat >> site.cfg <<-EOF || die |
467 |
- [blas] |
468 |
- include_dirs = ${incdir} |
469 |
- library_dirs = ${libdir} |
470 |
- blas_libs = cblas,blas |
471 |
- [lapack] |
472 |
- library_dirs = ${libdir} |
473 |
- lapack_libs = lapack |
474 |
- EOF |
475 |
- else |
476 |
- export {ATLAS,PTATLAS,BLAS,LAPACK,MKL}=None |
477 |
- fi |
478 |
- |
479 |
- export CC="$(tc-getCC) ${CFLAGS}" |
480 |
- |
481 |
- append-flags -fno-strict-aliasing |
482 |
- |
483 |
- # See progress in http://projects.scipy.org/scipy/numpy/ticket/573 |
484 |
- # with the subtle difference that we don't want to break Darwin where |
485 |
- # -shared is not a valid linker argument |
486 |
- if [[ ${CHOST} != *-darwin* ]]; then |
487 |
- append-ldflags -shared |
488 |
- fi |
489 |
- |
490 |
- # only one fortran to link with: |
491 |
- # linking with cblas and lapack library will force |
492 |
- # autodetecting and linking to all available fortran compilers |
493 |
- append-fflags -fPIC |
494 |
- if use lapack; then |
495 |
- NUMPY_FCONFIG="config_fc --noopt --noarch" |
496 |
- # workaround bug 335908 |
497 |
- [[ $(tc-getFC) == *gfortran* ]] && NUMPY_FCONFIG+=" --fcompiler=gnu95" |
498 |
- fi |
499 |
- |
500 |
- # don't version f2py, we will handle it. |
501 |
- sed -i -e '/f2py_exe/s: + os\.path.*$::' numpy/f2py/setup.py || die |
502 |
- |
503 |
- # disable fuzzed tests |
504 |
- find numpy/*/tests -name '*.py' -exec sed -i \ |
505 |
- -e 's:def \(.*_fuzz\):def _\1:' {} + || die |
506 |
- # very memory- and disk-hungry |
507 |
- sed -i -e 's:test_large_zip:_&:' numpy/lib/tests/test_io.py || die |
508 |
- |
509 |
- distutils-r1_python_prepare_all |
510 |
-} |
511 |
- |
512 |
-python_compile() { |
513 |
- export MAKEOPTS=-j1 #660754 |
514 |
- |
515 |
- distutils-r1_python_compile ${NUMPY_FCONFIG} |
516 |
-} |
517 |
- |
518 |
-python_test() { |
519 |
- distutils_install_for_testing --single-version-externally-managed \ |
520 |
- --record "${TMPDIR}/record.txt" ${NUMPY_FCONFIG} |
521 |
- |
522 |
- cd "${TEST_DIR}/lib" || die |
523 |
- epytest \ |
524 |
- --deselect 'numpy/typing/tests/test_typing.py::test_fail[array_constructors.py]' |
525 |
-} |
526 |
- |
527 |
-python_install() { |
528 |
- # https://github.com/numpy/numpy/issues/16005 |
529 |
- local mydistutilsargs=( build_src ) |
530 |
- distutils-r1_python_install ${NUMPY_FCONFIG} |
531 |
- python_optimize |
532 |
-} |
533 |
- |
534 |
-python_install_all() { |
535 |
- local DOCS=( LICENSE.txt README.md THANKS.txt ) |
536 |
- |
537 |
- if use doc; then |
538 |
- local HTML_DOCS=( "${WORKDIR}"/html/. ) |
539 |
- DOCS+=( "${DISTDIR}"/${PN}-{user,ref}-${DOC_PV}.pdf ) |
540 |
- fi |
541 |
- |
542 |
- distutils-r1_python_install_all |
543 |
-} |
544 |
|
545 |
diff --git a/dev-python/numpy/numpy-1.20.3-r1.ebuild b/dev-python/numpy/numpy-1.20.3-r1.ebuild |
546 |
deleted file mode 100644 |
547 |
index 1b40d1b3d7d..00000000000 |
548 |
--- a/dev-python/numpy/numpy-1.20.3-r1.ebuild |
549 |
+++ /dev/null |
550 |
@@ -1,142 +0,0 @@ |
551 |
-# Copyright 1999-2021 Gentoo Authors |
552 |
-# Distributed under the terms of the GNU General Public License v2 |
553 |
- |
554 |
-EAPI=7 |
555 |
- |
556 |
-PYTHON_COMPAT=( python3_{7..10} ) |
557 |
-PYTHON_REQ_USE="threads(+)" |
558 |
- |
559 |
-FORTRAN_NEEDED=lapack |
560 |
- |
561 |
-inherit distutils-r1 flag-o-matic fortran-2 multiprocessing toolchain-funcs |
562 |
- |
563 |
-DOC_PV=${PV} |
564 |
-DESCRIPTION="Fast array and numerical python library" |
565 |
-HOMEPAGE="https://numpy.org/" |
566 |
-SRC_URI=" |
567 |
- mirror://pypi/${PN:0:1}/${PN}/${P}.zip |
568 |
- doc? ( |
569 |
- https://numpy.org/doc/$(ver_cut 1-2 ${DOC_PV})/numpy-html.zip -> numpy-html-${DOC_PV}.zip |
570 |
- https://numpy.org/doc/$(ver_cut 1-2 ${DOC_PV})/numpy-ref.pdf -> numpy-ref-${DOC_PV}.pdf |
571 |
- https://numpy.org/doc/$(ver_cut 1-2 ${DOC_PV})/numpy-user.pdf -> numpy-user-${DOC_PV}.pdf |
572 |
- )" |
573 |
-LICENSE="BSD" |
574 |
-SLOT="0" |
575 |
-KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~x64-solaris ~x86-solaris" |
576 |
-IUSE="doc lapack" |
577 |
- |
578 |
-RDEPEND=" |
579 |
- lapack? ( |
580 |
- >=virtual/cblas-3.8 |
581 |
- >=virtual/lapack-3.8 |
582 |
- ) |
583 |
-" |
584 |
-BDEPEND=" |
585 |
- ${RDEPEND} |
586 |
- app-arch/unzip |
587 |
- >=dev-python/cython-0.29.21[${PYTHON_USEDEP}] |
588 |
- lapack? ( virtual/pkgconfig ) |
589 |
- test? ( |
590 |
- >=dev-python/hypothesis-5.8.0[${PYTHON_USEDEP}] |
591 |
- >=dev-python/pytz-2019.3[${PYTHON_USEDEP}] |
592 |
- >=dev-python/cffi-1.14.0[${PYTHON_USEDEP}] |
593 |
- ) |
594 |
-" |
595 |
- |
596 |
-PATCHES=( |
597 |
- "${FILESDIR}"/numpy-1.20.1-no-hardcode-blasv2.patch |
598 |
- "${FILESDIR}"/numpy-1.20.2-fix-ccompiler-tests.patch |
599 |
- "${FILESDIR}"/numpy-1.20.2-fix-popcnt-detection.patch |
600 |
- "${FILESDIR}"/numpy-1.20.3-float-hashing-py310.patch |
601 |
-) |
602 |
- |
603 |
-distutils_enable_tests pytest |
604 |
- |
605 |
-src_unpack() { |
606 |
- default |
607 |
- if use doc; then |
608 |
- unzip -qo "${DISTDIR}"/numpy-html-${DOC_PV}.zip -d html || die |
609 |
- fi |
610 |
-} |
611 |
- |
612 |
-python_prepare_all() { |
613 |
- if use lapack; then |
614 |
- local incdir="${EPREFIX}"/usr/include |
615 |
- local libdir="${EPREFIX}"/usr/$(get_libdir) |
616 |
- cat >> site.cfg <<-EOF || die |
617 |
- [blas] |
618 |
- include_dirs = ${incdir} |
619 |
- library_dirs = ${libdir} |
620 |
- blas_libs = cblas,blas |
621 |
- [lapack] |
622 |
- library_dirs = ${libdir} |
623 |
- lapack_libs = lapack |
624 |
- EOF |
625 |
- else |
626 |
- export {ATLAS,PTATLAS,BLAS,LAPACK,MKL}=None |
627 |
- fi |
628 |
- |
629 |
- export CC="$(tc-getCC) ${CFLAGS}" |
630 |
- |
631 |
- append-flags -fno-strict-aliasing |
632 |
- |
633 |
- # See progress in http://projects.scipy.org/scipy/numpy/ticket/573 |
634 |
- # with the subtle difference that we don't want to break Darwin where |
635 |
- # -shared is not a valid linker argument |
636 |
- if [[ ${CHOST} != *-darwin* ]]; then |
637 |
- append-ldflags -shared |
638 |
- fi |
639 |
- |
640 |
- # only one fortran to link with: |
641 |
- # linking with cblas and lapack library will force |
642 |
- # autodetecting and linking to all available fortran compilers |
643 |
- append-fflags -fPIC |
644 |
- if use lapack; then |
645 |
- NUMPY_FCONFIG="config_fc --noopt --noarch" |
646 |
- # workaround bug 335908 |
647 |
- [[ $(tc-getFC) == *gfortran* ]] && NUMPY_FCONFIG+=" --fcompiler=gnu95" |
648 |
- fi |
649 |
- |
650 |
- # don't version f2py, we will handle it. |
651 |
- sed -i -e '/f2py_exe/s: + os\.path.*$::' numpy/f2py/setup.py || die |
652 |
- |
653 |
- # disable fuzzed tests |
654 |
- find numpy/*/tests -name '*.py' -exec sed -i \ |
655 |
- -e 's:def \(.*_fuzz\):def _\1:' {} + || die |
656 |
- # very memory- and disk-hungry |
657 |
- sed -i -e 's:test_large_zip:_&:' numpy/lib/tests/test_io.py || die |
658 |
- |
659 |
- distutils-r1_python_prepare_all |
660 |
-} |
661 |
- |
662 |
-python_compile() { |
663 |
- export MAKEOPTS=-j1 #660754 |
664 |
- |
665 |
- distutils-r1_python_compile ${NUMPY_FCONFIG} |
666 |
-} |
667 |
- |
668 |
-python_test() { |
669 |
- distutils_install_for_testing --single-version-externally-managed \ |
670 |
- --record "${TMPDIR}/record.txt" ${NUMPY_FCONFIG} |
671 |
- |
672 |
- cd "${TEST_DIR}/lib" || die |
673 |
- epytest |
674 |
-} |
675 |
- |
676 |
-python_install() { |
677 |
- # https://github.com/numpy/numpy/issues/16005 |
678 |
- local mydistutilsargs=( build_src ) |
679 |
- distutils-r1_python_install ${NUMPY_FCONFIG} |
680 |
- python_optimize |
681 |
-} |
682 |
- |
683 |
-python_install_all() { |
684 |
- local DOCS=( LICENSE.txt README.md THANKS.txt ) |
685 |
- |
686 |
- if use doc; then |
687 |
- local HTML_DOCS=( "${WORKDIR}"/html/. ) |
688 |
- DOCS+=( "${DISTDIR}"/${PN}-{user,ref}-${DOC_PV}.pdf ) |
689 |
- fi |
690 |
- |
691 |
- distutils-r1_python_install_all |
692 |
-} |
693 |
|
694 |
diff --git a/dev-python/numpy/numpy-1.21.0.ebuild b/dev-python/numpy/numpy-1.21.0.ebuild |
695 |
deleted file mode 100644 |
696 |
index d6940ebdf3a..00000000000 |
697 |
--- a/dev-python/numpy/numpy-1.21.0.ebuild |
698 |
+++ /dev/null |
699 |
@@ -1,139 +0,0 @@ |
700 |
-# Copyright 1999-2021 Gentoo Authors |
701 |
-# Distributed under the terms of the GNU General Public License v2 |
702 |
- |
703 |
-EAPI=7 |
704 |
- |
705 |
-PYTHON_COMPAT=( python3_{7..10} ) |
706 |
-PYTHON_REQ_USE="threads(+)" |
707 |
- |
708 |
-FORTRAN_NEEDED=lapack |
709 |
- |
710 |
-inherit distutils-r1 flag-o-matic fortran-2 multiprocessing toolchain-funcs |
711 |
- |
712 |
-DOC_PV=${PV} |
713 |
-DESCRIPTION="Fast array and numerical python library" |
714 |
-HOMEPAGE="https://numpy.org/" |
715 |
-SRC_URI=" |
716 |
- mirror://pypi/${PN:0:1}/${PN}/${P}.zip |
717 |
- doc? ( |
718 |
- https://numpy.org/doc/$(ver_cut 1-2 ${DOC_PV})/numpy-html.zip -> numpy-html-${DOC_PV}.zip |
719 |
- https://numpy.org/doc/$(ver_cut 1-2 ${DOC_PV})/numpy-ref.pdf -> numpy-ref-${DOC_PV}.pdf |
720 |
- https://numpy.org/doc/$(ver_cut 1-2 ${DOC_PV})/numpy-user.pdf -> numpy-user-${DOC_PV}.pdf |
721 |
- )" |
722 |
-LICENSE="BSD" |
723 |
-SLOT="0" |
724 |
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~x64-solaris ~x86-solaris" |
725 |
-IUSE="doc lapack" |
726 |
- |
727 |
-RDEPEND=" |
728 |
- lapack? ( |
729 |
- >=virtual/cblas-3.8 |
730 |
- >=virtual/lapack-3.8 |
731 |
- ) |
732 |
-" |
733 |
-BDEPEND=" |
734 |
- ${RDEPEND} |
735 |
- app-arch/unzip |
736 |
- >=dev-python/cython-0.29.21[${PYTHON_USEDEP}] |
737 |
- lapack? ( virtual/pkgconfig ) |
738 |
- test? ( |
739 |
- >=dev-python/hypothesis-5.8.0[${PYTHON_USEDEP}] |
740 |
- >=dev-python/pytz-2019.3[${PYTHON_USEDEP}] |
741 |
- >=dev-python/cffi-1.14.0[${PYTHON_USEDEP}] |
742 |
- ) |
743 |
-" |
744 |
- |
745 |
-PATCHES=( |
746 |
- "${FILESDIR}"/numpy-1.21.0-no-hardcode-blasv2.patch |
747 |
-) |
748 |
- |
749 |
-distutils_enable_tests pytest |
750 |
- |
751 |
-src_unpack() { |
752 |
- default |
753 |
- if use doc; then |
754 |
- unzip -qo "${DISTDIR}"/numpy-html-${DOC_PV}.zip -d html || die |
755 |
- fi |
756 |
-} |
757 |
- |
758 |
-python_prepare_all() { |
759 |
- if use lapack; then |
760 |
- local incdir="${EPREFIX}"/usr/include |
761 |
- local libdir="${EPREFIX}"/usr/$(get_libdir) |
762 |
- cat >> site.cfg <<-EOF || die |
763 |
- [blas] |
764 |
- include_dirs = ${incdir} |
765 |
- library_dirs = ${libdir} |
766 |
- blas_libs = cblas,blas |
767 |
- [lapack] |
768 |
- library_dirs = ${libdir} |
769 |
- lapack_libs = lapack |
770 |
- EOF |
771 |
- else |
772 |
- export {ATLAS,PTATLAS,BLAS,LAPACK,MKL}=None |
773 |
- fi |
774 |
- |
775 |
- export CC="$(tc-getCC) ${CFLAGS}" |
776 |
- |
777 |
- append-flags -fno-strict-aliasing |
778 |
- |
779 |
- # See progress in http://projects.scipy.org/scipy/numpy/ticket/573 |
780 |
- # with the subtle difference that we don't want to break Darwin where |
781 |
- # -shared is not a valid linker argument |
782 |
- if [[ ${CHOST} != *-darwin* ]]; then |
783 |
- append-ldflags -shared |
784 |
- fi |
785 |
- |
786 |
- # only one fortran to link with: |
787 |
- # linking with cblas and lapack library will force |
788 |
- # autodetecting and linking to all available fortran compilers |
789 |
- append-fflags -fPIC |
790 |
- if use lapack; then |
791 |
- NUMPY_FCONFIG="config_fc --noopt --noarch" |
792 |
- # workaround bug 335908 |
793 |
- [[ $(tc-getFC) == *gfortran* ]] && NUMPY_FCONFIG+=" --fcompiler=gnu95" |
794 |
- fi |
795 |
- |
796 |
- # don't version f2py, we will handle it. |
797 |
- sed -i -e '/f2py_exe/s: + os\.path.*$::' numpy/f2py/setup.py || die |
798 |
- |
799 |
- # disable fuzzed tests |
800 |
- find numpy/*/tests -name '*.py' -exec sed -i \ |
801 |
- -e 's:def \(.*_fuzz\):def _\1:' {} + || die |
802 |
- # very memory- and disk-hungry |
803 |
- sed -i -e 's:test_large_zip:_&:' numpy/lib/tests/test_io.py || die |
804 |
- |
805 |
- distutils-r1_python_prepare_all |
806 |
-} |
807 |
- |
808 |
-python_compile() { |
809 |
- export MAKEOPTS=-j1 #660754 |
810 |
- |
811 |
- distutils-r1_python_compile ${NUMPY_FCONFIG} |
812 |
-} |
813 |
- |
814 |
-python_test() { |
815 |
- distutils_install_for_testing --single-version-externally-managed \ |
816 |
- --record "${TMPDIR}/record.txt" ${NUMPY_FCONFIG} |
817 |
- |
818 |
- cd "${TEST_DIR}/lib" || die |
819 |
- epytest |
820 |
-} |
821 |
- |
822 |
-python_install() { |
823 |
- # https://github.com/numpy/numpy/issues/16005 |
824 |
- local mydistutilsargs=( build_src ) |
825 |
- distutils-r1_python_install ${NUMPY_FCONFIG} |
826 |
- python_optimize |
827 |
-} |
828 |
- |
829 |
-python_install_all() { |
830 |
- local DOCS=( LICENSE.txt README.md THANKS.txt ) |
831 |
- |
832 |
- if use doc; then |
833 |
- local HTML_DOCS=( "${WORKDIR}"/html/. ) |
834 |
- DOCS+=( "${DISTDIR}"/${PN}-{user,ref}-${DOC_PV}.pdf ) |
835 |
- fi |
836 |
- |
837 |
- distutils-r1_python_install_all |
838 |
-} |