[python-numexpr] Add python3-numexpr package
Zbigniew Jędrzejewski-Szmek
zbyszek at fedoraproject.org
Mon Sep 9 15:35:56 UTC 2013
commit fa34b4dba114f1a61ffeab6b512258957f3bb0ce
Author: Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl>
Date: Thu Sep 5 11:40:55 2013 -0400
Add python3-numexpr package
python-numexpr.spec | 70 +++++++++++++++++++++++++++++++++++++++++++++------
1 files changed, 62 insertions(+), 8 deletions(-)
---
diff --git a/python-numexpr.spec b/python-numexpr.spec
index 08cffcf..94db163 100644
--- a/python-numexpr.spec
+++ b/python-numexpr.spec
@@ -1,5 +1,8 @@
+%global with_python3 1
+
%{?filter_setup:
%filter_provides_in %{python_sitearch}/.*\.so$
+%filter_provides_in %{python3_sitearch}/.*\.so$
%filter_setup}
%global module numexpr
@@ -15,8 +18,12 @@ URL: http://numexpr.googlecode.com/
Requires: numpy >= 1.6
BuildRequires: numpy >= 1.6
-BuildRequires: python-devel
-
+BuildRequires: python2-devel
+%if 0%{?with_python3}
+Requires: python3-numpy >= 1.6
+BuildRequires: python3-devel
+BuildRequires: python3-numpy
+%endif # with_python3
%description
The numexpr package evaluates multiple-operator array expressions many
@@ -26,35 +33,82 @@ Python code on the fly. It's the next best thing to writing the
expression in C and compiling it with a specialized just-in-time (JIT)
compiler, i.e. it does not require a compiler at runtime.
+%if 0%{?with_python3}
+%package -n python3-%{module}
+Summary: Fast numerical array expression evaluator for Python and NumPy
+
+%description -n python3-%{module}
+The numexpr package evaluates multiple-operator array expressions many
+times faster than NumPy can. It accepts the expression as a string,
+analyzes it, rewrites it more efficiently, and compiles it to faster
+Python code on the fly. It's the next best thing to writing the
+expression in C and compiling it with a specialized just-in-time (JIT)
+compiler, i.e. it does not require a compiler at runtime.
+
+This is the version for Python 3.
+%endif # with_python3
+
+
%prep
%setup -q -n %{module}-%{version}
sed -i "s|/usr/bin/env |/usr/bin/|" %{module}/cpuinfo.py
+%if 0%{?with_python3}
+rm -rf %{py3dir}
+cp -a . %{py3dir}
+%endif # with_python3
+
%build
-python setup.py build
+python setup.py build
+%if 0%{?with_python3}
+pushd %{py3dir}
+python3 setup.py build
+popd
+%endif # with_python3
%check
libdir=`ls build/|grep lib`
-export PYTHONPATH=`pwd`/build/$libdir
-python bench/timing.py
+pushd "build/$libdir"
+python -c 'import numexpr; numexpr.test()'
+popd
-%install
-rm -rf %{buildroot}
+%if 0%{?with_python3}
+pushd %{py3dir}
+libdir=`ls build/|grep lib`
+cd "build/$libdir"
+python3 -c 'import numexpr; numexpr.test()'
+popd
+%endif # with_python3
-python setup.py install -O1 --skip-build --root=%{buildroot}
+%install
+python setup.py install -O1 --skip-build --root=%{buildroot}
#This could be done more properly ?
chmod 0644 %{buildroot}%{python_sitearch}/%{module}/cpuinfo.py
chmod 0755 %{buildroot}%{python_sitearch}/%{module}/*.so
+%if 0%{?with_python3}
+pushd %{py3dir}
+python3 setup.py install -O1 --skip-build --root=%{buildroot}
+popd
+%endif # with_python3
+
%files
%doc ANNOUNCE.txt LICENSE.txt RELEASE_NOTES.txt README.txt
%{python_sitearch}/numexpr/
%{python_sitearch}/numexpr-%{version}-py*.egg-info/
+%if 0%{?with_python3}
+%files -n python3-%{module}
+%doc ANNOUNCE.txt LICENSE.txt RELEASE_NOTES.txt README.txt
+%{python3_sitearch}/numexpr/
+%{python3_sitearch}/numexpr-%{version}-py*.egg-info
+%endif # with_python3
+
%changelog
* Thu Sep 05 2013 Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl> - 2.2-1
- Update to 2.2
+- Add python3-numexpr package
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 2.0.1-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
More information about the scm-commits
mailing list