2017-05-27 13:14:35 +02:00
|
|
|
#
|
|
|
|
# spec file for package python-numba
|
|
|
|
#
|
2020-02-21 13:35:24 +01:00
|
|
|
# Copyright (c) 2020 SUSE LLC
|
2017-05-27 13:14:35 +02: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.
|
|
|
|
|
2018-10-27 04:31:23 +02:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2017-05-27 13:14:35 +02:00
|
|
|
#
|
|
|
|
|
|
|
|
|
|
|
|
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
2020-02-21 13:35:24 +01:00
|
|
|
%define skip_python2 1
|
2020-04-06 10:03:09 +02:00
|
|
|
%global flavor @BUILD_FLAVOR@%{nil}
|
|
|
|
%if "%{flavor}" == "test"
|
|
|
|
%define psuffix -test
|
|
|
|
%bcond_without test
|
|
|
|
%else
|
|
|
|
%define psuffix %{nil}
|
|
|
|
%bcond_with test
|
|
|
|
%endif
|
|
|
|
Name: python-numba%{psuffix}
|
2020-02-21 13:35:24 +01:00
|
|
|
Version: 0.48.0
|
2017-05-27 13:14:35 +02:00
|
|
|
Release: 0
|
2018-10-27 04:31:23 +02:00
|
|
|
Summary: NumPy-aware optimizing compiler for Python using LLVM
|
2017-05-27 13:14:35 +02:00
|
|
|
License: BSD-2-Clause
|
2019-09-26 13:11:14 +02:00
|
|
|
URL: https://github.com/numba/numba
|
2017-05-27 13:14:35 +02:00
|
|
|
Source: https://files.pythonhosted.org/packages/source/n/numba/numba-%{version}.tar.gz
|
2019-03-20 11:23:52 +01:00
|
|
|
Patch0: skip-failing-tests.patch
|
2019-10-24 02:59:28 +02:00
|
|
|
# PATCH-FIX-UPSTREAM fix-max-name-size.patch -- fix for gh#numba/numba#3876 -- from gh#numba/numba#4373
|
|
|
|
Patch1: fix-max-name-size.patch
|
2020-04-06 10:03:09 +02:00
|
|
|
%if %{with test}
|
2019-10-24 02:59:28 +02:00
|
|
|
BuildRequires: %{python_module Jinja2}
|
2020-02-21 13:35:24 +01:00
|
|
|
BuildRequires: %{python_module PyYAML}
|
2019-10-24 02:59:28 +02:00
|
|
|
BuildRequires: %{python_module Pygments}
|
|
|
|
BuildRequires: %{python_module cffi}
|
2017-05-27 13:14:35 +02:00
|
|
|
BuildRequires: %{python_module devel}
|
2019-10-24 02:59:28 +02:00
|
|
|
BuildRequires: %{python_module ipython}
|
2020-02-21 13:35:24 +01:00
|
|
|
BuildRequires: %{python_module llvmlite >= 0.31}
|
2020-04-06 10:08:48 +02:00
|
|
|
BuildRequires: %{python_module numba >= %{version}}
|
2020-04-06 10:23:33 +02:00
|
|
|
BuildRequires: %{python_module numba-devel >= %{version}}
|
2020-02-21 13:35:24 +01:00
|
|
|
BuildRequires: %{python_module numpy-devel >= 1.11}
|
2018-05-29 10:29:51 +02:00
|
|
|
BuildRequires: %{python_module pytest}
|
|
|
|
BuildRequires: %{python_module scipy >= 0.16}
|
2020-02-21 13:35:24 +01:00
|
|
|
BuildRequires: %{python_module tbb}
|
2020-04-06 10:03:09 +02:00
|
|
|
%endif
|
|
|
|
BuildRequires: %{python_module devel}
|
|
|
|
BuildRequires: %{python_module numpy-devel >= 1.11}
|
|
|
|
BuildRequires: %{python_module setuptools}
|
2017-10-09 19:43:11 +02:00
|
|
|
BuildRequires: fdupes
|
|
|
|
BuildRequires: gcc-c++
|
|
|
|
BuildRequires: python-rpm-macros
|
2019-10-24 02:59:28 +02:00
|
|
|
BuildRequires: tbb-devel
|
2020-02-21 13:35:24 +01:00
|
|
|
Requires: python-llvmlite >= 0.31
|
|
|
|
Requires: python-numpy >= 1.15
|
2018-05-29 10:29:51 +02:00
|
|
|
Requires: python-scipy >= 0.16
|
2019-12-17 23:30:55 +01:00
|
|
|
Requires(post): update-alternatives
|
|
|
|
Requires(preun): update-alternatives
|
2019-10-24 02:59:28 +02:00
|
|
|
Recommends: python-Jinja2
|
|
|
|
Recommends: python-Pygments
|
|
|
|
Recommends: python-cffi
|
|
|
|
Recommends: python-tbb
|
2017-05-27 13:14:35 +02:00
|
|
|
%python_subpackages
|
|
|
|
|
|
|
|
%description
|
|
|
|
Numba is a NumPy-aware optimizing compiler for Python. It uses the
|
|
|
|
LLVM compiler infrastructure to compile Python syntax to
|
|
|
|
machine code.
|
|
|
|
|
|
|
|
It is aware of NumPy arrays as typed memory regions and so can speed-up
|
|
|
|
code using NumPy arrays. Other, less well-typed code will be translated
|
|
|
|
to Python C-API calls, effectively removing the "interpreter", but not removing
|
|
|
|
the dynamic indirection.
|
|
|
|
|
|
|
|
Numba is also not a tracing JIT. It *compiles* your code before it gets
|
|
|
|
run, either using run-time type information or type information you provide
|
|
|
|
in the decorator.
|
|
|
|
|
|
|
|
Numba is a mechanism for producing machine code from Python syntax and typed
|
|
|
|
data structures such as those that exist in NumPy.
|
|
|
|
|
2019-10-24 02:59:28 +02:00
|
|
|
%package devel
|
2017-05-27 13:14:35 +02:00
|
|
|
Summary: Development files for numba applications
|
|
|
|
Requires: %{name} = %{version}
|
|
|
|
Requires: python-devel
|
2020-02-21 13:35:24 +01:00
|
|
|
Requires: python-numpy-devel >= 1.11
|
2017-05-27 13:14:35 +02:00
|
|
|
|
2019-10-24 02:59:28 +02:00
|
|
|
%description devel
|
2017-05-27 13:14:35 +02:00
|
|
|
This package contains files for developing applications using numba.
|
|
|
|
|
|
|
|
%prep
|
|
|
|
%setup -q -n numba-%{version}
|
2019-03-20 11:23:52 +01:00
|
|
|
%autopatch -p1
|
2018-05-16 11:39:35 +02:00
|
|
|
sed -i '1{\@^#!%{_bindir}/env python@d}' numba/appdirs.py
|
2017-05-27 13:14:35 +02:00
|
|
|
|
2020-04-06 11:06:45 +02:00
|
|
|
# due to new numpy version tests now fail
|
|
|
|
# Remove this with version update! (>0.48.0)
|
|
|
|
# https://github.com/numba/numba/issues/5251
|
|
|
|
rm numba/tests/test_np_functions.py
|
|
|
|
rm numba/tests/test_ufuncs.py
|
|
|
|
rm numba/tests/test_array_manipulation.py
|
|
|
|
rm numba/tests/test_array_reductions.py
|
2020-04-06 11:35:56 +02:00
|
|
|
# https://github.com/numba/numba/issues/5179
|
|
|
|
rm numba/tests/test_hashing.py
|
2020-04-06 12:03:22 +02:00
|
|
|
# timeouts randomly in OBS
|
|
|
|
rm numba/tests/test_typedlist.py
|
2020-04-06 11:35:56 +02:00
|
|
|
# as we reduced the amount of tests:
|
|
|
|
sed -i -e 's:5000:3000:' numba/tests/test_runtests.py
|
2020-04-06 11:06:45 +02:00
|
|
|
|
2017-05-27 13:14:35 +02:00
|
|
|
%build
|
2019-10-24 02:59:28 +02:00
|
|
|
export CFLAGS="%{optflags} -fPIC"
|
2017-05-27 13:14:35 +02:00
|
|
|
%python_build
|
|
|
|
|
|
|
|
%install
|
2020-04-06 10:03:09 +02:00
|
|
|
%if !%{with test}
|
2017-05-27 13:14:35 +02:00
|
|
|
%python_install
|
|
|
|
%python_expand %fdupes %{buildroot}%{$python_sitearch}
|
|
|
|
|
|
|
|
%python_clone -a %{buildroot}%{_bindir}/numba
|
|
|
|
%python_clone -a %{buildroot}%{_bindir}/pycc
|
2020-04-06 10:03:09 +02:00
|
|
|
%endif
|
2017-05-27 13:14:35 +02:00
|
|
|
|
2018-05-29 10:29:51 +02:00
|
|
|
%check
|
2020-04-06 10:03:09 +02:00
|
|
|
%if %{with test}
|
2019-10-24 02:59:28 +02:00
|
|
|
mv numba numba_temp
|
|
|
|
export NUMBA_PARALLEL_DIAGNOSTICS=1
|
2020-04-06 10:08:48 +02:00
|
|
|
%{python_expand export PYTHONPATH=%{$python_sitearch}
|
|
|
|
%{_bindir}/numba-%{$python_bin_suffix} -s
|
2019-09-26 13:11:14 +02:00
|
|
|
$python -m numba.runtests -v -b --exclude-tags='long_running' -m %{_smp_build_ncpus} -- numba.tests
|
2019-03-20 11:23:52 +01:00
|
|
|
}
|
2019-10-24 02:59:28 +02:00
|
|
|
mv numba_temp numba
|
2020-04-06 10:03:09 +02:00
|
|
|
%endif
|
2018-05-29 10:29:51 +02:00
|
|
|
|
2020-04-06 10:03:09 +02:00
|
|
|
%if !%{with test}
|
2017-05-27 13:14:35 +02:00
|
|
|
%post
|
|
|
|
%{python_install_alternative numba pycc}
|
|
|
|
|
|
|
|
%preun
|
|
|
|
%python_uninstall_alternative numba
|
|
|
|
|
|
|
|
%files %{python_files}
|
2018-05-16 11:39:35 +02:00
|
|
|
%license LICENSE
|
|
|
|
%doc AUTHORS CHANGE_LOG README.rst
|
2017-05-27 13:14:35 +02:00
|
|
|
%python_alternative %{_bindir}/numba
|
|
|
|
%python_alternative %{_bindir}/pycc
|
|
|
|
%{python_sitearch}/numba/
|
|
|
|
%{python_sitearch}/numba-%{version}-py*.egg-info
|
|
|
|
%exclude %{python_sitearch}/numba/*.c
|
|
|
|
%exclude %{python_sitearch}/numba/*.h
|
|
|
|
%exclude %{python_sitearch}/numba/*/*.c
|
|
|
|
%exclude %{python_sitearch}/numba/*/*.h
|
|
|
|
|
|
|
|
%files %{python_files devel}
|
|
|
|
%{python_sitearch}/numba/*.c
|
|
|
|
%{python_sitearch}/numba/*.h
|
|
|
|
%{python_sitearch}/numba/*/*.c
|
|
|
|
%{python_sitearch}/numba/*/*.h
|
2020-04-06 10:03:09 +02:00
|
|
|
%endif
|
2017-05-27 13:14:35 +02:00
|
|
|
|
|
|
|
%changelog
|