14
0

- Convert to libalternatives on SLE-16-based and newer systems only

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-hypothesis?expand=0&rev=214
This commit is contained in:
2025-08-21 08:33:41 +00:00
committed by Git OBS Bridge
parent a4b359b683
commit 6eb49ea2e1
2 changed files with 23 additions and 3 deletions

View File

@@ -1,3 +1,8 @@
-------------------------------------------------------------------
Thu Aug 21 08:32:53 UTC 2025 - Markéta Machová <mmachova@suse.com>
- Convert to libalternatives on SLE-16-based and newer systems only
------------------------------------------------------------------- -------------------------------------------------------------------
Thu Jul 10 13:17:31 UTC 2025 - Markéta Machová <mmachova@suse.com> Thu Jul 10 13:17:31 UTC 2025 - Markéta Machová <mmachova@suse.com>

View File

@@ -23,8 +23,12 @@
%else %else
%bcond_without complete_tests %bcond_without complete_tests
%endif %endif
%bcond_with ringdisabled %if 0%{?suse_version} > 1500
%bcond_without libalternatives %bcond_without libalternatives
%else
%bcond_with libalternatives
%endif
%bcond_with ringdisabled
%if "%{flavor}" == "test" %if "%{flavor}" == "test"
%define psuffix -test %define psuffix -test
%bcond_without test %bcond_without test
@@ -53,14 +57,19 @@ BuildRequires: %{python_module pip}
BuildRequires: %{python_module pytz} BuildRequires: %{python_module pytz}
BuildRequires: %{python_module setuptools} BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module wheel} BuildRequires: %{python_module wheel}
BuildRequires: alts
BuildRequires: fdupes BuildRequires: fdupes
BuildRequires: python-rpm-macros BuildRequires: python-rpm-macros
Requires: alts
Requires: python-attrs >= 19.2.0 Requires: python-attrs >= 19.2.0
Requires: (python-exceptiongroup >= 1.0.0 if python-base < 3.11) Requires: (python-exceptiongroup >= 1.0.0 if python-base < 3.11)
Requires: (python-sortedcontainers >= 2.1.0 with python-sortedcontainers < 3.0) Requires: (python-sortedcontainers >= 2.1.0 with python-sortedcontainers < 3.0)
BuildArch: noarch BuildArch: noarch
%if %{with libalternatives}
BuildRequires: alts
Requires: alts
%else
Requires(post): update-alternatives
Requires(postun): update-alternatives
%endif
# SECTION requires_extra # SECTION requires_extra
Recommends: (python-importlib_metadata >= 3.6 if python-base < 3.8) Recommends: (python-importlib_metadata >= 3.6 if python-base < 3.8)
# consuming packages need to declare these optional dependencies explicitly # consuming packages need to declare these optional dependencies explicitly
@@ -139,6 +148,12 @@ sed -i 's/assert (arr == 0.0)/assert np.asarray(arr == 0.0)/' tests/numpy/test_g
%python_clone -a %{buildroot}%{_bindir}/hypothesis %python_clone -a %{buildroot}%{_bindir}/hypothesis
%endif %endif
%post
%python_install_alternative hypothesis
%postun
%python_uninstall_alternative hypothesis
%pre %pre
%python_libalternatives_reset_alternative hypothesis %python_libalternatives_reset_alternative hypothesis