From 9b2bb3f990b8c427d0ac2829017c92c30a3f311443f9076a3f32b4ddc41bf928 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mark=C3=A9ta=20Machov=C3=A1?= Date: Thu, 21 Aug 2025 10:16:01 +0000 Subject: [PATCH 1/2] - Convert to libalternatives on SLE-16-based and newer systems only OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pip-run?expand=0&rev=15 --- python-pip-run.changes | 5 +++++ python-pip-run.spec | 23 +++++++++++++++++++---- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/python-pip-run.changes b/python-pip-run.changes index caebb1d..a0fea38 100644 --- a/python-pip-run.changes +++ b/python-pip-run.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Aug 21 10:15:31 UTC 2025 - Markéta Machová + +- Convert to libalternatives on SLE-16-based and newer systems only + ------------------------------------------------------------------- Sat Jul 19 07:23:16 UTC 2025 - Markéta Machová diff --git a/python-pip-run.spec b/python-pip-run.spec index 40d1e2c..c999037 100644 --- a/python-pip-run.spec +++ b/python-pip-run.spec @@ -24,13 +24,17 @@ %define psuffix %{nil} %bcond_with test %endif -# Disables installing nbformat for tests in Ring1 (see also Patch1) -%bcond_with ringdisabled # Do not depend on nbformat for SLES or SLFO:Main %if ( 0%{?suse_version} == 1500 && 0%{?sle_version} >= 150400 ) || 0%{?suse_version} == 1600 %bcond_without ringdisabled %endif +%if 0%{?suse_version} > 1500 %bcond_without libalternatives +%else +%bcond_with libalternatives +%endif +# Disables installing nbformat for tests in Ring1 (see also Patch1) +%bcond_with ringdisabled %{?sle15_python_module_pythons} Name: python-pip-run%{psuffix} Version: 8.8.2 @@ -49,15 +53,20 @@ BuildRequires: %{python_module pip} BuildRequires: %{python_module setuptools >= 56} BuildRequires: %{python_module setuptools_scm >= 3.4.1} BuildRequires: %{python_module wheel} -BuildRequires: alts BuildRequires: fdupes BuildRequires: python-rpm-macros -Requires: alts Requires: python-autocommand Requires: python-packaging Requires: python-path >= 15.1 Requires: python-pip >= 19.3 BuildArch: noarch +%if %{with libalternatives} +BuildRequires: alts +Requires: alts +%else +Requires(post): update-alternatives +Requires(postun): update-alternatives +%endif %if 0%{?python_version_nodots} < 38 Requires: python-importlib-metadata %endif @@ -113,6 +122,12 @@ dont_test="" %pytest -k "$dont_test" %endif +%post +%python_install_alternative pip-run + +%postun +%python_uninstall_alternative pip-run + %pre %python_libalternatives_reset_alternative pip-run From 68b998f304288abbfd8b7324f2f28e3905f6fb401e2b20cf173b341762ae29ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mark=C3=A9ta=20Machov=C3=A1?= Date: Thu, 21 Aug 2025 10:18:02 +0000 Subject: [PATCH 2/2] fix spec-cleaner changes OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pip-run?expand=0&rev=16 --- python-pip-run.spec | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/python-pip-run.spec b/python-pip-run.spec index c999037..febfefd 100644 --- a/python-pip-run.spec +++ b/python-pip-run.spec @@ -24,6 +24,8 @@ %define psuffix %{nil} %bcond_with test %endif +# Disables installing nbformat for tests in Ring1 (see also Patch1) +%bcond_with ringdisabled # Do not depend on nbformat for SLES or SLFO:Main %if ( 0%{?suse_version} == 1500 && 0%{?sle_version} >= 150400 ) || 0%{?suse_version} == 1600 %bcond_without ringdisabled @@ -33,8 +35,6 @@ %else %bcond_with libalternatives %endif -# Disables installing nbformat for tests in Ring1 (see also Patch1) -%bcond_with ringdisabled %{?sle15_python_module_pythons} Name: python-pip-run%{psuffix} Version: 8.8.2 @@ -122,15 +122,15 @@ dont_test="" %pytest -k "$dont_test" %endif +%pre +%python_libalternatives_reset_alternative pip-run + %post %python_install_alternative pip-run %postun %python_uninstall_alternative pip-run -%pre -%python_libalternatives_reset_alternative pip-run - %if !%{with test} %files %{python_files} %license LICENSE