Accepting request 1046394 from home:bnavigator:branches:devel:languages:python:numeric

- Clean up the specfile
  * restore the multibuild
  * Patch allow-numpy-1.24.patch is the WIP gh#numba/numba#8620

OBS-URL: https://build.opensuse.org/request/show/1046394
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-numba?expand=0&rev=61
This commit is contained in:
Dirk Mueller 2023-01-03 07:39:21 +00:00 committed by Git OBS Bridge
parent 589481cec3
commit 1f5d040253
2 changed files with 18 additions and 10 deletions

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Mon Jan 2 21:27:24 UTC 2023 - Ben Greiner <code@bnavigator.de>
- Clean up the specfile
* restore the multibuild
* Patch allow-numpy-1.24.patch is the WIP gh#numba/numba#8620
-------------------------------------------------------------------
Sun Jan 1 11:41:11 UTC 2023 - Matej Cepl <mcepl@suse.com>

View File

@ -16,8 +16,8 @@
#
%{?!python_module:%define python_module() python3-%{**}}
%define skip_python2 1
%define skip_python311 1
%define plainpython python
# upper bound is exclusive: min-numpy_ver <= numpy < max_numpy_ver
%define min_numpy_ver 1.18
@ -36,18 +36,20 @@ Release: 0
Summary: NumPy-aware optimizing compiler for Python using LLVM
License: BSD-2-Clause
URL: https://numba.pydata.org/
# SourceRepository: https://github.com/numba/numba
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
# PATCH-FIX-UPSTREAM allow-numpy-1.24.patch bsc#[0-9]+ mcepl@suse.com
# PATCH-FIX-UPSTREAM allow-numpy-1.24.patch gh#numba/numba#8620
# Allow working with numpy 1.24 and higher
Patch5: allow-numpy-1.24.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 pip}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module wheel}
BuildRequires: fdupes
BuildRequires: gcc-c++
@ -118,10 +120,13 @@ rm numba/tests/test_typedlist.py
# sed -i -e '/check_testsuite_size/ s/5000/3000/' numba/tests/test_runtests.py
%build
%if !%{with test}
export CFLAGS="%{optflags} -fPIC"
%pyproject_wheel
%endif
%install
%if !%{with test}
%pyproject_install
%{python_expand #
%fdupes %{buildroot}%{$python_sitearch}
@ -129,9 +134,9 @@ find %{buildroot}%{$python_sitearch} -name '*.[ch]' > devel-files0-%{$python_bin
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}
@ -139,16 +144,12 @@ sed 's|^%{buildroot}|%%exclude |' devel-files0-%{$python_bin_suffix}.files > dev
mkdir emptytestdir
pushd emptytestdir
%{python_expand # numbatests: check specific tests with `osc build -M test --define="numbatests <testnames>"`
# %%{_bindir}/numba-%%{$python_bin_suffix} -s
export PYTHONPATH=%{buildroot}%{$python_sitearch}
$python ../runtests.py -v -b --exclude-tags=long_running -m %%{_smp_build_ncpus} -- %%{?!numbatests:numba.tests}%%{?numbatests}
# $python -m numba.runtests -v -b --exclude-tags='long_running' -m %%{_smp_build_ncpus} -- %%{?!numbatests:numba.tests}%%{?numbatests}
%{_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
%clean
%if !%{with test}
%post
%python_install_alternative numba pycc
@ -162,7 +163,7 @@ popd
%python_alternative %{_bindir}/numba
%python_alternative %{_bindir}/pycc
%{python_sitearch}/numba/
%{python_sitearch}/numba-%{version}*-info
%{python_sitearch}/numba-%{version}.dist-info
%files %{python_files devel} -f devel-files-%{python_bin_suffix}.files
%license LICENSE