Compare commits

...

No commits in common. "c8-stream-2.7" and "c8-beta-stream-3.9" have entirely different histories.

6 changed files with 355 additions and 3309 deletions

4
.gitignore vendored
View File

@ -1,2 +1,2 @@
SOURCES/numpy-1.14.2.tar.gz SOURCES/numpy-1.19.4.tar.gz
SOURCES/numpy-html-1.13.0.zip SOURCES/numpy-html.zip

View File

@ -1,2 +1,2 @@
c00e70468703830a26ee9173ba1cf4aedf08718f SOURCES/numpy-1.14.2.tar.gz 501cb32818de06b79a852322da95fc8b27a32742 SOURCES/numpy-1.19.4.tar.gz
b23d66880bba5f56baa81ce02eb5a55de046c0a7 SOURCES/numpy-html-1.13.0.zip 035c72d0bb7430cebc242f229f5cc05a07caa5d9 SOURCES/numpy-html.zip

View File

@ -1,166 +0,0 @@
From 0fcfa065d900040c80628b31b8b6ea606c131086 Mon Sep 17 00:00:00 2001
From: Paul Ivanov <pivanov5@bloomberg.net>
Date: Wed, 30 Jan 2019 14:22:44 -0800
Subject: [PATCH] BUG: load fails when using pickle without allow_pickle=True
a partial mitigation of #12759.
see also https://nvd.nist.gov/vuln/detail/CVE-2019-6446
---
numpy/core/tests/test_regression.py | 2 +-
numpy/lib/format.py | 8 ++++++--
numpy/lib/npyio.py | 17 ++++++++++++-----
numpy/lib/tests/test_format.py | 15 +++++++++------
numpy/lib/tests/test_io.py | 2 +-
5 files changed, 29 insertions(+), 15 deletions(-)
diff --git a/numpy/core/tests/test_regression.py b/numpy/core/tests/test_regression.py
index a3b0114..2be6bf3 100644
--- a/numpy/core/tests/test_regression.py
+++ b/numpy/core/tests/test_regression.py
@@ -96,7 +96,7 @@ class TestRegression(object):
ca = np.char.array(np.arange(1000, 1010), itemsize=4)
ca.dump(f)
f.seek(0)
- ca = np.load(f)
+ ca = np.load(f, allow_pickle=True)
f.close()
def test_noncontiguous_fill(self):
diff --git a/numpy/lib/format.py b/numpy/lib/format.py
index 363bb21..b91142c 100644
--- a/numpy/lib/format.py
+++ b/numpy/lib/format.py
@@ -602,7 +602,7 @@ def write_array(fp, array, version=None, allow_pickle=True, pickle_kwargs=None):
fp.write(chunk.tobytes('C'))
-def read_array(fp, allow_pickle=True, pickle_kwargs=None):
+def read_array(fp, allow_pickle=False, pickle_kwargs=None):
"""
Read an array from an NPY file.
@@ -612,7 +612,11 @@ def read_array(fp, allow_pickle=True, pickle_kwargs=None):
If this is not a real file object, then this may take extra memory
and time.
allow_pickle : bool, optional
- Whether to allow reading pickled data. Default: True
+ Whether to allow writing pickled data. Default: False
+
+ .. versionchanged:: 1.14.2
+ Made default False in response to CVE-2019-6446.
+
pickle_kwargs : dict
Additional keyword arguments to pass to pickle.load. These are only
useful when loading object arrays saved on Python 2 when using
diff --git a/numpy/lib/npyio.py b/numpy/lib/npyio.py
index 76b135c..c6522f5 100644
--- a/numpy/lib/npyio.py
+++ b/numpy/lib/npyio.py
@@ -130,7 +130,11 @@ class NpzFile(object):
An object on which attribute can be performed as an alternative
to getitem access on the `NpzFile` instance itself.
allow_pickle : bool, optional
- Allow loading pickled data. Default: True
+ Allow loading pickled data. Default: False
+
+ .. versionchanged:: 1.14.2
+ Made default False in response to CVE-2019-6446.
+
pickle_kwargs : dict, optional
Additional keyword arguments to pass on to pickle.load.
These are only useful when loading object arrays saved on
@@ -166,7 +170,7 @@ class NpzFile(object):
"""
- def __init__(self, fid, own_fid=False, allow_pickle=True,
+ def __init__(self, fid, own_fid=False, allow_pickle=False,
pickle_kwargs=None):
# Import is postponed to here since zipfile depends on gzip, an
# optional component of the so-called standard library.
@@ -265,7 +269,7 @@ class NpzFile(object):
return self.files.__contains__(key)
-def load(file, mmap_mode=None, allow_pickle=True, fix_imports=True,
+def load(file, mmap_mode=None, allow_pickle=False, fix_imports=True,
encoding='ASCII'):
"""
Load arrays or pickled objects from ``.npy``, ``.npz`` or pickled files.
@@ -287,8 +291,11 @@ def load(file, mmap_mode=None, allow_pickle=True, fix_imports=True,
Allow loading pickled object arrays stored in npy files. Reasons for
disallowing pickles include security, as loading pickled data can
execute arbitrary code. If pickles are disallowed, loading object
- arrays will fail.
- Default: True
+ arrays will fail. Default: False
+
+ .. versionchanged:: 1.14.2
+ Made default False in response to CVE-2019-6446.
+
fix_imports : bool, optional
Only useful when loading Python 2 generated pickled files on Python 3,
which includes npy/npz files containing object arrays. If `fix_imports`
diff --git a/numpy/lib/tests/test_format.py b/numpy/lib/tests/test_format.py
index 2d2b4ce..04e090c 100644
--- a/numpy/lib/tests/test_format.py
+++ b/numpy/lib/tests/test_format.py
@@ -426,7 +426,7 @@ def roundtrip(arr):
f = BytesIO()
format.write_array(f, arr)
f2 = BytesIO(f.getvalue())
- arr2 = format.read_array(f2)
+ arr2 = format.read_array(f2, allow_pickle=True)
return arr2
@@ -553,7 +553,7 @@ def test_pickle_python2_python3():
path = os.path.join(data_dir, fname)
for encoding in ['bytes', 'latin1']:
- data_f = np.load(path, encoding=encoding)
+ data_f = np.load(path, allow_pickle=True, encoding=encoding)
if fname.endswith('.npz'):
data = data_f['x']
data_f.close()
@@ -575,16 +575,19 @@ def test_pickle_python2_python3():
if sys.version_info[0] >= 3:
if fname.startswith('py2'):
if fname.endswith('.npz'):
- data = np.load(path)
+ data = np.load(path, allow_pickle=True)
assert_raises(UnicodeError, data.__getitem__, 'x')
data.close()
- data = np.load(path, fix_imports=False, encoding='latin1')
+ data = np.load(path, allow_pickle=True, fix_imports=False,
+ encoding='latin1')
assert_raises(ImportError, data.__getitem__, 'x')
data.close()
else:
- assert_raises(UnicodeError, np.load, path)
+ assert_raises(UnicodeError, np.load, path,
+ allow_pickle=True)
assert_raises(ImportError, np.load, path,
- encoding='latin1', fix_imports=False)
+ allow_pickle=True, fix_imports=False,
+ encoding='latin1')
def test_pickle_disallow():
diff --git a/numpy/lib/tests/test_io.py b/numpy/lib/tests/test_io.py
index 2daa015..bde2567 100644
--- a/numpy/lib/tests/test_io.py
+++ b/numpy/lib/tests/test_io.py
@@ -87,7 +87,7 @@ class RoundtripTest(object):
"""
save_kwds = kwargs.get('save_kwds', {})
- load_kwds = kwargs.get('load_kwds', {})
+ load_kwds = kwargs.get('load_kwds', {"allow_pickle": True})
file_on_disk = kwargs.get('file_on_disk', False)
if file_on_disk:
--
2.21.0

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,135 @@
From f73d993bcb03701f4e9146005a65eb482689140a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nikola=20Forr=C3=B3?= <nforro@redhat.com>
Date: Mon, 26 Oct 2020 18:54:22 +0100
Subject: [PATCH] TST: Make test suite work in FIPS (140-2) Mode
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Tests using MD5 algorithms fail in FIPS Mode because MD5 is not FIPS
compliant.
Mark usages of MD5 in test suite as not being used for security
purposes to overcome that.
Signed-off-by: Nikola Forró <nforro@redhat.com>
---
numpy/core/tests/test_regression.py | 2 +-
numpy/random/tests/test_generator_mt19937.py | 10 +++++-----
numpy/random/tests/test_random.py | 4 ++--
numpy/random/tests/test_randomstate.py | 6 +++---
4 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/numpy/core/tests/test_regression.py b/numpy/core/tests/test_regression.py
index 2e731d4fa..4633174d9 100644
--- a/numpy/core/tests/test_regression.py
+++ b/numpy/core/tests/test_regression.py
@@ -1509,7 +1509,7 @@ class TestRegression:
from hashlib import md5
x = np.array([1, 2, 3], dtype=np.dtype('<i4'))
- assert_equal(md5(x).hexdigest(), '2a1dd1e1e59d0a384c26951e316cd7e6')
+ assert_equal(md5(x, usedforsecurity=False).hexdigest(), '2a1dd1e1e59d0a384c26951e316cd7e6')
def test_0d_string_scalar(self):
# Bug #1436; the following should succeed
diff --git a/numpy/random/tests/test_generator_mt19937.py b/numpy/random/tests/test_generator_mt19937.py
index 6be7d852b..9b166e3a2 100644
--- a/numpy/random/tests/test_generator_mt19937.py
+++ b/numpy/random/tests/test_generator_mt19937.py
@@ -507,14 +507,14 @@ class TestIntegers:
val = random.integers(0, 6 - endpoint, size=1000, endpoint=endpoint,
dtype=dt).byteswap()
- res = hashlib.md5(val).hexdigest()
+ res = hashlib.md5(val, usedforsecurity=False).hexdigest()
assert_(tgt[np.dtype(dt).name] == res)
# bools do not depend on endianness
random = Generator(MT19937(1234))
val = random.integers(0, 2 - endpoint, size=1000, endpoint=endpoint,
dtype=bool).view(np.int8)
- res = hashlib.md5(val).hexdigest()
+ res = hashlib.md5(val, usedforsecurity=False).hexdigest()
assert_(tgt[np.dtype(bool).name] == res)
def test_repeatability_broadcasting(self, endpoint):
@@ -910,7 +910,7 @@ class TestRandomDist:
actual = random.choice(10000, 5000, replace=False)
if sys.byteorder != 'little':
actual = actual.byteswap()
- res = hashlib.md5(actual.view(np.int8)).hexdigest()
+ res = hashlib.md5(actual.view(np.int8), usedforsecurity=False).hexdigest()
assert_(choice_hash == res)
def test_bytes(self):
@@ -2436,7 +2436,7 @@ def test_jumped(config):
key = mt19937.state["state"]["key"]
if sys.byteorder == 'big':
key = key.byteswap()
- md5 = hashlib.md5(key)
+ md5 = hashlib.md5(key, usedforsecurity=False)
assert mt19937.state["state"]["pos"] == config["initial"]["pos"]
assert md5.hexdigest() == config["initial"]["key_md5"]
@@ -2444,7 +2444,7 @@ def test_jumped(config):
key = jumped.state["state"]["key"]
if sys.byteorder == 'big':
key = key.byteswap()
- md5 = hashlib.md5(key)
+ md5 = hashlib.md5(key, usedforsecurity=False)
assert jumped.state["state"]["pos"] == config["jumped"]["pos"]
assert md5.hexdigest() == config["jumped"]["key_md5"]
diff --git a/numpy/random/tests/test_random.py b/numpy/random/tests/test_random.py
index 276b5bc81..e49251af3 100644
--- a/numpy/random/tests/test_random.py
+++ b/numpy/random/tests/test_random.py
@@ -233,13 +233,13 @@ class TestRandint:
else:
val = self.rfunc(0, 6, size=1000, dtype=dt).byteswap()
- res = hashlib.md5(val.view(np.int8)).hexdigest()
+ res = hashlib.md5(val.view(np.int8), usedforsecurity=False).hexdigest()
assert_(tgt[np.dtype(dt).name] == res)
# bools do not depend on endianness
np.random.seed(1234)
val = self.rfunc(0, 2, size=1000, dtype=bool).view(np.int8)
- res = hashlib.md5(val).hexdigest()
+ res = hashlib.md5(val, usedforsecurity=False).hexdigest()
assert_(tgt[np.dtype(bool).name] == res)
def test_int64_uint64_corner_case(self):
diff --git a/numpy/random/tests/test_randomstate.py b/numpy/random/tests/test_randomstate.py
index 23dbbed6a..aa53d9322 100644
--- a/numpy/random/tests/test_randomstate.py
+++ b/numpy/random/tests/test_randomstate.py
@@ -341,13 +341,13 @@ class TestRandint:
else:
val = self.rfunc(0, 6, size=1000, dtype=dt).byteswap()
- res = hashlib.md5(val.view(np.int8)).hexdigest()
+ res = hashlib.md5(val.view(np.int8), usedforsecurity=False).hexdigest()
assert_(tgt[np.dtype(dt).name] == res)
# bools do not depend on endianness
random.seed(1234)
val = self.rfunc(0, 2, size=1000, dtype=bool).view(np.int8)
- res = hashlib.md5(val).hexdigest()
+ res = hashlib.md5(val, usedforsecurity=False).hexdigest()
assert_(tgt[np.dtype(bool).name] == res)
@pytest.mark.skipif(np.iinfo('l').max < 2**32,
@@ -1987,7 +1987,7 @@ def test_integer_repeat(int_func):
val = f(*args, size=1000000)
if sys.byteorder != 'little':
val = val.byteswap()
- res = hashlib.md5(val.view(np.int8)).hexdigest()
+ res = hashlib.md5(val.view(np.int8), usedforsecurity=False).hexdigest()
assert_(res == md5)
--
2.26.2

View File

@ -1,39 +1,28 @@
%if 0%{?fedora} || 0%{?rhel} > 7 # RHEL8: Tests disabled due to missing dependencies
%bcond_without python3 %bcond_with tests
%else
%bcond_with python3
%{!?python2_sitearch: %global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
%endif
#uncomment next line for a release candidate or a beta %global blaslib openblas
#%%global relc rc1 %global blasvar p
%global modname numpy %global modname numpy
Name: numpy Name: numpy
Version: 1.14.2 Version: 1.19.4
Release: 16%{?dist} Release: 3%{?dist}
Epoch: 1
Summary: A fast multidimensional array facility for Python Summary: A fast multidimensional array facility for Python
Group: Development/Languages
# Everything is BSD except for class SafeEval in numpy/lib/utils.py which is Python # Everything is BSD except for class SafeEval in numpy/lib/utils.py which is Python
License: BSD and Python License: BSD and Python and ASL 2.0
URL: http://www.numpy.org/ URL: http://www.numpy.org/
Source0: https://github.com/%{name}/%{name}/releases/download/v%{version}/%{name}-%{version}.tar.gz Source0: https://github.com/%{name}/%{name}/releases/download/v%{version}/%{name}-%{version}.tar.gz
Source1: https://docs.scipy.org/doc/numpy/numpy-html-1.13.0.zip Source1: https://numpy.org/doc/1.19/numpy-html.zip
Patch0: numpy-1.14.2-float128.patch
Patch1: numpy-1.14.2-CVE-2019-6446.patch
BuildRequires: python2-devel lapack-devel python2-setuptools gcc-gfortran python2-nose Patch0: numpy-1.19.2-FIPS.patch
BuildRequires: /usr/bin/sed
BuildRequires: python2-Cython
%ifarch %{openblas_arches}
BuildRequires: openblas-devel
%else
BuildRequires: atlas-devel
%endif
# Exclude i686 arch. Due to a modularity issue it's being added to the
# x86_64 compose of CRB, but we don't want to ship it at all.
# See: https://projects.engineering.redhat.com/browse/RCM-72605
ExcludeArch: i686
%description %description
NumPy is a general-purpose array-processing package designed to NumPy is a general-purpose array-processing package designed to
@ -48,57 +37,28 @@ basic linear algebra and random number generation. Also included in
this package is a version of f2py that works properly with NumPy. this package is a version of f2py that works properly with NumPy.
%package -n python2-numpy %package -n python%{python3_pkgversion}-numpy
Summary: A fast multidimensional array facility for Python
Requires: python2-nose
%{?python_provide:%python_provide python2-%{modname}}
Obsoletes: numpy < 1:1.10.1-3
%description -n python2-numpy
NumPy is a general-purpose array-processing package designed to
efficiently manipulate large multi-dimensional arrays of arbitrary
records without sacrificing too much speed for small multi-dimensional
arrays. NumPy is built on the Numeric code base and adds features
introduced by numarray as well as an extended C-API and the ability to
create arrays of arbitrary type.
There are also basic facilities for discrete fourier transform,
basic linear algebra and random number generation. Also included in
this package is a version of f2py that works properly with NumPy.
%package -n python2-numpy-f2py
Summary: f2py for numpy
Group: Development/Libraries
Requires: python2-%{name} = %{epoch}:%{version}-%{release}
Requires: python2-devel
Obsoletes: numpy-f2py < 1:1.10.1-3
%{?python_provide:%python_provide python2-numpy-f2py}
%description -n python2-numpy-f2py
This package includes a version of f2py that works properly with NumPy.
%package -n python2-numpy-doc
Summary: Documentation for numpy
Requires: python2-%{name} = %{epoch}:%{version}-%{release}
BuildArch: noarch
%description -n python2-numpy-doc
This package provides the complete documentation for NumPy.
%if %{with python3}
%package -n python3-numpy
Summary: A fast multidimensional array facility for Python Summary: A fast multidimensional array facility for Python
Group: Development/Languages
License: BSD License: BSD
%{?python_provide:%python_provide python3-numpy} %{?python_provide:%python_provide python%{python3_pkgversion}-numpy}
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-nose
%description -n python3-numpy BuildRequires: python%{python3_pkgversion}-devel
BuildRequires: python%{python3_pkgversion}-rpm-macros
BuildRequires: python%{python3_pkgversion}-setuptools
BuildRequires: python%{python3_pkgversion}-Cython
BuildRequires: gcc-gfortran gcc
BuildRequires: lapack-devel
%if %{with tests}
BuildRequires: python%{python3_pkgversion}-pytest
BuildRequires: python%{python3_pkgversion}-test
BuildRequires: python%{python3_pkgversion}-hypothesis
%endif
BuildRequires: %{blaslib}-devel
Requires: python%{python3_pkgversion}-setuptools
%description -n python%{python3_pkgversion}-numpy
NumPy is a general-purpose array-processing package designed to NumPy is a general-purpose array-processing package designed to
efficiently manipulate large multi-dimensional arrays of arbitrary efficiently manipulate large multi-dimensional arrays of arbitrary
records without sacrificing too much speed for small multi-dimensional records without sacrificing too much speed for small multi-dimensional
@ -110,84 +70,53 @@ There are also basic facilities for discrete fourier transform,
basic linear algebra and random number generation. Also included in basic linear algebra and random number generation. Also included in
this package is a version of f2py that works properly with NumPy. this package is a version of f2py that works properly with NumPy.
%package -n python3-numpy-f2py %package -n python%{python3_pkgversion}-numpy-f2py
Summary: f2py for numpy Summary: f2py for numpy
Group: Development/Libraries Requires: python%{python3_pkgversion}-numpy%{?_isa} = %{version}-%{release}
Requires: python3-numpy = %{epoch}:%{version}-%{release} Requires: python%{python3_pkgversion}-devel
Requires: python3-devel Provides: python%{python3_pkgversion}-f2py = %{version}-%{release}
Provides: python3-f2py = %{version}-%{release} %{?python_provide:%python_provide python%{python3_pkgversion}-numpy-f2py}
Obsoletes: python3-f2py <= 2.45.241_1927
%{?python_provide:%python_provide python3-numpy-f2py}
%description -n python3-numpy-f2py # Require alternatives version that implements the --keep-foreign flag
Requires(postun): alternatives >= 1.19.1-1
# python39 installs the alternatives master symlink to which we attach a slave
Requires: python%{python3_pkgversion}
Requires(post): python%{python3_pkgversion}
Requires(postun): python%{python3_pkgversion}
%description -n python%{python3_pkgversion}-numpy-f2py
This package includes a version of f2py that works properly with NumPy. This package includes a version of f2py that works properly with NumPy.
%package -n python3-numpy-doc %package -n python%{python3_pkgversion}-numpy-doc
Summary: Documentation for numpy Summary: Documentation for numpy
Requires: python3-numpy = %{epoch}:%{version}-%{release} Requires: python%{python3_pkgversion}-numpy = %{version}-%{release}
BuildArch: noarch BuildArch: noarch
%description -n python3-numpy-doc %description -n python%{python3_pkgversion}-numpy-doc
This package provides the complete documentation for NumPy. This package provides the complete documentation for NumPy.
%endif # with python3
%prep %prep
%setup -q -n %{name}-%{version}%{?relc} %autosetup -n %{name}-%{version} -p1
#%setup -q -n numpy-cc2b04
%patch0 -p1
%patch1 -p1
# workaround for rhbz#849713 # Force re-cythonization (ifed for PKG-INFO presence in setup.py)
# http://mail.scipy.org/pipermail/numpy-discussion/2012-July/063530.html rm PKG-INFO
rm numpy/distutils/command/__init__.py && touch numpy/distutils/command/__init__.py
%ifarch %{openblas_arches} # openblas is provided by flexiblas by default; otherwise,
# Use openblas pthreads as recommended by upstream (see comment in site.cfg.example) # Use openblas pthreads as recommended by upstream (see comment in site.cfg.example)
cat >> site.cfg <<EOF cat >> site.cfg <<EOF
[openblas] [openblas]
libraries = %{blaslib}%{blasvar}
library_dirs = %{_libdir} library_dirs = %{_libdir}
openblas_libs = openblasp
EOF EOF
%else
# Atlas 3.10 library names
%if 0%{?fedora} >= 21 || 0%{?rhel} > 7
cat >> site.cfg <<EOF
[atlas]
library_dirs = %{_libdir}/atlas
atlas_libs = satlas
EOF
%endif
%endif
%if %{with python3}
rm -rf %{py3dir}
cp -a . %{py3dir}
%endif
%build %build
%set_build_flags %set_build_flags
%if %{with python3}
pushd %{py3dir}
%ifarch %{openblas_arches}
env OPENBLAS=%{_libdir} \ env OPENBLAS=%{_libdir} \
%else
env ATLAS=%{_libdir} \
%endif
BLAS=%{_libdir} \ BLAS=%{_libdir} \
LAPACK=%{_libdir} CFLAGS="%{optflags}" \ LAPACK=%{_libdir} CFLAGS="%{optflags}" \
%{__python3} setup.py build %{__python3} setup.py build
popd
%endif # with _python3
%ifarch %{openblas_arches}
env OPENBLAS=%{_libdir} \
%else
env ATLAS=%{_libdir} \
%endif
BLAS=%{_libdir} \
LAPACK=%{_libdir} CFLAGS="%{optflags}" \
%{__python2} setup.py build
%install %install
mkdir docs mkdir docs
@ -195,123 +124,52 @@ pushd docs
unzip %{SOURCE1} unzip %{SOURCE1}
popd popd
# first install python3 so the binaries are overwritten by the python2 ones #%%{__python3} setup.py install -O1 --skip-build --root %%{buildroot}
%if %{with python3}
pushd %{py3dir}
#%%{__python2} setup.py install -O1 --skip-build --root %%{buildroot}
# skip-build currently broken, this works around it for now # skip-build currently broken, this works around it for now
%ifarch %{openblas_arches}
env OPENBLAS=%{_libdir} \ env OPENBLAS=%{_libdir} \
%else
env ATLAS=%{_libdir} \
%endif
FFTW=%{_libdir} BLAS=%{_libdir} \ FFTW=%{_libdir} BLAS=%{_libdir} \
LAPACK=%{_libdir} CFLAGS="%{optflags}" \ LAPACK=%{_libdir} CFLAGS="%{optflags}" \
%{__python3} setup.py install --root %{buildroot} %{__python3} setup.py install --root %{buildroot}
pushd %{buildroot}%{_bindir} &> /dev/null pushd %{buildroot}%{_bindir} &> /dev/null
# Remove unversioned binaries
# The custom install script gets the Python version from the executable name, rm f2py
# e.g. "python3" -> "3", but when built by "platform-python" it guesses the rm f2py3
# version as "rm-python". Renaming the file here is the easiest correction.
mv f2pyrm-python f2py3
popd &> /dev/null popd &> /dev/null
popd # All ghost files controlled by alternatives need to exist for the files
# section check to succeed
%endif # with python3 touch %{buildroot}%{_bindir}/f2py3
#%%{__python2} setup.py install -O1 --skip-build --root %%{buildroot}
# skip-build currently broken, this works around it for now
%ifarch %{openblas_arches}
env OPENBLAS=%{_libdir} \
%else
env ATLAS=%{_libdir} \
%endif
FFTW=%{_libdir} BLAS=%{_libdir} \
LAPACK=%{_libdir} CFLAGS="%{optflags}" \
%{__python2} setup.py install --root %{buildroot}
pushd %{buildroot}%{_bindir} &> /dev/null
# symlink for anyone who was using f2py.numpy
mv f2py{2,-%{python2_version}}
ln -s f2py-%{python2_version} f2py-2
ln -s f2py-%{python2_version} f2py2
popd &> /dev/null
#install -D -p -m 0644 docs/f2py/f2py.1 %{buildroot}%{_mandir}/man1/f2py.1
#symlink for includes, BZ 185079
mkdir -p %{buildroot}%{_includedir}
ln -s %{python2_sitearch}/%{name}/core/include/numpy/ %{buildroot}%{_includedir}/numpy
%check %check
# Having LDFLAGS set in the environment (for Flatpak builds, in particular), breaks %if %{with tests}
# f2py Makefiles which use that variable like: 'LDFLAGS = -s -shared' %ifarch ppc64le
unset LDFLAGS # https://github.com/numpy/numpy/issues/14357
pushd doc &> /dev/null %{__python3} runtests.py -v -- -k 'not test_einsum_sums_cfloat64'
PATH="%{buildroot}%{_bindir}:${PATH}" \ %else
PYTHONPATH="%{buildroot}%{python2_sitearch}" \ %{__python3} runtests.py -v
%{__python2} -c "import pkg_resources, numpy, sys ; sys.exit(0 if numpy.test(verbose=2).wasSuccessful() else 1)" \
%ifarch s390 s390x
|| :
%endif %endif
# don't remove this comment
popd &> /dev/null
%if %{with python3}
pushd doc &> /dev/null
PATH="%{buildroot}%{_bindir}:${PATH}" \
PYTHONPATH="%{buildroot}%{python3_sitearch}" \
%{__python3} -c "import pkg_resources, numpy, sys ; sys.exit(0 if numpy.test(verbose=2).wasSuccessful() else 1)" \
%ifarch s390 s390x
|| :
%endif %endif
# don't remove this comment
popd &> /dev/null
%endif # with python3
%files -n python2-numpy %post -n python%{python3_pkgversion}-numpy-f2py
alternatives --add-slave python3 %{_bindir}/python%{python3_version} \
%{_bindir}/f2py3 \
f2py3 \
%{_bindir}/f2py%{python3_version}
%postun -n python%{python3_pkgversion}-numpy-f2py
# Do this only during uninstall process (not during update)
if [ $1 -eq 0 ]; then
alternatives --keep-foreign --remove-slave python3 %{_bindir}/python%{python3_version} \
f2py3
fi
%files -n python%{python3_pkgversion}-numpy
%license LICENSE.txt %license LICENSE.txt
%doc THANKS.txt site.cfg.example %doc THANKS.txt site.cfg.example
%dir %{python2_sitearch}/%{name} %{python3_sitearch}/%{name}/__pycache__/
%{python2_sitearch}/%{name}/*.py*
%{python2_sitearch}/%{name}/core
%{python2_sitearch}/%{name}/distutils
%{python2_sitearch}/%{name}/doc
%{python2_sitearch}/%{name}/fft
%{python2_sitearch}/%{name}/lib
%{python2_sitearch}/%{name}/linalg
%{python2_sitearch}/%{name}/ma
%{python2_sitearch}/%{name}/random
%{python2_sitearch}/%{name}/testing
%{python2_sitearch}/%{name}/tests
%{python2_sitearch}/%{name}/compat
%{python2_sitearch}/%{name}/matrixlib
%{python2_sitearch}/%{name}/polynomial
%{python2_sitearch}/%{name}-*.egg-info
%{_includedir}/numpy
%exclude %{python2_sitearch}/%{name}/LICENSE.txt
%files -n python2-numpy-f2py
%doc docs/f2py/*.html
#%{_mandir}/man*/*
%{_bindir}/f2py2
%{_bindir}/f2py-2
%{_bindir}/f2py-%{python2_version}
%{python2_sitearch}/%{name}/f2py
%files -n python2-numpy-doc
%doc docs/*
%if %{with python3}
%files -n python3-numpy
%license LICENSE.txt
%doc THANKS.txt site.cfg.example
%{python3_sitearch}/%{name}/__pycache__
%dir %{python3_sitearch}/%{name} %dir %{python3_sitearch}/%{name}
%{python3_sitearch}/%{name}/*.py* %{python3_sitearch}/%{name}/*.py*
%{python3_sitearch}/%{name}/core %{python3_sitearch}/%{name}/core
@ -329,73 +187,159 @@ popd &> /dev/null
%{python3_sitearch}/%{name}/polynomial %{python3_sitearch}/%{name}/polynomial
%{python3_sitearch}/%{name}-*.egg-info %{python3_sitearch}/%{name}-*.egg-info
%exclude %{python3_sitearch}/%{name}/LICENSE.txt %exclude %{python3_sitearch}/%{name}/LICENSE.txt
%{python3_sitearch}/%{name}/__init__.pxd
%{python3_sitearch}/%{name}/__init__.cython-30.pxd
%files -n python3-numpy-f2py %files -n python%{python3_pkgversion}-numpy-f2py
%{_bindir}/f2py3 %{_bindir}/f2py%{python3_version}
%ghost %{_bindir}/f2py3
%{python3_sitearch}/%{name}/f2py %{python3_sitearch}/%{name}/f2py
%files -n python3-numpy-doc %files -n python%{python3_pkgversion}-numpy-doc
%doc docs/* %doc docs/*
%endif # with python3
%changelog %changelog
* Fri Jan 08 2021 Nikola Forró <nforro@redhat.com> - 1:1.14.2-16 * Thu Aug 05 2021 Tomas Orsava <torsava@redhat.com> - 1.19.4-3
- Fix include path - Adjusted the postun scriptlets to enable upgrading to RHEL 9
- Related: rhbz#1907601 - Resolves: rhbz#1933055
* Wed Dec 16 2020 Nikola Forró <nforro@redhat.com> - 1:1.14.2-15 * Mon Jan 18 2021 Tomas Orsava <torsava@redhat.com> - 1.19.4-2
- Fix %check - Convert from Fedora to the python39 module in RHEL8
- Related: rhbz#1907601 - Resolves: rhbz#1877430
* Tue Dec 15 2020 Nikola Forró <nforro@redhat.com> - 1:1.14.2-14 * Tue Nov 03 2020 Gwyn Ciesla <gwync@protonmail.com> - 1:1.19.4-1
- Use macros rather than hardcoded paths - 1.19.4
- Resolves: rhbz#1907601
* Wed Jun 05 2019 Nikola Forró <nforro@redhat.com> - 1:1.14.2-13 * Thu Oct 29 2020 Gwyn Ciesla <gwync@protonmail.com> - 1:1.19.3-1
- Fix CVE-2019-6446 - 1.19.3
- Resolves: rhbz#1668829
* Thu May 30 2019 Charalampos Stratakis <cstratak@redhat.com> - 1.14.2-12 * Tue Oct 27 2020 Nikola Forró <nforro@redhat.com> - 1:1.19.2-2
- Set proper build flags for https://fedoraproject.org/wiki/Changes/Python_Extension_Flags - Make test suite work in FIPS (140-2) Mode
- Resolves: rhbz#1715036
* Thu May 30 2019 Nikola Forró <nforro@redhat.com> - 1.14.2-11 * Thu Sep 10 2020 Gwyn Ciesla <gwync@protonmail.com> - 1:1.19.2-1
- Fix broken float128 on all arches except x86_64 - 1.19.2
- Resolves: rhbz#1688709
* Thu Apr 25 2019 Tomas Orsava <torsava@redhat.com> - 1.14.2-10 * Sun Aug 16 2020 Iñaki Úcar <iucar@fedoraproject.org> - 1:1.19.1-3
- Bumping due to problems with modular RPM upgrade path - https://fedoraproject.org/wiki/Changes/FlexiBLAS_as_BLAS/LAPACK_manager
- Resolves: rhbz#1695587
* Tue Oct 09 2018 Lumír Balhar <lbalhar@redhat.com> - 1:1.14.2-9 * Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1:1.19.1-2
- Remove unversioned provides - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
- Resolves: rhbz#1628242
* Tue Oct 02 2018 Lumír Balhar <lbalhar@redhat.com> - 1:1.14.2-8 * Wed Jul 22 2020 Gwyn Ciesla <gwync@protonmail.com> - 1:1.19.1-1
- Fix unversioned requires/buildrequires - 1.19.1
- Resolves: rhbz#1628242
* Tue Aug 14 2018 Lumír Balhar <lbalhar@redhat.com> - 1:1.14.2-7 * Thu Jul 16 2020 Gwyn Ciesla <gwync@protonmail.com> - 1:1.19.0-2
- Bring symlink f2py2 back for symlink modules - Assume old-style numpy provides from python2-numpy
- Resolves: rhbz#1615727
* Wed Aug 08 2018 Lumír Balhar <lbalhar@redhat.com> - 1:1.14.2-6 * Mon Jun 22 2020 Gwyn Ciesla <gwync@protonmail.com> - 1:1.19.0-1
- Remove unversioned binaries from python2 subpackage - 1.19.0 final.
- Resolves: rhbz#1613343
* Tue Jul 31 2018 Lumír Balhar <lbalhar@redhat.com> - 1:1.14.2-5 * Mon Jun 01 2020 Gwyn Ciesla <gwync@protonmail.com> - 1:1.19.0-0.rc2
- Switch python3 coditions to bcond - 1.19.0 rc2
* Mon Jun 25 2018 Tomas Orsava <torsava@redhat.com> - 1:1.14.2-4 * Fri May 22 2020 Miro Hrončok <mhroncok@redhat.com> - 1:1.18.4-3
- Use python2 macros instead of unversioned python macros - Rebuilt for Python 3.9
* Sat Apr 28 2018 Tomas Orsava <torsava@redhat.com> - 1:1.14.2-3 * Fri May 08 2020 Gwyn Ciesla <gwync@protonmail.com> - 1:1.18.4-2
- Change the shebang of f2py to the versioned /usr/bin/python2 - Own __pycache__ dir, 1833392
* Fri Apr 27 2018 Tomas Orsava <torsava@redhat.com> - 1:1.14.2-2 * Sun May 03 2020 Gwyn Ciesla <gwync@protonmail.com> - 1:1.18.4-1
- Fix incorrect Python version guess when building on Platform-Python - 1.18.4
* Mon Apr 20 2020 Gwyn Ciesla <gwync@protonmail.com> - 1:1.18.3-1
- 1.18.3
* Wed Mar 18 2020 Gwyn Ciesla <gwync@protonmail.com> - 1:1.18.2-1
- 1.18.2
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1:1.18.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Mon Jan 06 2020 Gwyn Ciesla <gwync@protonmail.com> - 1:1.18.1-1
- 1.18.1
* Mon Dec 30 2019 Gwyn Ciesla <gwync@protonmail.com> - 1:1.18.0-1
- 1.18.0
* Mon Nov 11 2019 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 1:1.17.4-2
- Backport patch for s390x failures
- Enable non-broken tests on ppc64le
* Mon Nov 11 2019 Gwyn Ciesla <gwync@protonmail.com> - 1:1.17.4-1
- 1.17.4
* Fri Oct 18 2019 Gwyn Ciesla <gwync@protonmail.com> - 1:1.17.3-1
- 1.17.3
* Sat Sep 07 2019 Gwyn Ciesla <gwync@protonmail.com> - 1:1.17.2-1
- 1.17.2
* Thu Aug 29 2019 Gwyn Ciesla <gwync@protonmail.com> - 1:1.17.1-1
- 1.17.1
* Thu Aug 15 2019 Miro Hrončok <mhroncok@redhat.com> - 1:1.17.0-3
- Rebuilt for Python 3.8
* Thu Aug 01 2019 Miro Hrončok <mhroncok@redhat.com> - 1:1.17.0-2
- Reintroduce libnpymath.a (#1735674)
* Tue Jul 30 2019 Gwyn Ciesla <gwync@protonmail.com> 1:1.17.0-1
- 1.17.0, split out Python 2.
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1:1.16.4-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Thu Jun 20 2019 Kalev Lember <klember@redhat.com> - 1:1.16.4-2
- Avoid hardcoding /usr prefix
* Tue May 28 2019 Gwyn Ciesla <gwync@protonmail.com> - 1:1.16.4-1
- 1.16.4
* Thu May 16 2019 Orion Poplawski <orion@nwra.com> - 1:1.16.3-2
- Build only with openblasp (bugz#1709161)
* Mon Apr 22 2019 Gwyn Ciesla <gwync@protonmail.com> - 1:1.16.3-1
- 1.16.3.
* Tue Feb 26 2019 Gwyn Ciesla <gwync@protonmail.com> - 1:1.16.2-1
- 1.16.2.
* Fri Feb 01 2019 Gwyn Ciesla <limburgher@gmail.com> - 1:1.16.1-1
- 1.16.1.
* Tue Jan 22 2019 Gwyn Ciesla <limburgher@gmail.com> - 1:1.16.0-1
- 1.16.0.
* Wed Aug 29 2018 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 1:1.15.1-2
- Switch to pytest for running tests during check
- Stop ignoring failures when running tests
- Set PATH in check so that f2py tests work
- Update docs to match release
- Remove outdated workaround from rhbz#849713
* Wed Aug 22 2018 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 1:1.15.1-1
- Update to latest version
* Sat Aug 11 2018 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 1:1.15.0-2
- Fix broken build on s390x
- Remove bytecode produced by pytest
- Re-enable tests on s390x
* Tue Jul 24 2018 Gwyn Ciesla <limburgher@gmail.com> - 1:1.15.0-1
- 1.15.0
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1:1.14.5-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Fri Jun 15 2018 Miro Hrončok <mhroncok@redhat.com> - 1:1.14.5-2
- Rebuilt for Python 3.7
* Wed Jun 13 2018 Gwyn Ciesla <limburgher@gmail.com> - 1:1.14.5-1
- 1.14.5
* Tue May 01 2018 Gwyn Ciesla <limburgher@gmail.com> - 1:1.14.3-1
- 1.14.3
* Mon Mar 12 2018 Gwyn Ciesla <limburgher@gmail.com> - 1:1.14.2-1 * Mon Mar 12 2018 Gwyn Ciesla <limburgher@gmail.com> - 1:1.14.2-1
- 1.14.2 - 1.14.2