update numpy-1.20.2

This commit is contained in:
2021-04-04 11:55:39 +02:00
committed by onkelbeh
parent e71e790afc
commit 976b3c3f0f
14 changed files with 60 additions and 1116 deletions
+4 -16
View File
@@ -1,27 +1,15 @@
AUX numpy-1.14.5-no-hardcode-blas.patch 3767 BLAKE2B f580a067b9c91a53f99daffd33f38306abb3d2852f4d513152531fb0796f50371c9031b7c685fd35801afbe2a5b649efd4d2cdca9c239f119893b1fde19bda3b SHA512 66a7d9988ab3e6f5b1788df7db9d81719c43ba641edc3450a4912c46aaf0ffb3ba6030dc458182adfb11eafac91f2ba6e1c5aa9b8eb077d6d8c776b2ec5ad2fc
AUX numpy-1.14.5-py37.patch 5417 BLAKE2B a6660b06a6f5ebc436b8bef4f53934892384889304f3b48ed1e9e84298deb78528e431e2102856fe1bc44b5e9a472b3a0b51401ad824b7072465d8c54f6aa939 SHA512 78b6a1640cf51e9b58478fd9ad5044bec2efc1319cc050f0a1345fc367b57b9170954ce25b88b2851007b438a00ac380eab48f6b699fed1115d109972ec553ad
AUX numpy-1.15.2-no-hardcode-blas.patch 3767 BLAKE2B f580a067b9c91a53f99daffd33f38306abb3d2852f4d513152531fb0796f50371c9031b7c685fd35801afbe2a5b649efd4d2cdca9c239f119893b1fde19bda3b SHA512 66a7d9988ab3e6f5b1788df7db9d81719c43ba641edc3450a4912c46aaf0ffb3ba6030dc458182adfb11eafac91f2ba6e1c5aa9b8eb077d6d8c776b2ec5ad2fc
AUX numpy-1.15.2-py37.patch 5417 BLAKE2B a6660b06a6f5ebc436b8bef4f53934892384889304f3b48ed1e9e84298deb78528e431e2102856fe1bc44b5e9a472b3a0b51401ad824b7072465d8c54f6aa939 SHA512 78b6a1640cf51e9b58478fd9ad5044bec2efc1319cc050f0a1345fc367b57b9170954ce25b88b2851007b438a00ac380eab48f6b699fed1115d109972ec553ad
AUX numpy-1.15.4-no-hardcode-blas.patch 3841 BLAKE2B 19ddde096b5b0b1d3c0a98e16c14b96cf9c16ec5d96736ec561f14535fe240eaa8fbe71f396d432ce557b78b18a98ad8684724614f201b1d6151c8edfd07f483 SHA512 8f870f8a52c096f6f0f614dc64ff6d5ed8d8805e14723c60c6e85b69cf915fc698e808f3fcafce75a6ea9e7eb728949dc56ef823d70963d25658e50aa8becaae
AUX numpy-1.17.4-no-hardcode-blas.patch 2769 BLAKE2B 800bd23df8f23f335a8298041403f7caca92128e759db85c354c0328447c2b0cada571694bb96d4e9231b12ab91c7f9533526a06427723a3db4a75f502aec443 SHA512 8f31fdcb5acec9f5a346b35625e526d120577fba95d9039d53c3ad2441a5fc6950251d6ef58ecc53110873d76ec9f9a12c65f60f909413f26f3734f8e0bcfb09
AUX numpy-1.17.4-no-hardcode-blasv2.patch 2420 BLAKE2B e4c0058b1226fced2c38caf67b2843021c6f42773781668a556eb48d7038acd0b1c7cbf30a432fdc3f4d2abf8eef28df7102be1bc9669a4ddc4ee4fc5e239d68 SHA512 9c6dc7e4f5b28b24ac5e1c686066c973b218b0e4e07b500a52c8b3e247acb150714072d17dd1a8579f47c48e9776bddebf9f049616aca52e0325c8f09ef09dad
DIST numpy-1.17.1.zip 6491116 BLAKE2B e0a68295384ad2e6387049878332daf43693a8d9164a54bb6ca824ece93d107ce8f00c3318232a8ef54478c41a888fc271e0e357168ad0f95b24138a4e95eafb SHA512 7df8df2b6b148172832930b226b5477088a72f5adbff120d77fd9b77a8440c951f7f9784c346fb7dba9ac969d225346e18dfbe1625a5ce243c99635dc7ba0996
DIST numpy-1.17.3.zip 6363960 BLAKE2B db7b87078b537f5f840929c6a9ea5cb02642823cb622c62ca02d75a43e5e910f5cbc6c749eada7e90ccdf76751f87e5c1c766cd4e36af0f8d3cb3bf714b4535f SHA512 00b3a7ea78edeb76f9374bd2de9fcff14abdc9284da5b5579ea81e88d00b18427172c53ea57fdac79f873de8a483139da18ea97b7066666a48d989133c85b394
DIST numpy-1.18.1.zip 5430477 BLAKE2B 5a3325c438f5a6d39feb0efd8745d00f47ecf49cebd0dd0d3a45a2e6d0ccb7b1530b89aa0471d18a1010c4f0d7e554323bca91be653d483aa756732a64979736 SHA512 4e49523f7e6810a78e15c364b7a5e6fbb82df28e62dafaab2f194d580dabc44b7b3080b24274f2eea0fee4cec7d65ee08f39eda44edf210a1dead4f101e93f79
DIST numpy-1.18.2.zip 5433240 BLAKE2B fcafdec05ba98a236cc519ca3f6ba3ba0a46bea2b4a3d3014f8a30455b59bce448fc75bb73e414afa96f55054509a73506c3b0ee600e7e206293f8b4f33800a9 SHA512 8402788803147d74ccd03af0a36232928f884b40ab1332561eaa9853e39b62b524fd4eb122c775ca53e0d6c693a65ff3e689bd0a7fed16cc07caf254e786598b
DIST numpy-1.18.4.zip 5440468 BLAKE2B 701b2a3cf1af09e8c96850a37a42223e729477b5bbb42062180c9ba7fda76826f29de526a4607ff194cef1e338c9a3971e777c7001cbcb1173eebf236dc98dbb SHA512 ec16fa6f5a52e62aeae482290776229d55cc2528fdfabd69a4c48e33991ee901dc345cdafd132baabded0bc4f11a41dcfc4fb737e24cb9b3b8a938a8769e0f01
AUX numpy-1.20.1-no-hardcode-blasv2.patch 2582 BLAKE2B 5057f925a12e6703ab5d9d4c342db80f7f5a7f02a5b5884bd9fac574dcadb9234901b08b1b2ca5bc5ba0345a58e896a241e3a48b4b050b2f5a1063324359d84c SHA512 4418b9c5ed3842848bc06a56ebbd7cd9261657e407775374f2f060944522128d8a5178888def6e4cf42ff6d81082d9cc1425d9553c5334ad4e728d0df9b86bc8
AUX numpy-1.20.2-fix-ccompiler-tests.patch 1616 BLAKE2B 3e2796029854207187322b1061201e7f014472c64d8c66a2dd3f82ec2eed7311f5cc3351d98aeb4b8b75d95608853066a30394e5316bb91e443744f33d66966b SHA512 5ed01b466a0da96b5d7c56b78e420d6c589c48c20053b9da66344384fa93048f90e281d3ed5caa9325f6afe00ff48841b24abc926c75aacb8a6bd5418ed32117
DIST numpy-1.19.0.zip 7296082 BLAKE2B e388a1b8aa8fa5e23b57c69c5aa5f2b7b286a69fca6007843adbfa374d541ace7875757a302e851bc41194f565390b52777fff13da8166e7a2c6b0a0f3efd29c SHA512 24f8847ff6b72dd44db197fbd80596677f9f3c5afcc87f30c41a4c0a2ccd4ee652ca630a537997ba8fe68c4919fa488e9d8cadd9a310e5356b017f6086055850
DIST numpy-1.19.1.zip 7301568 BLAKE2B f7c17666d8cd4f477d7946be383d2ff1656c412e23dc49c55f94a6fcb95a6cffe6b4958169b1b27e027a7d674feb96de979d8bba4f1e3d9daef9b72e7f48cafa SHA512 ddc5f5e262d6f7f6e1a8879165860427baa237b6aad5b09d5b943a36bb0d5922424aac4c0e32a2cc3e14087bf6eb671988b6ff6df0d9ab8c89724e093220eead
DIST numpy-1.19.2.zip 7310530 BLAKE2B a019c64809bd61071a4dd5e10c2cdf6927f392ebe58b45a08529295079bca68a683502aba89847578e122271d2fa4ea6d2d5461f1e58322f550cda863d36125b SHA512 56ae348f08818e30b6675df7d41a2b03687af452d7a96356fccfce2994843c7b61918946381c3af25fe03f209413d0378ee691fc38d805491a12c464e49bb59c
DIST numpy-1.20.2.zip 7756879 BLAKE2B 8b76942e04701e164029b145fed1747de72142ea4f5a8aa7472a01caeeed5e0b5b6d9e543106f9786e231df5a8afe3b7ad9256e69873e4f8876c659114bc494e SHA512 337a66d68c965da06f757a89b58d30b83ec0b2f3c7a3bb39496e5031e50fee6c4f2ec090202c3da9a20613864ea46d032ae75af1de5c33eebe515133ef37d40c
DIST numpy-html-1.16.4.zip 12097069 BLAKE2B db1f897342fbc80a761fbaee7b0eee3761dbfa04ef6c46a137bb2392caaec8256580467ce06498cceeada2639151a1ec75dafab484d64cb897c008727d6d32a5 SHA512 c44c5e1e0cb22f9dd46fe9e302030292d85e567456178fee296746a414271634e906509fb6665ac63fbfebdd13c5383574f0aa47b4fbc639063da31addc3316a
DIST numpy-ref-1.16.4.pdf 5176571 BLAKE2B 9a875ebd1473b241d463d810a6d191581aef961158f2f82959671b554ace3ad482795e4f3e1cb7dd4632cff926c1e864c675a7624fb0f4e4f297948bf50f0564 SHA512 983ba0f34a70c011886bdbc9fd8f3f75a3a967ca29217acc76fa46e7da391296a5628c9a557ac76efb393271abfb8ee4f376d401c1cc1e5c30622e54b9325d09
DIST numpy-user-1.16.4.pdf 596203 BLAKE2B da3ad1f0ec1c965d20656f73a970911cbb58efa73a5df89e2e6485e0dd763f483e35eea1395ac919bf35d496fb216cee954fc5d31edebc1796a24a2a7a2d12b9 SHA512 3083008547213bfa98ffa5cd8e2cea13f6947f42d83aef61502a2a852b0d5f27d727c76b42d281d7a2f4f76c78e88b12ee3d9b164b39fe1f0213ace7097357d6
EBUILD numpy-1.17.1.ebuild 3706 BLAKE2B fbdcdd2a62b3a4c2b5b7afd8f2dd14cb35b000ef649718e34289a6b5c0b32b3cd8c81ee3fedad4e06739a088b6c48cb623e2800c2e7ce1855769d09ff5e8d31c SHA512 8630cba07a1156f93bba6ad15377fff7ea4dfa0cdae267b9f8a5b67e6625fcf439381a4e176809fb23d8147830ee6c9dfc5434cc3c6b6a7655a4577f4047149a
EBUILD numpy-1.17.3-r1.ebuild 4084 BLAKE2B 149386ec10cb83a948265adac0978ca174f53cfa93151eefe5b104d11d01653d8c31120c72e196ceeb4b2b935865764b128bbf72815daa1f7e0b5e40766e9cc9 SHA512 038601e69358c6cb19c8f59ea8bbd541da6e6deb6b1d6b395b884c22f855485d27df42228122b7e2020836845150c018a9644a3541116ac9acc09b2b2cfce0fc
EBUILD numpy-1.18.1.ebuild 3621 BLAKE2B 3e5b753d32d353a17d464c3e19b25e80766f0f20d2449779ec1cce5b153dad200b8d890b22e7c6255f9745240ac8e698faa02621dc8edeb865dde374eacf08bd SHA512 e72f0c843bf91770d573db57c0000f4c4d226c9056f69f08e172e99866754c870b20e3e0f58b0a4c93fd7decd242c230514375914efabd96c159761ef824386f
EBUILD numpy-1.18.2.ebuild 3621 BLAKE2B 3e5b753d32d353a17d464c3e19b25e80766f0f20d2449779ec1cce5b153dad200b8d890b22e7c6255f9745240ac8e698faa02621dc8edeb865dde374eacf08bd SHA512 e72f0c843bf91770d573db57c0000f4c4d226c9056f69f08e172e99866754c870b20e3e0f58b0a4c93fd7decd242c230514375914efabd96c159761ef824386f
EBUILD numpy-1.18.4.ebuild 3736 BLAKE2B df766362332589e63483a0b84d0025c83baedf8a44761b0cae551f094f05cafe691fdd6085c91f67daf51d8201715f8707febf081b10e31e74972c90ddeae589 SHA512 4217776f5e3b73e190a2c791312138fa06ba71e3e99e5e39cc0f9dc96c58cd09e7470326b6779990a6262d7c416b39ac5e047590ffdd358b47537bf64257b82b
EBUILD numpy-1.19.0.ebuild 3735 BLAKE2B a4f39af0ad7a115fe37d2ee522f2487969e437f18f8529af26f9657fdb6a46fd501995e98453e7a06b5f69e5d71b346fb7739dc20ced710a598beba9611c3007 SHA512 5bd1af5fd6ae5676d9ef7441a7d7cff2184d607742b786238126481ba667a5bba75098c25eae28044be827fc9ca435024b1c8ec053c2a202b9cc532e37715c50
EBUILD numpy-1.19.1.ebuild 3735 BLAKE2B 74bd144c460d071d1c4dfc596758b4fcd56c7f8b66da1ff9f2508afcff8a049c7a067a139ccd9323d4553f4520b21513e83707ed3f96e08868f11194cf2f8574 SHA512 b34822f04e1f33a253d61e74477f138770095e735f1cc3dbe0102025c16a4ec3321b0abdd8b6785bff302c5d5c8d37856b05ef4bcf004905c20b6a75976f40a5
EBUILD numpy-1.19.2.ebuild 3735 BLAKE2B 74bd144c460d071d1c4dfc596758b4fcd56c7f8b66da1ff9f2508afcff8a049c7a067a139ccd9323d4553f4520b21513e83707ed3f96e08868f11194cf2f8574 SHA512 b34822f04e1f33a253d61e74477f138770095e735f1cc3dbe0102025c16a4ec3321b0abdd8b6785bff302c5d5c8d37856b05ef4bcf004905c20b6a75976f40a5
EBUILD numpy-1.20.2.ebuild 3736 BLAKE2B 72152d2307cddee83a75042e1c997cb0ac9a442e638697807d1529da660e1ad4ffbb76a6085fb40c2508f57164bf7c4408181a5df7479f6e36504f8a7a6630d8 SHA512 396b0e6477a6f68c7016a46615162c184a9a5707d01b618806ff7e5460548b3e160e014e46c92dc704847a9d4598c6baeebe45ffb09c0480cb4927fb90b11610
MISC metadata.xml 461 BLAKE2B 8832954e31cde79a9535602fb4c7abdf6ec38271c3c5823d2018be1a14fc4b4d5cbe7dac755979b10e76ac8a7579debf1518646d3a55182979893af71bfa5171 SHA512 f687204c86bee2daec69b88f6d2508ecb92ba494d728a19c209d440b5168c52d4a5ce8707b96b8688d6560d7268c23a4ba19dc33477395fd41f7e63ab3ad3653
@@ -1,75 +0,0 @@
diff --git a/numpy/distutils/system_info.py b/numpy/distutils/system_info.py
index 93a8e6f..df3f3f8 100644
--- a/numpy/distutils/system_info.py
+++ b/numpy/distutils/system_info.py
@@ -364,28 +364,7 @@ def get_info(name, notfound_action=0):
1 - display warning message
2 - raise error
"""
- cl = {'atlas': atlas_info, # use lapack_opt or blas_opt instead
- 'atlas_threads': atlas_threads_info, # ditto
- 'atlas_blas': atlas_blas_info,
- 'atlas_blas_threads': atlas_blas_threads_info,
- 'lapack_atlas': lapack_atlas_info, # use lapack_opt instead
- 'lapack_atlas_threads': lapack_atlas_threads_info, # ditto
- 'atlas_3_10': atlas_3_10_info, # use lapack_opt or blas_opt instead
- 'atlas_3_10_threads': atlas_3_10_threads_info, # ditto
- 'atlas_3_10_blas': atlas_3_10_blas_info,
- 'atlas_3_10_blas_threads': atlas_3_10_blas_threads_info,
- 'lapack_atlas_3_10': lapack_atlas_3_10_info, # use lapack_opt instead
- 'lapack_atlas_3_10_threads': lapack_atlas_3_10_threads_info, # ditto
- 'mkl': mkl_info,
- # openblas which may or may not have embedded lapack
- 'openblas': openblas_info, # use blas_opt instead
- # openblas with embedded lapack
- 'openblas_lapack': openblas_lapack_info, # use blas_opt instead
- 'openblas_clapack': openblas_clapack_info, # use blas_opt instead
- 'blis': blis_info, # use blas_opt instead
- 'lapack_mkl': lapack_mkl_info, # use lapack_opt instead
- 'blas_mkl': blas_mkl_info, # use blas_opt instead
- 'x11': x11_info,
+ cl = {'x11': x11_info,
'fft_opt': fft_opt_info,
'fftw': fftw_info,
'fftw2': fftw2_info,
@@ -730,10 +709,7 @@ class system_info(object):
return [b for b in [a.strip() for a in libs.split(',')] if b]
def get_libraries(self, key='libraries'):
- if hasattr(self, '_lib_names'):
- return self.get_libs(key, default=self._lib_names)
- else:
- return self.get_libs(key, '')
+ return self.get_libs(key, '')
def library_extensions(self):
c = customized_ccompiler()
@@ -1740,7 +1716,7 @@ class blas_info(system_info):
lib = self.has_cblas(info)
if lib is not None:
info['language'] = 'c'
- info['libraries'] = [lib]
+ info['libraries'] = lib
info['define_macros'] = [('HAVE_CBLAS', None)]
self.set_info(**info)
@@ -1772,16 +1748,16 @@ class blas_info(system_info):
# check for cblas lib, and if not present check for blas lib.
try:
c.link_executable(obj, os.path.join(tmpdir, "a.out"),
- libraries=["cblas"],
+ libraries=info["libraries"],
library_dirs=info['library_dirs'],
extra_postargs=info.get('extra_link_args', []))
- res = "cblas"
+ res = info["libraries"]
except distutils.ccompiler.LinkError:
c.link_executable(obj, os.path.join(tmpdir, "a.out"),
libraries=["blas"],
library_dirs=info['library_dirs'],
extra_postargs=info.get('extra_link_args', []))
- res = "blas"
+ res = ["blas"]
except distutils.ccompiler.CompileError:
res = None
finally:
@@ -1,135 +0,0 @@
From dce7f20e95e6bd3fc07517c0b2daf3942a34ddf7 Mon Sep 17 00:00:00 2001
From: Charles Harris <charlesr.harris@gmail.com>
Date: Wed, 14 Mar 2018 12:52:26 -0600
Subject: [PATCH] MAINT: Fix test_utils.py for Python 3.7.
The contents of the module warnings registries was made more module
specific in Python 3.7 and consequently the tests of the context
managers clear_and_catch_warnings and suppress_warnings need updating.
---
numpy/testing/tests/test_utils.py | 43 +++++++++++++++++++++----------
1 file changed, 29 insertions(+), 14 deletions(-)
diff --git a/numpy/testing/tests/test_utils.py b/numpy/testing/tests/test_utils.py
index a97b627f9..33b3555b0 100644
--- a/numpy/testing/tests/test_utils.py
+++ b/numpy/testing/tests/test_utils.py
@@ -1114,18 +1114,28 @@ class TestStringEqual(unittest.TestCase):
lambda: assert_string_equal("foo", "hello"))
-def assert_warn_len_equal(mod, n_in_context, py3_n_in_context=None):
+def assert_warn_len_equal(mod, n_in_context, py34=None, py37=None):
mod_warns = mod.__warningregistry__
+ num_warns = len(mod_warns)
# Python 3.4 appears to clear any pre-existing warnings of the same type,
# when raising warnings inside a catch_warnings block. So, there is a
# warning generated by the tests within the context manager, but no
# previous warnings.
if 'version' in mod_warns:
- if py3_n_in_context is None:
- py3_n_in_context = n_in_context
- assert_equal(len(mod_warns) - 1, py3_n_in_context)
- else:
- assert_equal(len(mod_warns), n_in_context)
+ # Python 3 adds a 'version' entry to the registry,
+ # do not count it.
+ num_warns -= 1
+
+ # Behavior of warnings is Python version dependent. Adjust the
+ # expected result to compensate. In particular, Python 3.7 does
+ # not make an entry for ignored warnings.
+ if sys.version_info[:2] >= (3, 7):
+ if py37 is not None:
+ n_in_context = py37
+ elif sys.version_info[:2] >= (3, 4):
+ if py34 is not None:
+ n_in_context = py34
+ assert_equal(num_warns, n_in_context)
def _get_fresh_mod():
@@ -1134,6 +1144,8 @@ def _get_fresh_mod():
try:
my_mod.__warningregistry__.clear()
except AttributeError:
+ # will not have a __warningregistry__ unless warning has been
+ # raised in the module at some point
pass
return my_mod
@@ -1147,21 +1159,23 @@ def test_clear_and_catch_warnings():
warnings.warn('Some warning')
assert_equal(my_mod.__warningregistry__, {})
# Without specified modules, don't clear warnings during context
+ # Python 3.7 catch_warnings doesn't make an entry for 'ignore'.
with clear_and_catch_warnings():
warnings.simplefilter('ignore')
warnings.warn('Some warning')
- assert_warn_len_equal(my_mod, 1)
+ assert_warn_len_equal(my_mod, 1, py37=0)
# Confirm that specifying module keeps old warning, does not add new
with clear_and_catch_warnings(modules=[my_mod]):
warnings.simplefilter('ignore')
warnings.warn('Another warning')
- assert_warn_len_equal(my_mod, 1)
+ assert_warn_len_equal(my_mod, 1, py37=0)
# Another warning, no module spec does add to warnings dict, except on
# Python 3.4 (see comments in `assert_warn_len_equal`)
+ # Python 3.7 catch_warnings doesn't make an entry for 'ignore'.
with clear_and_catch_warnings():
warnings.simplefilter('ignore')
warnings.warn('Another warning')
- assert_warn_len_equal(my_mod, 2, 1)
+ assert_warn_len_equal(my_mod, 2, py34=1, py37=0)
def test_suppress_warnings_module():
@@ -1178,6 +1192,7 @@ def test_suppress_warnings_module():
np.apply_along_axis(warn, 0, [0])
# Test module based warning suppression:
+ assert_warn_len_equal(my_mod, 0)
with suppress_warnings() as sup:
sup.record(UserWarning)
# suppress warning from other module (may have .pyc ending),
@@ -1189,8 +1204,7 @@ def test_suppress_warnings_module():
# got filtered)
assert_(len(sup.log) == 1)
assert_(sup.log[0].message.args[0] == "Some warning")
-
- assert_warn_len_equal(my_mod, 0)
+ assert_warn_len_equal(my_mod, 0, py37=0)
sup = suppress_warnings()
# Will have to be changed if apply_along_axis is moved:
sup.filter(module=my_mod)
@@ -1204,11 +1218,11 @@ def test_suppress_warnings_module():
assert_warn_len_equal(my_mod, 0)
# Without specified modules, don't clear warnings during context
+ # Python 3.7 does not add ignored warnings.
with suppress_warnings():
warnings.simplefilter('ignore')
warnings.warn('Some warning')
- assert_warn_len_equal(my_mod, 1)
-
+ assert_warn_len_equal(my_mod, 1, py37=0)
def test_suppress_warnings_type():
# Initial state of module, no warnings
@@ -1232,10 +1246,11 @@ def test_suppress_warnings_type():
assert_warn_len_equal(my_mod, 0)
# Without specified modules, don't clear warnings during context
+ # Python 3.7 does not add ignored warnings.
with suppress_warnings():
warnings.simplefilter('ignore')
warnings.warn('Some warning')
- assert_warn_len_equal(my_mod, 1)
+ assert_warn_len_equal(my_mod, 1, py37=0)
def test_suppress_warnings_decorate_no_record():
--
2.18.0
@@ -1,75 +0,0 @@
diff --git a/numpy/distutils/system_info.py b/numpy/distutils/system_info.py
index 93a8e6f..df3f3f8 100644
--- a/numpy/distutils/system_info.py
+++ b/numpy/distutils/system_info.py
@@ -364,28 +364,7 @@ def get_info(name, notfound_action=0):
1 - display warning message
2 - raise error
"""
- cl = {'atlas': atlas_info, # use lapack_opt or blas_opt instead
- 'atlas_threads': atlas_threads_info, # ditto
- 'atlas_blas': atlas_blas_info,
- 'atlas_blas_threads': atlas_blas_threads_info,
- 'lapack_atlas': lapack_atlas_info, # use lapack_opt instead
- 'lapack_atlas_threads': lapack_atlas_threads_info, # ditto
- 'atlas_3_10': atlas_3_10_info, # use lapack_opt or blas_opt instead
- 'atlas_3_10_threads': atlas_3_10_threads_info, # ditto
- 'atlas_3_10_blas': atlas_3_10_blas_info,
- 'atlas_3_10_blas_threads': atlas_3_10_blas_threads_info,
- 'lapack_atlas_3_10': lapack_atlas_3_10_info, # use lapack_opt instead
- 'lapack_atlas_3_10_threads': lapack_atlas_3_10_threads_info, # ditto
- 'mkl': mkl_info,
- # openblas which may or may not have embedded lapack
- 'openblas': openblas_info, # use blas_opt instead
- # openblas with embedded lapack
- 'openblas_lapack': openblas_lapack_info, # use blas_opt instead
- 'openblas_clapack': openblas_clapack_info, # use blas_opt instead
- 'blis': blis_info, # use blas_opt instead
- 'lapack_mkl': lapack_mkl_info, # use lapack_opt instead
- 'blas_mkl': blas_mkl_info, # use blas_opt instead
- 'x11': x11_info,
+ cl = {'x11': x11_info,
'fft_opt': fft_opt_info,
'fftw': fftw_info,
'fftw2': fftw2_info,
@@ -730,10 +709,7 @@ class system_info(object):
return [b for b in [a.strip() for a in libs.split(',')] if b]
def get_libraries(self, key='libraries'):
- if hasattr(self, '_lib_names'):
- return self.get_libs(key, default=self._lib_names)
- else:
- return self.get_libs(key, '')
+ return self.get_libs(key, '')
def library_extensions(self):
c = customized_ccompiler()
@@ -1740,7 +1716,7 @@ class blas_info(system_info):
lib = self.has_cblas(info)
if lib is not None:
info['language'] = 'c'
- info['libraries'] = [lib]
+ info['libraries'] = lib
info['define_macros'] = [('HAVE_CBLAS', None)]
self.set_info(**info)
@@ -1772,16 +1748,16 @@ class blas_info(system_info):
# check for cblas lib, and if not present check for blas lib.
try:
c.link_executable(obj, os.path.join(tmpdir, "a.out"),
- libraries=["cblas"],
+ libraries=info["libraries"],
library_dirs=info['library_dirs'],
extra_postargs=info.get('extra_link_args', []))
- res = "cblas"
+ res = info["libraries"]
except distutils.ccompiler.LinkError:
c.link_executable(obj, os.path.join(tmpdir, "a.out"),
libraries=["blas"],
library_dirs=info['library_dirs'],
extra_postargs=info.get('extra_link_args', []))
- res = "blas"
+ res = ["blas"]
except distutils.ccompiler.CompileError:
res = None
finally:
@@ -1,135 +0,0 @@
From dce7f20e95e6bd3fc07517c0b2daf3942a34ddf7 Mon Sep 17 00:00:00 2001
From: Charles Harris <charlesr.harris@gmail.com>
Date: Wed, 14 Mar 2018 12:52:26 -0600
Subject: [PATCH] MAINT: Fix test_utils.py for Python 3.7.
The contents of the module warnings registries was made more module
specific in Python 3.7 and consequently the tests of the context
managers clear_and_catch_warnings and suppress_warnings need updating.
---
numpy/testing/tests/test_utils.py | 43 +++++++++++++++++++++----------
1 file changed, 29 insertions(+), 14 deletions(-)
diff --git a/numpy/testing/tests/test_utils.py b/numpy/testing/tests/test_utils.py
index a97b627f9..33b3555b0 100644
--- a/numpy/testing/tests/test_utils.py
+++ b/numpy/testing/tests/test_utils.py
@@ -1114,18 +1114,28 @@ class TestStringEqual(unittest.TestCase):
lambda: assert_string_equal("foo", "hello"))
-def assert_warn_len_equal(mod, n_in_context, py3_n_in_context=None):
+def assert_warn_len_equal(mod, n_in_context, py34=None, py37=None):
mod_warns = mod.__warningregistry__
+ num_warns = len(mod_warns)
# Python 3.4 appears to clear any pre-existing warnings of the same type,
# when raising warnings inside a catch_warnings block. So, there is a
# warning generated by the tests within the context manager, but no
# previous warnings.
if 'version' in mod_warns:
- if py3_n_in_context is None:
- py3_n_in_context = n_in_context
- assert_equal(len(mod_warns) - 1, py3_n_in_context)
- else:
- assert_equal(len(mod_warns), n_in_context)
+ # Python 3 adds a 'version' entry to the registry,
+ # do not count it.
+ num_warns -= 1
+
+ # Behavior of warnings is Python version dependent. Adjust the
+ # expected result to compensate. In particular, Python 3.7 does
+ # not make an entry for ignored warnings.
+ if sys.version_info[:2] >= (3, 7):
+ if py37 is not None:
+ n_in_context = py37
+ elif sys.version_info[:2] >= (3, 4):
+ if py34 is not None:
+ n_in_context = py34
+ assert_equal(num_warns, n_in_context)
def _get_fresh_mod():
@@ -1134,6 +1144,8 @@ def _get_fresh_mod():
try:
my_mod.__warningregistry__.clear()
except AttributeError:
+ # will not have a __warningregistry__ unless warning has been
+ # raised in the module at some point
pass
return my_mod
@@ -1147,21 +1159,23 @@ def test_clear_and_catch_warnings():
warnings.warn('Some warning')
assert_equal(my_mod.__warningregistry__, {})
# Without specified modules, don't clear warnings during context
+ # Python 3.7 catch_warnings doesn't make an entry for 'ignore'.
with clear_and_catch_warnings():
warnings.simplefilter('ignore')
warnings.warn('Some warning')
- assert_warn_len_equal(my_mod, 1)
+ assert_warn_len_equal(my_mod, 1, py37=0)
# Confirm that specifying module keeps old warning, does not add new
with clear_and_catch_warnings(modules=[my_mod]):
warnings.simplefilter('ignore')
warnings.warn('Another warning')
- assert_warn_len_equal(my_mod, 1)
+ assert_warn_len_equal(my_mod, 1, py37=0)
# Another warning, no module spec does add to warnings dict, except on
# Python 3.4 (see comments in `assert_warn_len_equal`)
+ # Python 3.7 catch_warnings doesn't make an entry for 'ignore'.
with clear_and_catch_warnings():
warnings.simplefilter('ignore')
warnings.warn('Another warning')
- assert_warn_len_equal(my_mod, 2, 1)
+ assert_warn_len_equal(my_mod, 2, py34=1, py37=0)
def test_suppress_warnings_module():
@@ -1178,6 +1192,7 @@ def test_suppress_warnings_module():
np.apply_along_axis(warn, 0, [0])
# Test module based warning suppression:
+ assert_warn_len_equal(my_mod, 0)
with suppress_warnings() as sup:
sup.record(UserWarning)
# suppress warning from other module (may have .pyc ending),
@@ -1189,8 +1204,7 @@ def test_suppress_warnings_module():
# got filtered)
assert_(len(sup.log) == 1)
assert_(sup.log[0].message.args[0] == "Some warning")
-
- assert_warn_len_equal(my_mod, 0)
+ assert_warn_len_equal(my_mod, 0, py37=0)
sup = suppress_warnings()
# Will have to be changed if apply_along_axis is moved:
sup.filter(module=my_mod)
@@ -1204,11 +1218,11 @@ def test_suppress_warnings_module():
assert_warn_len_equal(my_mod, 0)
# Without specified modules, don't clear warnings during context
+ # Python 3.7 does not add ignored warnings.
with suppress_warnings():
warnings.simplefilter('ignore')
warnings.warn('Some warning')
- assert_warn_len_equal(my_mod, 1)
-
+ assert_warn_len_equal(my_mod, 1, py37=0)
def test_suppress_warnings_type():
# Initial state of module, no warnings
@@ -1232,10 +1246,11 @@ def test_suppress_warnings_type():
assert_warn_len_equal(my_mod, 0)
# Without specified modules, don't clear warnings during context
+ # Python 3.7 does not add ignored warnings.
with suppress_warnings():
warnings.simplefilter('ignore')
warnings.warn('Some warning')
- assert_warn_len_equal(my_mod, 1)
+ assert_warn_len_equal(my_mod, 1, py37=0)
def test_suppress_warnings_decorate_no_record():
--
2.18.0
@@ -1,76 +0,0 @@
diff --git a/numpy/distutils/system_info.py b/numpy/distutils/system_info.py
index 65d7de316..a85640d30 100644
--- a/numpy/distutils/system_info.py
+++ b/numpy/distutils/system_info.py
@@ -364,29 +364,7 @@ def get_info(name, notfound_action=0):
1 - display warning message
2 - raise error
"""
- cl = {'atlas': atlas_info, # use lapack_opt or blas_opt instead
- 'atlas_threads': atlas_threads_info, # ditto
- 'atlas_blas': atlas_blas_info,
- 'atlas_blas_threads': atlas_blas_threads_info,
- 'lapack_atlas': lapack_atlas_info, # use lapack_opt instead
- 'lapack_atlas_threads': lapack_atlas_threads_info, # ditto
- 'atlas_3_10': atlas_3_10_info, # use lapack_opt or blas_opt instead
- 'atlas_3_10_threads': atlas_3_10_threads_info, # ditto
- 'atlas_3_10_blas': atlas_3_10_blas_info,
- 'atlas_3_10_blas_threads': atlas_3_10_blas_threads_info,
- 'lapack_atlas_3_10': lapack_atlas_3_10_info, # use lapack_opt instead
- 'lapack_atlas_3_10_threads': lapack_atlas_3_10_threads_info, # ditto
- 'mkl': mkl_info,
- # openblas which may or may not have embedded lapack
- 'openblas': openblas_info, # use blas_opt instead
- # openblas with embedded lapack
- 'openblas_lapack': openblas_lapack_info, # use blas_opt instead
- 'openblas_clapack': openblas_clapack_info, # use blas_opt instead
- 'blis': blis_info, # use blas_opt instead
- 'lapack_mkl': lapack_mkl_info, # use lapack_opt instead
- 'blas_mkl': blas_mkl_info, # use blas_opt instead
- 'accelerate': accelerate_info, # use blas_opt instead
- 'x11': x11_info,
+ cl = {'x11': x11_info,
'fft_opt': fft_opt_info,
'fftw': fftw_info,
'fftw2': fftw2_info,
@@ -731,10 +709,7 @@ class system_info(object):
return [b for b in [a.strip() for a in libs.split(',')] if b]
def get_libraries(self, key='libraries'):
- if hasattr(self, '_lib_names'):
- return self.get_libs(key, default=self._lib_names)
- else:
- return self.get_libs(key, '')
+ return self.get_libs(key, '')
def library_extensions(self):
c = customized_ccompiler()
@@ -1685,7 +1660,7 @@ class blas_info(system_info):
lib = self.has_cblas(info)
if lib is not None:
info['language'] = 'c'
- info['libraries'] = [lib]
+ info['libraries'] = lib
info['define_macros'] = [('HAVE_CBLAS', None)]
self.set_info(**info)
@@ -1717,16 +1692,16 @@ class blas_info(system_info):
# check for cblas lib, and if not present check for blas lib.
try:
c.link_executable(obj, os.path.join(tmpdir, "a.out"),
- libraries=["cblas"],
+ libraries=info["libraries"],
library_dirs=info['library_dirs'],
extra_postargs=info.get('extra_link_args', []))
- res = "cblas"
+ res = info["libraries"]
except distutils.ccompiler.LinkError:
c.link_executable(obj, os.path.join(tmpdir, "a.out"),
libraries=["blas"],
library_dirs=info['library_dirs'],
extra_postargs=info.get('extra_link_args', []))
- res = "blas"
+ res = ["blas"]
except distutils.ccompiler.CompileError:
res = None
finally:
@@ -1,8 +1,8 @@
diff --git a/numpy/distutils/system_info.py b/numpy/distutils/system_info.py
index ba2b1f46c..09db18e69 100644
index 13f9da0..b696ef5 100644
--- a/numpy/distutils/system_info.py
+++ b/numpy/distutils/system_info.py
@@ -374,28 +374,7 @@ def get_info(name, notfound_action=0):
@@ -505,32 +505,7 @@ def get_info(name, notfound_action=0):
1 - display warning message
2 - raise error
"""
@@ -28,11 +28,15 @@ index ba2b1f46c..09db18e69 100644
- 'blis': blis_info, # use blas_opt instead
- 'lapack_mkl': lapack_mkl_info, # use lapack_opt instead
- 'blas_mkl': blas_mkl_info, # use blas_opt instead
- 'openblas64_': openblas64__info,
- 'openblas64__lapack': openblas64__lapack_info,
- 'openblas_ilp64': openblas_ilp64_info,
- 'openblas_ilp64_lapack': openblas_ilp64_lapack_info,
+ cl = {'flame': flame_info, # use lapack_opt instead
'accelerate': accelerate_info, # use blas_opt instead
'x11': x11_info,
'fft_opt': fft_opt_info,
@@ -796,10 +775,7 @@ class system_info(object):
'fftw': fftw_info,
@@ -950,10 +925,7 @@ class system_info:
return [b for b in [a.strip() for a in libs.split(',')] if b]
def get_libraries(self, key='libraries'):
@@ -44,12 +48,3 @@ index ba2b1f46c..09db18e69 100644
def library_extensions(self):
c = customized_ccompiler()
@@ -1842,7 +1818,7 @@ class blas_info(system_info):
lib = self.get_cblas_libs(info)
if lib is not None:
info['language'] = 'c'
- info['libraries'] = lib
+ info['libraries'] = [lib]
info['define_macros'] = [('HAVE_CBLAS', None)]
self.set_info(**info)
@@ -0,0 +1,36 @@
From 6f2f26e08c6e0d476593c82ad31d13847f30cbf4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
Date: Sun, 28 Mar 2021 10:00:14 +0200
Subject: [PATCH] BUG: Fix test_ccompiler_opt when path contains dots
Fix test_ccompiler_opt not to be confused by dots occurring on the path
to the temporary directory, by using only the source file's basename
when grabbing options. Otherwise, the test can fail with mismatches
such as:
E AssertionError: 'sources_status' returns different targets than the compiled targets
E ['AVX512F', 'AVX2'] != ['(20 2/TEMP/TMPB0YHSCAI/TEST_TARGETS AVX512F)', '(20 2/TEMP/TMPB0YHSCAI/TEST_TARGETS AVX2)']
This is because our TMPDIR value includes numpy version, i.e. 1.20.2.
The splitting happens on the first dot that is part of the directory
path rather than test filename.
---
numpy/distutils/tests/test_ccompiler_opt.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/numpy/distutils/tests/test_ccompiler_opt.py b/numpy/distutils/tests/test_ccompiler_opt.py
index 287a683c8..d2b0a4c58 100644
--- a/numpy/distutils/tests/test_ccompiler_opt.py
+++ b/numpy/distutils/tests/test_ccompiler_opt.py
@@ -112,7 +112,7 @@ class _Test_CCompilerOpt(object):
gflags = {}
fake_objects = opt.try_dispatch([file])
for source, flags in fake_objects:
- gtar = source.split('.')[1:-1]
+ gtar = path.basename(source).split('.')[1:-1]
glen = len(gtar)
if glen == 0:
gtar = "baseline"
--
2.31.1
-144
View File
@@ -1,144 +0,0 @@
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=6
PYTHON_COMPAT=( python3_{5,6,7} )
PYTHON_REQ_USE="threads(+)"
FORTRAN_NEEDED=lapack
inherit distutils-r1 flag-o-matic fortran-2 multiprocessing toolchain-funcs
DOC_PV="${PV}"
DOC_P="${PN}-${DOC_PV}"
DESCRIPTION="Fast array and numerical python library"
HOMEPAGE="https://www.numpy.org"
SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.zip"
LICENSE="BSD"
SLOT="0"
KEYWORDS="~amd64 ~arm ~x86 ~amd64-linux ~x86-linux"
IUSE="doc lapack test"
RDEPEND="lapack? ( virtual/cblas virtual/lapack )"
DEPEND="${RDEPEND}
app-arch/unzip
dev-python/setuptools[${PYTHON_USEDEP}]
lapack? ( virtual/pkgconfig )
test? ( >=dev-python/nose-1.0[${PYTHON_USEDEP}] )"
PATCHES=(
# "${FILESDIR}"/${PN}-1.14.5-no-hardcode-blas.patch
# backport a fix for py3.7 test failures
# "${FILESDIR}"/numpy-1.14.5-py37.patch
)
src_unpack() {
default
if use doc; then
unzip -qo "${DISTDIR}"/${PN}-html-${DOC_PV}.zip -d html || die
fi
}
pc_incdir() {
$(tc-getPKG_CONFIG) --cflags-only-I $@ | \
sed -e 's/^-I//' -e 's/[ ]*-I/:/g' -e 's/[ ]*$//' -e 's|^:||'
}
pc_libdir() {
$(tc-getPKG_CONFIG) --libs-only-L $@ | \
sed -e 's/^-L//' -e 's/[ ]*-L/:/g' -e 's/[ ]*$//' -e 's|^:||'
}
pc_libs() {
$(tc-getPKG_CONFIG) --libs-only-l $@ | \
sed -e 's/[ ]-l*\(pthread\|m\)\([ ]\|$\)//g' \
-e 's/^-l//' -e 's/[ ]*-l/,/g' -e 's/[ ]*$//' \
| tr ',' '\n' | sort -u | tr '\n' ',' | sed -e 's|,$||'
}
python_prepare_all() {
if use lapack; then
append-ldflags "$($(tc-getPKG_CONFIG) --libs-only-other cblas lapack)"
local libdir="${EPREFIX}"/usr/$(get_libdir)
cat >> site.cfg <<-EOF || die
[blas]
include_dirs = $(pc_incdir cblas)
library_dirs = $(pc_libdir cblas blas):${libdir}
blas_libs = $(pc_libs cblas blas)
[lapack]
library_dirs = $(pc_libdir lapack):${libdir}
lapack_libs = $(pc_libs lapack)
EOF
else
export {ATLAS,PTATLAS,BLAS,LAPACK,MKL}=None
fi
export CC="$(tc-getCC) ${CFLAGS}"
append-flags -fno-strict-aliasing
# See progress in https://projects.scipy.org/scipy/numpy/ticket/573
# with the subtle difference that we don't want to break Darwin where
# -shared is not a valid linker argument
if [[ ${CHOST} != *-darwin* ]]; then
append-ldflags -shared
fi
# only one fortran to link with:
# linking with cblas and lapack library will force
# autodetecting and linking to all available fortran compilers
append-fflags -fPIC
if use lapack; then
NUMPY_FCONFIG="config_fc --noopt --noarch"
# workaround bug 335908
[[ $(tc-getFC) == *gfortran* ]] && NUMPY_FCONFIG+=" --fcompiler=gnu95"
fi
# don't version f2py, we will handle it.
sed -i -e '/f2py_exe/s: + os\.path.*$::' numpy/f2py/setup.py || die
# we don't have f2py-3.3
sed \
-e 's:test_f2py:_&:g' \
-i numpy/tests/test_scripts.py || die
distutils-r1_python_prepare_all
}
python_compile() {
export MAKEOPTS=-j1 # bug #660754
local python_makeopts_jobs=""
python_is_python3 || python_makeopts_jobs="-j $(makeopts_jobs)"
distutils-r1_python_compile \
${python_makeopts_jobs} \
${NUMPY_FCONFIG}
}
python_test() {
distutils_install_for_testing --single-version-externally-managed --record "${TMPDIR}/record.txt" ${NUMPY_FCONFIG}
cd "${TMPDIR}" || die
${EPYTHON} -c "
import numpy, sys
r = numpy.test(label='full', verbose=3)
sys.exit(0 if r.wasSuccessful() else 1)" || die "Tests fail with ${EPYTHON}"
}
python_install() {
distutils-r1_python_install ${NUMPY_FCONFIG}
}
python_install_all() {
local DOCS=( THANKS.txt )
if use doc; then
local HTML_DOCS=( "${WORKDIR}"/html/. )
DOCS+=( "${DISTDIR}"/${PN}-{user,ref}-${DOC_PV}.pdf )
fi
distutils-r1_python_install_all
}
-156
View File
@@ -1,156 +0,0 @@
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI="7"
PYTHON_COMPAT=( python3_{5,6,7} )
PYTHON_REQ_USE="threads(+)"
FORTRAN_NEEDED=lapack
inherit distutils-r1 flag-o-matic fortran-2 multiprocessing toolchain-funcs
DOC_PV="1.16.4"
DESCRIPTION="Fast array and numerical python library"
HOMEPAGE="https://www.numpy.org"
SRC_URI="
mirror://pypi/${PN:0:1}/${PN}/${P}.zip
doc? (
https://numpy.org/doc/$(ver_cut 1-2 ${DOC_PV})/numpy-html.zip -> numpy-html-${DOC_PV}.zip
https://numpy.org/doc/$(ver_cut 1-2 ${DOC_PV})/numpy-ref.pdf -> numpy-ref-${DOC_PV}.pdf
https://numpy.org/doc/$(ver_cut 1-2 ${DOC_PV})/numpy-user.pdf -> numpy-user-${DOC_PV}.pdf
)"
LICENSE="BSD"
SLOT="0"
KEYWORDS="~amd64 ~arm ~x86 ~amd64-linux ~x86-linux"
IUSE="doc lapack test"
RESTRICT="!test? ( test )"
RDEPEND="
lapack? (
virtual/cblas
virtual/lapack
)"
DEPEND="${RDEPEND}"
BDEPEND="app-arch/unzip
dev-python/setuptools[${PYTHON_USEDEP}]
lapack? ( virtual/pkgconfig )
test? (
dev-python/pytest[${PYTHON_USEDEP}]
)"
#PATCHES=(
# "${FILESDIR}"/${PN}-1.15.4-no-hardcode-blas.patch
#)
src_unpack() {
default
if use doc; then
unzip -qo "${DISTDIR}"/numpy-html-${DOC_PV}.zip -d html || die
fi
}
pc_incdir() {
$(tc-getPKG_CONFIG) --cflags-only-I $@ | \
sed -e 's/^-I//' -e 's/[ ]*-I/:/g' -e 's/[ ]*$//' -e 's|^:||'
}
pc_libdir() {
$(tc-getPKG_CONFIG) --libs-only-L $@ | \
sed -e 's/^-L//' -e 's/[ ]*-L/:/g' -e 's/[ ]*$//' -e 's|^:||'
}
pc_libs() {
$(tc-getPKG_CONFIG) --libs-only-l $@ | \
sed -e 's/[ ]-l*\(pthread\|m\)\([ ]\|$\)//g' \
-e 's/^-l//' -e 's/[ ]*-l/,/g' -e 's/[ ]*$//' \
| tr ',' '\n' | sort -u | tr '\n' ',' | sed -e 's|,$||'
}
python_prepare_all() {
if use lapack; then
append-ldflags "$($(tc-getPKG_CONFIG) --libs-only-other cblas lapack)"
local incdir="${EPREFIX}"/usr/include
local libdir="${EPREFIX}"/usr/$(get_libdir)
cat >> site.cfg <<-EOF || die
[blas]
include_dirs = $(pc_incdir cblas):${incdir}
library_dirs = $(pc_libdir cblas blas):${libdir}
blas_libs = $(pc_libs cblas blas)
[lapack]
library_dirs = $(pc_libdir lapack):${libdir}
lapack_libs = $(pc_libs lapack)
EOF
else
export {ATLAS,PTATLAS,BLAS,LAPACK,MKL}=None
fi
export CC="$(tc-getCC) ${CFLAGS}"
append-flags -fno-strict-aliasing
# See progress in https://projects.scipy.org/scipy/numpy/ticket/573
# with the subtle difference that we don't want to break Darwin where
# -shared is not a valid linker argument
if [[ ${CHOST} != *-darwin* ]]; then
append-ldflags -shared
fi
# only one fortran to link with:
# linking with cblas and lapack library will force
# autodetecting and linking to all available fortran compilers
append-fflags -fPIC
if use lapack; then
NUMPY_FCONFIG="config_fc --noopt --noarch"
# workaround bug 335908
[[ $(tc-getFC) == *gfortran* ]] && NUMPY_FCONFIG+=" --fcompiler=gnu95"
fi
# don't version f2py, we will handle it.
sed -i -e '/f2py_exe/s: + os\.path.*$::' numpy/f2py/setup.py || die
# disable fuzzed tests
find numpy/*/tests -name '*.py' -exec sed -i \
-e 's:def \(.*_fuzz\):def _\1:' {} + || die
# very memory- and disk-hungry
sed -i -e 's:test_large_zip:_&:' numpy/lib/tests/test_io.py || die
distutils-r1_python_prepare_all
}
python_compile() {
export MAKEOPTS=-j1 #660754
local python_makeopts_jobs=""
python_is_python3 || python_makeopts_jobs="-j $(makeopts_jobs)"
distutils-r1_python_compile \
${python_makeopts_jobs} \
${NUMPY_FCONFIG}
}
python_test() {
distutils_install_for_testing --single-version-externally-managed \
--record "${TMPDIR}/record.txt" ${NUMPY_FCONFIG}
cd "${TMPDIR}" || die
"${EPYTHON}" -c "
import numpy, sys
r = numpy.test(label='full', verbose=3)
sys.exit(0 if r else 1)" || die "Tests fail with ${EPYTHON}"
}
python_install() {
distutils-r1_python_install ${NUMPY_FCONFIG}
}
python_install_all() {
local DOCS=( THANKS.txt )
if use doc; then
local HTML_DOCS=( "${WORKDIR}"/html/. )
DOCS+=( "${DISTDIR}"/${PN}-{user,ref}-${DOC_PV}.pdf )
fi
distutils-r1_python_install_all
}
-139
View File
@@ -1,139 +0,0 @@
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
PYTHON_COMPAT=( python3_{6,7,8} )
PYTHON_REQ_USE="threads(+)"
FORTRAN_NEEDED=lapack
inherit distutils-r1 flag-o-matic fortran-2 multiprocessing toolchain-funcs
DOC_PV="1.16.4"
DESCRIPTION="Fast array and numerical python library"
HOMEPAGE="https://www.numpy.org"
SRC_URI="
mirror://pypi/${PN:0:1}/${PN}/${P}.zip
doc? (
https://numpy.org/doc/$(ver_cut 1-2 ${DOC_PV})/numpy-html.zip -> numpy-html-${DOC_PV}.zip
https://numpy.org/doc/$(ver_cut 1-2 ${DOC_PV})/numpy-ref.pdf -> numpy-ref-${DOC_PV}.pdf
https://numpy.org/doc/$(ver_cut 1-2 ${DOC_PV})/numpy-user.pdf -> numpy-user-${DOC_PV}.pdf
)"
LICENSE="BSD"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x64-solaris ~x86-solaris"
IUSE="doc lapack test"
RESTRICT="!test? ( test )"
RDEPEND="
lapack? (
>=virtual/cblas-3.8
>=virtual/lapack-3.8
)"
DEPEND="${RDEPEND}"
BDEPEND="app-arch/unzip
dev-python/setuptools[${PYTHON_USEDEP}]
lapack? ( virtual/pkgconfig )
test? (
dev-python/pytest[${PYTHON_USEDEP}]
)"
PATCHES=(
"${FILESDIR}"/${PN}-1.17.4-no-hardcode-blasv2.patch
)
src_unpack() {
default
if use doc; then
unzip -qo "${DISTDIR}"/numpy-html-${DOC_PV}.zip -d html || die
fi
}
python_prepare_all() {
if use lapack; then
local incdir="${EPREFIX}"/usr/include
local libdir="${EPREFIX}"/usr/$(get_libdir)
cat >> site.cfg <<-EOF || die
[blas]
include_dirs = ${incdir}
library_dirs = ${libdir}
blas_libs = cblas,blas
[lapack]
library_dirs = ${libdir}
lapack_libs = lapack
EOF
else
export {ATLAS,PTATLAS,BLAS,LAPACK,MKL}=None
fi
export CC="$(tc-getCC) ${CFLAGS}"
append-flags -fno-strict-aliasing
# See progress in https://projects.scipy.org/scipy/numpy/ticket/573
# with the subtle difference that we don't want to break Darwin where
# -shared is not a valid linker argument
if [[ ${CHOST} != *-darwin* ]]; then
append-ldflags -shared
fi
# only one fortran to link with:
# linking with cblas and lapack library will force
# autodetecting and linking to all available fortran compilers
append-fflags -fPIC
if use lapack; then
NUMPY_FCONFIG="config_fc --noopt --noarch"
# workaround bug 335908
[[ $(tc-getFC) == *gfortran* ]] && NUMPY_FCONFIG+=" --fcompiler=gnu95"
fi
# don't version f2py, we will handle it.
sed -i -e '/f2py_exe/s: + os\.path.*$::' numpy/f2py/setup.py || die
# disable fuzzed tests
find numpy/*/tests -name '*.py' -exec sed -i \
-e 's:def \(.*_fuzz\):def _\1:' {} + || die
# very memory- and disk-hungry
sed -i -e 's:test_large_zip:_&:' numpy/lib/tests/test_io.py || die
distutils-r1_python_prepare_all
}
python_compile() {
export MAKEOPTS=-j1 #660754
local python_makeopts_jobs=""
python_is_python3 || python_makeopts_jobs="-j $(makeopts_jobs)"
distutils-r1_python_compile \
${python_makeopts_jobs} \
${NUMPY_FCONFIG}
}
python_test() {
distutils_install_for_testing --single-version-externally-managed \
--record "${TMPDIR}/record.txt" ${NUMPY_FCONFIG}
cd "${TMPDIR}" || die
"${EPYTHON}" -c "
import numpy, sys
r = numpy.test(label='full', verbose=3)
sys.exit(0 if r else 1)" || die "Tests fail with ${EPYTHON}"
}
python_install() {
distutils-r1_python_install ${NUMPY_FCONFIG}
python_optimize
}
python_install_all() {
local DOCS=( THANKS.txt )
if use doc; then
local HTML_DOCS=( "${WORKDIR}"/html/. )
DOCS+=( "${DISTDIR}"/${PN}-{user,ref}-${DOC_PV}.pdf )
fi
distutils-r1_python_install_all
}
-139
View File
@@ -1,139 +0,0 @@
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
PYTHON_COMPAT=( python3_{6,7,8} )
PYTHON_REQ_USE="threads(+)"
FORTRAN_NEEDED=lapack
inherit distutils-r1 flag-o-matic fortran-2 multiprocessing toolchain-funcs
DOC_PV="1.16.4"
DESCRIPTION="Fast array and numerical python library"
HOMEPAGE="https://www.numpy.org"
SRC_URI="
mirror://pypi/${PN:0:1}/${PN}/${P}.zip
doc? (
https://numpy.org/doc/$(ver_cut 1-2 ${DOC_PV})/numpy-html.zip -> numpy-html-${DOC_PV}.zip
https://numpy.org/doc/$(ver_cut 1-2 ${DOC_PV})/numpy-ref.pdf -> numpy-ref-${DOC_PV}.pdf
https://numpy.org/doc/$(ver_cut 1-2 ${DOC_PV})/numpy-user.pdf -> numpy-user-${DOC_PV}.pdf
)"
LICENSE="BSD"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x64-solaris ~x86-solaris"
IUSE="doc lapack test"
RESTRICT="!test? ( test )"
RDEPEND="
lapack? (
>=virtual/cblas-3.8
>=virtual/lapack-3.8
)"
DEPEND="${RDEPEND}"
BDEPEND="app-arch/unzip
dev-python/setuptools[${PYTHON_USEDEP}]
lapack? ( virtual/pkgconfig )
test? (
dev-python/pytest[${PYTHON_USEDEP}]
)"
PATCHES=(
"${FILESDIR}"/${PN}-1.17.4-no-hardcode-blasv2.patch
)
src_unpack() {
default
if use doc; then
unzip -qo "${DISTDIR}"/numpy-html-${DOC_PV}.zip -d html || die
fi
}
python_prepare_all() {
if use lapack; then
local incdir="${EPREFIX}"/usr/include
local libdir="${EPREFIX}"/usr/$(get_libdir)
cat >> site.cfg <<-EOF || die
[blas]
include_dirs = ${incdir}
library_dirs = ${libdir}
blas_libs = cblas,blas
[lapack]
library_dirs = ${libdir}
lapack_libs = lapack
EOF
else
export {ATLAS,PTATLAS,BLAS,LAPACK,MKL}=None
fi
export CC="$(tc-getCC) ${CFLAGS}"
append-flags -fno-strict-aliasing
# See progress in https://projects.scipy.org/scipy/numpy/ticket/573
# with the subtle difference that we don't want to break Darwin where
# -shared is not a valid linker argument
if [[ ${CHOST} != *-darwin* ]]; then
append-ldflags -shared
fi
# only one fortran to link with:
# linking with cblas and lapack library will force
# autodetecting and linking to all available fortran compilers
append-fflags -fPIC
if use lapack; then
NUMPY_FCONFIG="config_fc --noopt --noarch"
# workaround bug 335908
[[ $(tc-getFC) == *gfortran* ]] && NUMPY_FCONFIG+=" --fcompiler=gnu95"
fi
# don't version f2py, we will handle it.
sed -i -e '/f2py_exe/s: + os\.path.*$::' numpy/f2py/setup.py || die
# disable fuzzed tests
find numpy/*/tests -name '*.py' -exec sed -i \
-e 's:def \(.*_fuzz\):def _\1:' {} + || die
# very memory- and disk-hungry
sed -i -e 's:test_large_zip:_&:' numpy/lib/tests/test_io.py || die
distutils-r1_python_prepare_all
}
python_compile() {
export MAKEOPTS=-j1 #660754
local python_makeopts_jobs=""
python_is_python3 || python_makeopts_jobs="-j $(makeopts_jobs)"
distutils-r1_python_compile \
${python_makeopts_jobs} \
${NUMPY_FCONFIG}
}
python_test() {
distutils_install_for_testing --single-version-externally-managed \
--record "${TMPDIR}/record.txt" ${NUMPY_FCONFIG}
cd "${TMPDIR}" || die
"${EPYTHON}" -c "
import numpy, sys
r = numpy.test(label='full', verbose=3)
sys.exit(0 if r else 1)" || die "Tests fail with ${EPYTHON}"
}
python_install() {
distutils-r1_python_install ${NUMPY_FCONFIG}
python_optimize
}
python_install_all() {
local DOCS=( THANKS.txt )
if use doc; then
local HTML_DOCS=( "${WORKDIR}"/html/. )
DOCS+=( "${DISTDIR}"/${PN}-{user,ref}-${DOC_PV}.pdf )
fi
distutils-r1_python_install_all
}
@@ -1,9 +1,9 @@
# Copyright 1999-2020 Gentoo Authors
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
PYTHON_COMPAT=( python3_{6,7,8} )
PYTHON_COMPAT=( python3_{7..9} )
PYTHON_REQ_USE="threads(+)"
FORTRAN_NEEDED=lapack
@@ -14,7 +14,7 @@ inherit distutils-r1 flag-o-matic fortran-2 multiprocessing toolchain-funcs
DOC_PV="1.16.4"
DESCRIPTION="Fast array and numerical python library"
HOMEPAGE="https://www.numpy.org"
HOMEPAGE="https://numpy.org/"
SRC_URI="
mirror://pypi/${PN:0:1}/${PN}/${P}.zip
doc? (
@@ -24,7 +24,7 @@ SRC_URI="
)"
LICENSE="BSD"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x64-solaris ~x86-solaris"
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"
IUSE="doc lapack"
RDEPEND="
@@ -36,7 +36,7 @@ RDEPEND="
BDEPEND="
${RDEPEND}
app-arch/unzip
>=dev-python/cython-0.29.15[${PYTHON_USEDEP}]
>=dev-python/cython-0.29.21[${PYTHON_USEDEP}]
lapack? ( virtual/pkgconfig )
test? (
>=dev-python/hypothesis-5.8.0[${PYTHON_USEDEP}]
@@ -46,7 +46,8 @@ BDEPEND="
"
PATCHES=(
"${FILESDIR}"/${PN}-1.17.4-no-hardcode-blasv2.patch
"${FILESDIR}"/numpy-1.20.1-no-hardcode-blasv2.patch
"${FILESDIR}"/numpy-1.20.2-fix-ccompiler-tests.patch
)
distutils_enable_tests pytest
@@ -79,7 +80,7 @@ python_prepare_all() {
append-flags -fno-strict-aliasing
# See progress in https://projects.scipy.org/scipy/numpy/ticket/573
# See progress in http://projects.scipy.org/scipy/numpy/ticket/573
# with the subtle difference that we don't want to break Darwin where
# -shared is not a valid linker argument
if [[ ${CHOST} != *-darwin* ]]; then
@@ -118,12 +119,9 @@ python_test() {
distutils_install_for_testing --single-version-externally-managed \
--record "${TMPDIR}/record.txt" ${NUMPY_FCONFIG}
cd "${TMPDIR}" || die
"${EPYTHON}" -c "
import numpy, sys
r = numpy.test(label='full', verbose=3)
sys.exit(0 if r else 1)" || die "Tests fail with ${EPYTHON}"
cd "${TEST_DIR}/lib" || die
epytest \
--deselect 'numpy/typing/tests/test_typing.py::test_fail[array_constructors.py]'
}
python_install() {