From 29978ca83d6d72a92abd6c99b4c8708174ba3e43d079b6a47ab59fa6b26cbef1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mark=C3=A9ta=20Machov=C3=A1?= Date: Thu, 14 Aug 2025 12:34:34 +0000 Subject: [PATCH] - Convert to libalternatives on SLE-16-based and newer systems OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-coverage?expand=0&rev=145 --- python-coverage.changes | 5 +++++ python-coverage.spec | 17 +++++++++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/python-coverage.changes b/python-coverage.changes index 4ea946c..c93f654 100644 --- a/python-coverage.changes +++ b/python-coverage.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Aug 14 12:33:02 UTC 2025 - Markéta Machová + +- Convert to libalternatives on SLE-16-based and newer systems + ------------------------------------------------------------------- Thu Jul 17 19:35:48 UTC 2025 - Dirk Müller diff --git a/python-coverage.spec b/python-coverage.spec index a25357f..95b6e56 100644 --- a/python-coverage.spec +++ b/python-coverage.spec @@ -16,6 +16,11 @@ # +%if 0%{?suse_version} > 1500 +%bcond_without libalternatives +%else +%bcond_with libalternatives +%endif %{?sle15_python_module_pythons} Name: python-coverage Version: 7.9.2 @@ -31,10 +36,15 @@ BuildRequires: %{python_module wheel} BuildRequires: fdupes BuildRequires: python-rpm-macros Requires: python -Requires(post): update-alternatives -Requires(postun): update-alternatives # coverage[toml] Recommends: python-tomli +%if %{with libalternatives} +BuildRequires: alts +Requires: alts +%else +Requires(post): update-alternatives +Requires(postun): update-alternatives +%endif # SECTION test requirements BuildRequires: %{python_module flaky} BuildRequires: %{python_module hypothesis >= 6} @@ -105,6 +115,9 @@ donttest+=" or test_report_wildcard or test_run_omit_vs_report_omit" %pytest_arch -n auto --no-flaky-report -k "$donttest" -rp ||: %pytest_arch -n auto --no-flaky-report -k "not ($donttest)" +%pre +%python_libalternatives_reset_alternative coverage + %post %python_install_alternative coverage