This release continues to add new features, bug fixes and stability improvements to Numba. Please note that this will be the last release that has support for Python 3.7 as the next release series (Numba 0.57) will support Python 3.11! Also note that, this will be the last release to support linux-32 packages produced by the Numba team. - Remove fix-max-name-size.patch, it's included in the new version. - Add update-tbb-backend-calls-2021.6.patch to make it compatible with the latest tbb-devel version. - Add fix-cli-test.patch to disable one test that fails with OBS. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-numba?expand=0&rev=55
168 lines
5.9 KiB
RPMSpec
168 lines
5.9 KiB
RPMSpec
#
|
|
# spec file
|
|
#
|
|
# Copyright (c) 2022 SUSE LLC
|
|
#
|
|
# 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.
|
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
|
#
|
|
|
|
|
|
%{?!python_module:%define python_module() python3-%{**}}
|
|
%define skip_python2 1
|
|
%define plainpython python
|
|
# upper bound is exclusive: min-numpy_ver <= numpy < max_numpy_ver
|
|
%define min_numpy_ver 1.18
|
|
%define max_numpy_ver 1.23
|
|
%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}
|
|
Version: 0.56.2
|
|
Release: 0
|
|
Summary: NumPy-aware optimizing compiler for Python using LLVM
|
|
License: BSD-2-Clause
|
|
URL: https://numba.pydata.org/
|
|
Source: https://files.pythonhosted.org/packages/source/n/numba/numba-%{version}.tar.gz
|
|
# PATCH-FIX-OPENSUSE skip tests failing due to OBS specifics
|
|
Patch2: fix-cli-test.patch
|
|
Patch3: skip-failing-tests.patch
|
|
# PATCH-FIX-OPENSUSE update-tbb-backend-calls-2021.6.patch, based on gh#numba/numba#7608
|
|
Patch4: update-tbb-backend-calls-2021.6.patch
|
|
BuildRequires: %{python_module devel >= 3.7}
|
|
BuildRequires: %{python_module numpy-devel >= %{min_numpy_ver} with %python-numpy-devel < %{max_numpy_ver}}
|
|
BuildRequires: %{python_module setuptools}
|
|
BuildRequires: fdupes
|
|
BuildRequires: gcc-c++
|
|
BuildRequires: python-rpm-macros
|
|
BuildRequires: (tbb-devel >= 2021)
|
|
Requires: (python-llvmlite >= 0.39 with python-llvmlite < 0.40)
|
|
Requires: (python-numpy >= %{min_numpy_ver} with python-numpy < %{max_numpy_ver})
|
|
Requires(post): update-alternatives
|
|
Requires(postun):update-alternatives
|
|
Recommends: python-Jinja2
|
|
Recommends: python-Pygments
|
|
Recommends: python-cffi
|
|
Recommends: python-scipy > 1.0
|
|
Recommends: python-tbb
|
|
%if %{with test}
|
|
BuildRequires: %{python_module Jinja2}
|
|
BuildRequires: %{python_module PyYAML}
|
|
BuildRequires: %{python_module Pygments}
|
|
BuildRequires: %{python_module cffi}
|
|
BuildRequires: %{python_module ipython}
|
|
BuildRequires: %{python_module numba = %{version}}
|
|
BuildRequires: %{python_module numba-devel = %{version}}
|
|
BuildRequires: %{python_module pip}
|
|
BuildRequires: %{python_module psutil}
|
|
BuildRequires: %{python_module pytest}
|
|
BuildRequires: %{python_module scipy >= 1.0}
|
|
BuildRequires: %{python_module tbb}
|
|
%endif
|
|
# Tests fail on ppc64 big endian, not resolvable on s390x
|
|
# Supported Platforms: https://numba.pydata.org/numba-doc/dev/user/installing.html#compatibility
|
|
ExclusiveArch: x86_64 %ix86 ppc64le %arm aarch64
|
|
%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.
|
|
|
|
%package devel
|
|
Summary: Development files for numba applications
|
|
Requires: %{name} = %{version}
|
|
Requires: python-devel
|
|
Requires: %{plainpython}(abi) = %{python_version}
|
|
Requires: (python-numpy-devel >= %{min_numpy_ver} with python-numpy-devel < %{max_numpy_ver})
|
|
|
|
%description devel
|
|
This package contains files for developing applications using numba.
|
|
|
|
%prep
|
|
%autosetup -p1 -n numba-%{version}
|
|
sed -i -e '1{/env python/ d}' numba/misc/appdirs.py
|
|
|
|
# random timeouts in OBS
|
|
rm numba/tests/test_typedlist.py
|
|
# if we reduced the amount of tests too much:
|
|
# sed -i -e '/check_testsuite_size/ s/5000/3000/' numba/tests/test_runtests.py
|
|
|
|
%build
|
|
%if !%{with test}
|
|
export CFLAGS="%{optflags} -fPIC"
|
|
%python_build
|
|
%endif
|
|
|
|
%install
|
|
%if !%{with test}
|
|
%python_install
|
|
%{python_expand #
|
|
%fdupes %{buildroot}%{$python_sitearch}
|
|
find %{buildroot}%{$python_sitearch} -name '*.[ch]' > devel-files0-%{$python_bin_suffix}.files
|
|
sed 's|^%{buildroot}||' devel-files0-%{$python_bin_suffix}.files > devel-files-%{$python_bin_suffix}.files
|
|
sed 's|^%{buildroot}|%%exclude |' devel-files0-%{$python_bin_suffix}.files > devel-files-exclude-%{$python_bin_suffix}.files
|
|
}
|
|
|
|
%python_clone -a %{buildroot}%{_bindir}/numba
|
|
%python_clone -a %{buildroot}%{_bindir}/pycc
|
|
%endif
|
|
|
|
%check
|
|
%if %{with test}
|
|
# test the installed package, not the source without compiled modules
|
|
mkdir emtpytestdir
|
|
pushd emtpytestdir
|
|
%{python_expand # numbatests: check specific tests with `osc build -M test --define="numbatests <testnames>"`
|
|
%{_bindir}/numba-%{$python_bin_suffix} -s
|
|
$python -m numba.runtests -v -b --exclude-tags='long_running' -m %{_smp_build_ncpus} -- %{?!numbatests:numba.tests}%{?numbatests}
|
|
}
|
|
popd
|
|
%endif
|
|
|
|
%if !%{with test}
|
|
%post
|
|
%python_install_alternative numba pycc
|
|
|
|
%postun
|
|
%python_uninstall_alternative numba
|
|
|
|
%files %{python_files} -f devel-files-exclude-%{python_bin_suffix}.files
|
|
%license LICENSE
|
|
%doc CHANGE_LOG README.rst
|
|
%python_alternative %{_bindir}/numba
|
|
%python_alternative %{_bindir}/pycc
|
|
%{python_sitearch}/numba/
|
|
%{python_sitearch}/numba-%{version}-py*.egg-info
|
|
|
|
%files %{python_files devel} -f devel-files-%{python_bin_suffix}.files
|
|
%license LICENSE
|
|
%endif
|
|
|
|
%changelog
|