Accepting request 1202831 from devel:languages:python:numeric

OBS-URL: https://build.opensuse.org/request/show/1202831
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-quimb?expand=0&rev=10
This commit is contained in:
Ana Guerrero 2024-09-24 15:33:58 +00:00 committed by Git OBS Bridge
commit 0510d55fbe
3 changed files with 41 additions and 17 deletions

3
_multibuild Normal file
View File

@ -0,0 +1,3 @@
<multibuild>
<package>test</package>
</multibuild>

View File

@ -1,3 +1,12 @@
-------------------------------------------------------------------
Mon Sep 23 19:48:30 UTC 2024 - Ben Greiner <code@bnavigator.de>
- Switch to testing in multibuild: The obs runtime requirement
resolver deals with numba/numpy blockage more gracefully than
trying to resolve a BuildRequires on them. Numba 0.60 is
restricted to Numpy < 2.1 right now.
* Update requirements
------------------------------------------------------------------- -------------------------------------------------------------------
Sat Aug 31 11:54:18 UTC 2024 - Dirk Müller <dmueller@suse.com> Sat Aug 31 11:54:18 UTC 2024 - Dirk Müller <dmueller@suse.com>

View File

@ -16,7 +16,19 @@
# #
Name: python-quimb %global flavor @BUILD_FLAVOR@%{nil}
%if "%{flavor}" == ""
%define psuffix %{nil}
%bcond_with test
BuildArch: noarch
%else
%bcond_without test
%define psuffix -%{flavor}
# This package does not support 32 bit arch, s390x fails too
ExcludeArch: %{ix86} %{arm} ppc s390x
%endif
Name: python-quimb%{psuffix}
Version: 1.8.4 Version: 1.8.4
Release: 0 Release: 0
Summary: Python library for quantum information and many-body calculations Summary: Python library for quantum information and many-body calculations
@ -29,8 +41,8 @@ BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module wheel} BuildRequires: %{python_module wheel}
BuildRequires: fdupes BuildRequires: fdupes
BuildRequires: python-rpm-macros BuildRequires: python-rpm-macros
Requires: python-autoray >= 0.6.7 Requires: python-autoray >= 0.6.12
Requires: python-cotengra >= 0.5.6 Requires: python-cotengra >= 0.6.1
Requires: python-cytoolz >= 0.8.0 Requires: python-cytoolz >= 0.8.0
Requires: python-numba >= 0.39 Requires: python-numba >= 0.39
Requires: python-numpy >= 1.17 Requires: python-numpy >= 1.17
@ -41,30 +53,21 @@ Requires(post): update-alternatives
Requires(postun): update-alternatives Requires(postun): update-alternatives
Recommends: python-diskcache >= 3.0 Recommends: python-diskcache >= 3.0
Recommends: python-matplotlib >= 2 Recommends: python-matplotlib >= 2
Recommends: python-networkx Recommends: python-networkx >= 2.3
Suggests: python-mpi4py Suggests: python-mpi4py
Suggests: python-petsc4py Suggests: python-petsc4py
Suggests: python-randomgen >= 1.18
Suggests: python-slepc4py Suggests: python-slepc4py
# This package does not support 32 bit arch, s390x fails too %if %{with test}
ExcludeArch: %{ix86} %{arm} ppc s390x BuildRequires: %{python_module quimb = %{version}}
# SECTION test ##
BuildRequires: %{python_module autoray >= 0.6.7}
BuildRequires: %{python_module cotengra >= 0.5.6}
BuildRequires: %{python_module cytoolz >= 0.8.0}
BuildRequires: %{python_module diskcache >= 3.0} BuildRequires: %{python_module diskcache >= 3.0}
BuildRequires: %{python_module matplotlib >= 2} BuildRequires: %{python_module matplotlib >= 2}
BuildRequires: %{python_module networkx >= 2.3} BuildRequires: %{python_module networkx >= 2.3}
BuildRequires: %{python_module numba >= 0.39}
BuildRequires: %{python_module numpy >= 1.17}
BuildRequires: %{python_module psutil >= 4.3.1} BuildRequires: %{python_module psutil >= 4.3.1}
BuildRequires: %{python_module pytest-rerunfailures} BuildRequires: %{python_module pytest-rerunfailures}
BuildRequires: %{python_module pytest-xdist} BuildRequires: %{python_module pytest-xdist}
BuildRequires: %{python_module pytest} BuildRequires: %{python_module pytest}
BuildRequires: %{python_module scipy >= 1.0.0} %endif
BuildRequires: %{python_module tqdm >= 4}
# /SECTION
BuildArch: noarch
%python_subpackages %python_subpackages
%description %description
@ -77,13 +80,17 @@ many-body calculations, including with tensor networks.
sed -i '/addopts/d' pyproject.toml sed -i '/addopts/d' pyproject.toml
%build %build
%if !%{with test}
export SETUPTOOLS_SCM_PRETEND_VERSION=%{version} export SETUPTOOLS_SCM_PRETEND_VERSION=%{version}
%pyproject_wheel %pyproject_wheel
%endif
%install %install
%if !%{with test}
%pyproject_install %pyproject_install
%python_clone -a %{buildroot}%{_bindir}/quimb-mpi-python %python_clone -a %{buildroot}%{_bindir}/quimb-mpi-python
%python_expand %fdupes %{buildroot}%{$python_sitelib} %python_expand %fdupes %{buildroot}%{$python_sitelib}
%endif
%post %post
%python_install_alternative quimb-mpi-python %python_install_alternative quimb-mpi-python
@ -91,16 +98,21 @@ export SETUPTOOLS_SCM_PRETEND_VERSION=%{version}
%postun %postun
%python_uninstall_alternative quimb-mpi-python %python_uninstall_alternative quimb-mpi-python
%if %{with test}
%check %check
mv quimb quimb.movedsrc
# precision comparison slightly out of tolerance: this one is permament, others are flaky (rerun them) # precision comparison slightly out of tolerance: this one is permament, others are flaky (rerun them)
donttest="(test_subtract_update and float32)" donttest="(test_subtract_update and float32)"
%pytest -n auto --reruns 3 -k "not ($donttest)" %pytest -n auto --reruns 3 -k "not ($donttest)"
%endif
%if !%{with test}
%files %{python_files} %files %{python_files}
%doc README.md %doc README.md
%license LICENSE.txt %license LICENSE.txt
%python_alternative %{_bindir}/quimb-mpi-python %python_alternative %{_bindir}/quimb-mpi-python
%{python_sitelib}/quimb-%{version}.dist-info %{python_sitelib}/quimb-%{version}.dist-info
%{python_sitelib}/quimb %{python_sitelib}/quimb
%endif
%changelog %changelog