Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: profiles/, dev-python/numpy/files/, dev-python/numpy/
Date: Sun, 07 Feb 2021 23:04:57
Message-Id: 1612739087.0ca12ba030358b6e399d2537eb1b5ebf1cbfc41f.mgorny@gentoo
1 commit: 0ca12ba030358b6e399d2537eb1b5ebf1cbfc41f
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Sun Feb 7 21:57:44 2021 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Sun Feb 7 23:04:47 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0ca12ba0
7
8 dev-python/numpy: Bump to 1.20.1
9
10 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
11
12 dev-python/numpy/Manifest | 1 +
13 .../files/numpy-1.20.1-no-hardcode-blasv2.patch | 50 +++++++
14 dev-python/numpy/numpy-1.20.1.ebuild | 145 +++++++++++++++++++++
15 profiles/package.mask | 5 +
16 4 files changed, 201 insertions(+)
17
18 diff --git a/dev-python/numpy/Manifest b/dev-python/numpy/Manifest
19 index 9879a80cc89..8d28131121a 100644
20 --- a/dev-python/numpy/Manifest
21 +++ b/dev-python/numpy/Manifest
22 @@ -1,5 +1,6 @@
23 DIST numpy-1.19.4.zip 7315971 BLAKE2B 4809ad6aaf7f9893ea6ed4c2456f4827aa5728b9dba00ed4c8e517267dd299933ca6c9205e3e31ef61ba25a6c13dde32dbe7d268c2d54391bd532d368bb3c5e8 SHA512 ae8e6b2792022c147159a11188f9702fa9fa9c9707c834da4f21aa43752451509b0a5b8807d93dfa86dff7e95c127dab20e4f372336a66f25f9b56c2869a486f
24 DIST numpy-1.19.5.zip 7318340 BLAKE2B a01fd07d8cbfc53c1585b19701f9052fd4b1b4010d24c61e1054352a80343e6644ae6e61ce7565fd9c7c99b9e1174bdd2e685fd5666640d08b1ec9919f86cc8e SHA512 dfe2809b5f486624b4802ea5610822bf7ba80c46dcf8505f69b0267137b01719131f74aa366949954c66796d48ba1b4f74cf0ecc5692a9ebd49e673fb0881ff4
25 +DIST numpy-1.20.1.zip 7750776 BLAKE2B 0f3915f2e8dfa6e0e7a6251fcba5365379d91b448101513860573f07e1f3fa24b097177a333230d7cbea1f58afed1718346d0348d14344544fe063e4baa6786a SHA512 edd1be2df27940f050ebd8eeb7b053b9987849d3b4aa0cb3c75d2fe2318f358e1b37f3bafedc772c224021e9316ebce45e1b75aa0e35d248f8ba9a9112b57b86
26 DIST numpy-html-1.16.4.zip 12097069 BLAKE2B db1f897342fbc80a761fbaee7b0eee3761dbfa04ef6c46a137bb2392caaec8256580467ce06498cceeada2639151a1ec75dafab484d64cb897c008727d6d32a5 SHA512 c44c5e1e0cb22f9dd46fe9e302030292d85e567456178fee296746a414271634e906509fb6665ac63fbfebdd13c5383574f0aa47b4fbc639063da31addc3316a
27 DIST numpy-ref-1.16.4.pdf 5176571 BLAKE2B 9a875ebd1473b241d463d810a6d191581aef961158f2f82959671b554ace3ad482795e4f3e1cb7dd4632cff926c1e864c675a7624fb0f4e4f297948bf50f0564 SHA512 983ba0f34a70c011886bdbc9fd8f3f75a3a967ca29217acc76fa46e7da391296a5628c9a557ac76efb393271abfb8ee4f376d401c1cc1e5c30622e54b9325d09
28 DIST numpy-user-1.16.4.pdf 596203 BLAKE2B da3ad1f0ec1c965d20656f73a970911cbb58efa73a5df89e2e6485e0dd763f483e35eea1395ac919bf35d496fb216cee954fc5d31edebc1796a24a2a7a2d12b9 SHA512 3083008547213bfa98ffa5cd8e2cea13f6947f42d83aef61502a2a852b0d5f27d727c76b42d281d7a2f4f76c78e88b12ee3d9b164b39fe1f0213ace7097357d6
29
30 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
31 new file mode 100644
32 index 00000000000..e24e0edb926
33 --- /dev/null
34 +++ b/dev-python/numpy/files/numpy-1.20.1-no-hardcode-blasv2.patch
35 @@ -0,0 +1,50 @@
36 +diff --git a/numpy/distutils/system_info.py b/numpy/distutils/system_info.py
37 +index 13f9da0..b696ef5 100644
38 +--- a/numpy/distutils/system_info.py
39 ++++ b/numpy/distutils/system_info.py
40 +@@ -505,32 +505,7 @@ def get_info(name, notfound_action=0):
41 + 1 - display warning message
42 + 2 - raise error
43 + """
44 +- cl = {'atlas': atlas_info, # use lapack_opt or blas_opt instead
45 +- 'atlas_threads': atlas_threads_info, # ditto
46 +- 'atlas_blas': atlas_blas_info,
47 +- 'atlas_blas_threads': atlas_blas_threads_info,
48 +- 'lapack_atlas': lapack_atlas_info, # use lapack_opt instead
49 +- 'lapack_atlas_threads': lapack_atlas_threads_info, # ditto
50 +- 'atlas_3_10': atlas_3_10_info, # use lapack_opt or blas_opt instead
51 +- 'atlas_3_10_threads': atlas_3_10_threads_info, # ditto
52 +- 'atlas_3_10_blas': atlas_3_10_blas_info,
53 +- 'atlas_3_10_blas_threads': atlas_3_10_blas_threads_info,
54 +- 'lapack_atlas_3_10': lapack_atlas_3_10_info, # use lapack_opt instead
55 +- 'lapack_atlas_3_10_threads': lapack_atlas_3_10_threads_info, # ditto
56 +- 'flame': flame_info, # use lapack_opt instead
57 +- 'mkl': mkl_info,
58 +- # openblas which may or may not have embedded lapack
59 +- 'openblas': openblas_info, # use blas_opt instead
60 +- # openblas with embedded lapack
61 +- 'openblas_lapack': openblas_lapack_info, # use blas_opt instead
62 +- 'openblas_clapack': openblas_clapack_info, # use blas_opt instead
63 +- 'blis': blis_info, # use blas_opt instead
64 +- 'lapack_mkl': lapack_mkl_info, # use lapack_opt instead
65 +- 'blas_mkl': blas_mkl_info, # use blas_opt instead
66 +- 'openblas64_': openblas64__info,
67 +- 'openblas64__lapack': openblas64__lapack_info,
68 +- 'openblas_ilp64': openblas_ilp64_info,
69 +- 'openblas_ilp64_lapack': openblas_ilp64_lapack_info,
70 ++ cl = {'flame': flame_info, # use lapack_opt instead
71 + 'x11': x11_info,
72 + 'fft_opt': fft_opt_info,
73 + 'fftw': fftw_info,
74 +@@ -950,10 +925,7 @@ class system_info:
75 + return [b for b in [a.strip() for a in libs.split(',')] if b]
76 +
77 + def get_libraries(self, key='libraries'):
78 +- if hasattr(self, '_lib_names'):
79 +- return self.get_libs(key, default=self._lib_names)
80 +- else:
81 +- return self.get_libs(key, '')
82 ++ return self.get_libs(key, '')
83 +
84 + def library_extensions(self):
85 + c = customized_ccompiler()
86
87 diff --git a/dev-python/numpy/numpy-1.20.1.ebuild b/dev-python/numpy/numpy-1.20.1.ebuild
88 new file mode 100644
89 index 00000000000..fe497e494ab
90 --- /dev/null
91 +++ b/dev-python/numpy/numpy-1.20.1.ebuild
92 @@ -0,0 +1,145 @@
93 +# Copyright 1999-2021 Gentoo Authors
94 +# Distributed under the terms of the GNU General Public License v2
95 +
96 +EAPI=7
97 +
98 +PYTHON_COMPAT=( python3_{7..9} )
99 +PYTHON_REQ_USE="threads(+)"
100 +
101 +FORTRAN_NEEDED=lapack
102 +
103 +DISTUTILS_USE_SETUPTOOLS=rdepend
104 +
105 +inherit distutils-r1 flag-o-matic fortran-2 multiprocessing toolchain-funcs
106 +
107 +DOC_PV="1.16.4"
108 +DESCRIPTION="Fast array and numerical python library"
109 +HOMEPAGE="https://numpy.org/"
110 +SRC_URI="
111 + mirror://pypi/${PN:0:1}/${PN}/${P}.zip
112 + doc? (
113 + https://numpy.org/doc/$(ver_cut 1-2 ${DOC_PV})/numpy-html.zip -> numpy-html-${DOC_PV}.zip
114 + https://numpy.org/doc/$(ver_cut 1-2 ${DOC_PV})/numpy-ref.pdf -> numpy-ref-${DOC_PV}.pdf
115 + https://numpy.org/doc/$(ver_cut 1-2 ${DOC_PV})/numpy-user.pdf -> numpy-user-${DOC_PV}.pdf
116 + )"
117 +LICENSE="BSD"
118 +SLOT="0"
119 +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"
120 +IUSE="doc lapack"
121 +
122 +RDEPEND="
123 + lapack? (
124 + >=virtual/cblas-3.8
125 + >=virtual/lapack-3.8
126 + )
127 +"
128 +BDEPEND="
129 + ${RDEPEND}
130 + app-arch/unzip
131 + >=dev-python/cython-0.29.21[${PYTHON_USEDEP}]
132 + lapack? ( virtual/pkgconfig )
133 + test? (
134 + >=dev-python/hypothesis-5.8.0[${PYTHON_USEDEP}]
135 + >=dev-python/pytz-2019.3[${PYTHON_USEDEP}]
136 + >=dev-python/cffi-1.14.0[${PYTHON_USEDEP}]
137 + )
138 +"
139 +
140 +PATCHES=(
141 + "${FILESDIR}"/${PN}-1.20.1-no-hardcode-blasv2.patch
142 +)
143 +
144 +distutils_enable_tests pytest
145 +
146 +src_unpack() {
147 + default
148 + if use doc; then
149 + unzip -qo "${DISTDIR}"/numpy-html-${DOC_PV}.zip -d html || die
150 + fi
151 +}
152 +
153 +python_prepare_all() {
154 + if use lapack; then
155 + local incdir="${EPREFIX}"/usr/include
156 + local libdir="${EPREFIX}"/usr/$(get_libdir)
157 + cat >> site.cfg <<-EOF || die
158 + [blas]
159 + include_dirs = ${incdir}
160 + library_dirs = ${libdir}
161 + blas_libs = cblas,blas
162 + [lapack]
163 + library_dirs = ${libdir}
164 + lapack_libs = lapack
165 + EOF
166 + else
167 + export {ATLAS,PTATLAS,BLAS,LAPACK,MKL}=None
168 + fi
169 +
170 + export CC="$(tc-getCC) ${CFLAGS}"
171 +
172 + append-flags -fno-strict-aliasing
173 +
174 + # See progress in http://projects.scipy.org/scipy/numpy/ticket/573
175 + # with the subtle difference that we don't want to break Darwin where
176 + # -shared is not a valid linker argument
177 + if [[ ${CHOST} != *-darwin* ]]; then
178 + append-ldflags -shared
179 + fi
180 +
181 + # only one fortran to link with:
182 + # linking with cblas and lapack library will force
183 + # autodetecting and linking to all available fortran compilers
184 + append-fflags -fPIC
185 + if use lapack; then
186 + NUMPY_FCONFIG="config_fc --noopt --noarch"
187 + # workaround bug 335908
188 + [[ $(tc-getFC) == *gfortran* ]] && NUMPY_FCONFIG+=" --fcompiler=gnu95"
189 + fi
190 +
191 + # don't version f2py, we will handle it.
192 + sed -i -e '/f2py_exe/s: + os\.path.*$::' numpy/f2py/setup.py || die
193 +
194 + # disable fuzzed tests
195 + find numpy/*/tests -name '*.py' -exec sed -i \
196 + -e 's:def \(.*_fuzz\):def _\1:' {} + || die
197 + # very memory- and disk-hungry
198 + sed -i -e 's:test_large_zip:_&:' numpy/lib/tests/test_io.py || die
199 +
200 + distutils-r1_python_prepare_all
201 +}
202 +
203 +python_compile() {
204 + export MAKEOPTS=-j1 #660754
205 +
206 + distutils-r1_python_compile ${NUMPY_FCONFIG}
207 +}
208 +
209 +python_test() {
210 + distutils_install_for_testing --single-version-externally-managed \
211 + --record "${TMPDIR}/record.txt" ${NUMPY_FCONFIG}
212 +
213 + cd "${TMPDIR}" || die
214 +
215 + "${EPYTHON}" -c "
216 +import numpy, sys
217 +r = numpy.test(label='full', verbose=3)
218 +sys.exit(0 if r else 1)" || die "Tests fail with ${EPYTHON}"
219 +}
220 +
221 +python_install() {
222 + # https://github.com/numpy/numpy/issues/16005
223 + local mydistutilsargs=( build_src )
224 + distutils-r1_python_install ${NUMPY_FCONFIG}
225 + python_optimize
226 +}
227 +
228 +python_install_all() {
229 + local DOCS=( LICENSE.txt README.md THANKS.txt )
230 +
231 + if use doc; then
232 + local HTML_DOCS=( "${WORKDIR}"/html/. )
233 + DOCS+=( "${DISTDIR}"/${PN}-{user,ref}-${DOC_PV}.pdf )
234 + fi
235 +
236 + distutils-r1_python_install_all
237 +}
238
239 diff --git a/profiles/package.mask b/profiles/package.mask
240 index ca9a66a23a6..a9c3c04553f 100644
241 --- a/profiles/package.mask
242 +++ b/profiles/package.mask
243 @@ -32,6 +32,11 @@
244
245 #--- END OF EXAMPLES ---
246
247 +# Michał Górny <mgorny@g.o> (2021-02-07)
248 +# Fails tests (and does not seem to test the old installed version
249 +# at least partially). Needs further testing.
250 +>=dev-python/numpy-1.20
251 +
252 # Michał Górny <mgorny@g.o> (2021-02-07)
253 # Discontinued upstream. Last release was for Xfce 4.12, last commit
254 # in 2015. Still uses GTK+2.