From 85b90c604339ecf169277dcda20aecaf5cf4a524a4855d0efd1b015b14550aea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mark=C3=A9ta=20Machov=C3=A1?= Date: Thu, 21 Aug 2025 10:03:07 +0000 Subject: [PATCH] - Convert to libalternatives on SLE-16-based and newer systems only OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-nose2?expand=0&rev=36 --- python-nose2.changes | 5 +++++ python-nose2.spec | 23 +++++++++++++++++++---- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/python-nose2.changes b/python-nose2.changes index 00119f9..3d40f49 100644 --- a/python-nose2.changes +++ b/python-nose2.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Aug 21 10:02:03 UTC 2025 - Markéta Machová + +- Convert to libalternatives on SLE-16-based and newer systems only + ------------------------------------------------------------------- Wed Jul 16 13:04:55 UTC 2025 - Markéta Machová diff --git a/python-nose2.spec b/python-nose2.spec index 3390a84..a21a0e9 100644 --- a/python-nose2.spec +++ b/python-nose2.spec @@ -16,7 +16,11 @@ # +%if 0%{?suse_version} > 1500 %bcond_without libalternatives +%else +%bcond_with libalternatives +%endif %{?sle15_python_module_pythons} Name: python-nose2 Version: 0.15.1 @@ -26,18 +30,23 @@ License: BSD-2-Clause AND Python-2.0 URL: https://github.com/nose-devs/nose2 Source: https://files.pythonhosted.org/packages/source/n/nose2/nose2-%{version}.tar.gz # Required for testsuite. Bring on python-wheel-wheel -Source1: https://files.pythonhosted.org/packages/c7/c3/55076fc728723ef927521abaa1955213d094933dc36d4a2008d5101e1af5/wheel-0.42.0-py3-none-any.whl +Source1: https://files.pythonhosted.org/packages/c7/w/wheel/wheel-0.42.0-py3-none-any.whl BuildRequires: %{python_module coverage} BuildRequires: %{python_module pip} BuildRequires: %{python_module setuptools-wheel} BuildRequires: %{python_module setuptools} BuildRequires: %{python_module wheel} -BuildRequires: alts BuildRequires: fdupes BuildRequires: python-rpm-macros -Requires: alts Suggests: python-coverage BuildArch: noarch +%if %{with libalternatives} +BuildRequires: alts +Requires: alts +%else +Requires(post): update-alternatives +Requires(postun): update-alternatives +%endif %python_subpackages %description @@ -64,11 +73,17 @@ export LC_CTYPE=C.UTF8 %{python_expand # nose must test itself in an editable install $python -m venv editable-%{$python_bin_suffix} --system-site-packages . editable-%{$python_bin_suffix}/bin/activate -pip install --no-index --find-links /usr/lib/python%{$python_bin_suffix}/wheels --find-links ../wheels -e . +pip install --no-index --find-links %{_prefix}/lib/python%{$python_bin_suffix}/wheels --find-links ../wheels -e . nose2 -v --pretty-assert deactivate } +%post +%python_install_alternative nose2 + +%postun +%python_uninstall_alternative nose2 + %pre %python_libalternatives_reset_alternative nose2