2014-07-17 15:31:35 +00:00
#
# spec file for package python-numexpr
#
2024-02-06 09:33:30 +00:00
# Copyright (c) 2024 SUSE LLC
2014-07-17 15:31:35 +00:00
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
2015-05-15 05:43:52 +00:00
2018-12-23 04:00:53 +00:00
# Please submit bugfixes or comments via https://bugs.opensuse.org/
2014-07-17 15:31:35 +00:00
#
2015-05-15 05:43:52 +00:00
2023-12-18 09:24:49 +00:00
%{?sle15_python_module_pythons}
2016-02-03 09:19:43 +00:00
Name : python-numexpr
2024-04-19 22:24:54 +00:00
Version : 2.10.0
2014-07-17 15:31:35 +00:00
Release : 0
2017-10-05 09:58:44 +00:00
Summary : Numerical expression evaluator for NumPy
2014-07-17 15:31:35 +00:00
License : MIT
Group : Development/Languages/Python
2018-09-03 09:06:05 +00:00
URL : https://github.com/pydata/numexpr/
2017-05-03 13:55:01 +00:00
Source : https://files.pythonhosted.org/packages/source/n/numexpr/numexpr-%{version} .tar.gz
2024-04-23 14:04:37 +00:00
# PATCH-FIX-UPSTREAM revert of https://github.com/pydata/numexpr/commit/beedecb3990d604d0f272c1a2f9a1d117f6120ba to enable numpy v1 again, drop when numpy is updated to v2
Patch0 : revert-to-numpy1.patch
2022-07-18 09:52:07 +00:00
BuildRequires : %{python_module devel >= 3.7}
2024-04-19 22:24:54 +00:00
# Until numpy 2 is in Factory, keep allowing to build with numpy 1.x. See comments in pyproject.toml for scipy and pandas
BuildRequires : %{python_module numpy-devel >= 1.19.3}
2023-09-05 08:00:57 +00:00
BuildRequires : %{python_module pip}
2024-02-06 09:35:09 +00:00
BuildRequires : %{python_module setuptools}
2023-09-05 08:00:57 +00:00
BuildRequires : %{python_module wheel}
2017-09-28 10:34:50 +00:00
BuildRequires : fdupes
BuildRequires : gcc-c++
BuildRequires : python-rpm-macros
2024-04-19 22:24:54 +00:00
Requires : python-numpy >= 1.19.3
2017-05-03 13:55:01 +00:00
%python_subpackages
2014-07-17 15:31:35 +00:00
%description
2017-10-05 09:58:44 +00:00
Numexpr is a numerical expression evaluator for NumPy. It is a C++
module. With it, expressions that operate on arrays (like " 3 * a + 4 * b " )
can be accelerated and use less memory than doing the same
calculation in Python.
2014-07-17 15:31:35 +00:00
%prep
2024-04-23 14:04:37 +00:00
%autosetup -p1 -n numexpr-%{version}
2018-12-23 04:00:53 +00:00
# wrong-file-end-of-line-encoding
sed -i 's/\r$//' ANNOUNCE.rst AUTHORS.txt README.rst RELEASE_NOTES.rst site.cfg.example
2015-05-15 05:43:52 +00:00
# remove unwanted shebang
sed -i '/^#!/ d' numexpr/cpuinfo.py
2014-07-17 15:31:35 +00:00
%build
2017-05-03 13:55:01 +00:00
export CFLAGS=" %{optflags} - f n o - s t r i c t - a l i a s i n g "
2023-09-05 08:00:57 +00:00
%pyproject_wheel
2014-07-17 15:31:35 +00:00
%install
2023-09-05 08:00:57 +00:00
%pyproject_install
2017-05-03 13:55:01 +00:00
%python_expand %fdupes %{buildroot} %{$python_sitearch}
2014-07-17 15:31:35 +00:00
2018-12-23 04:00:53 +00:00
%check
mkdir tester
pushd tester
%{python_expand export PYTHONPATH=%{buildroot} %{$python_sitearch}
$python -B -c " i m p o r t s y s ; i m p o r t n u m e x p r ; s y s . e x i t ( 0 i f n u m e x p r . t e s t ( ) . w a s S u c c e s s f u l ( ) e l s e 1 ) "
}
popd
2017-05-03 13:55:01 +00:00
%files %{python_files}
2018-08-07 07:44:18 +00:00
%doc ANNOUNCE.rst AUTHORS.txt README.rst RELEASE_NOTES.rst site.cfg.example
%license LICENSE.txt
2023-09-05 08:00:57 +00:00
%{python_sitearch} /numexpr
%{python_sitearch} /numexpr-%{version} .dist-info
2014-07-17 15:31:35 +00:00
%changelog