From 0fcf543fe6955355de3bc0281673c2cbc5d4a1050c76630a5f8f980c9a147c7d Mon Sep 17 00:00:00 2001 From: Daniel Garcia Moreno Date: Thu, 23 Oct 2025 11:43:59 +0200 Subject: [PATCH] Convert to libalternatives, bsc#1245883 --- python-isort.changes | 5 +++++ python-isort.spec | 23 ++++++++++------------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/python-isort.changes b/python-isort.changes index b154fd8..661385c 100644 --- a/python-isort.changes +++ b/python-isort.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Jul 10 13:23:44 UTC 2025 - Markéta Machová + +- Convert to libalternatives + ------------------------------------------------------------------- Fri May 2 08:59:30 UTC 2025 - John Paul Adrian Glaubitz diff --git a/python-isort.spec b/python-isort.spec index 73a9995..6c4c693 100644 --- a/python-isort.spec +++ b/python-isort.spec @@ -24,13 +24,12 @@ %define psuffix %{nil} %bcond_with test %endif - %if 0%{?suse_version} <= 1600 %bcond_with pylama %else %bcond_without pylama %endif - +%bcond_without libalternatives %{?sle15_python_module_pythons} Name: python-isort%{psuffix} Version: 6.0.1 @@ -40,15 +39,15 @@ License: MIT URL: https://pycqa.github.io/isort/ Source: https://files.pythonhosted.org/packages/source/i/isort/isort-%{version}.tar.gz # PATCH-FIX-UPSTREAM fix-typo.patch gh#PyCQA/isort/2392 -Patch: fix-typo.patch +Patch0: fix-typo.patch BuildRequires: %{python_module base >= 3.9} BuildRequires: %{python_module hatch-vcs} BuildRequires: %{python_module hatchling} BuildRequires: %{python_module pip} +BuildRequires: alts BuildRequires: fdupes BuildRequires: python-rpm-macros -Requires(post): update-alternatives -Requires(postun): update-alternatives +Requires: alts Recommends: python-colorama >= 0.4.3 Recommends: python-pip-api Recommends: python-pip-shims >= 0.5.2 @@ -65,13 +64,13 @@ BuildRequires: %{python_module libcst} BuildRequires: %{python_module natsort} BuildRequires: %{python_module pip-api} BuildRequires: %{python_module pipreqs} -%if %{with pylama} -BuildRequires: %{python_module pylama} -%endif BuildRequires: %{python_module pytest > 6.0} BuildRequires: %{python_module pytest-mock} BuildRequires: %{python_module toml >= 0.10.2} BuildRequires: git-core +%if %{with pylama} +BuildRequires: %{python_module pylama} +%endif %endif %python_subpackages @@ -111,6 +110,7 @@ hypothesis.settings.register_profile( %pyproject_install %python_clone -a %{buildroot}%{_bindir}/isort %python_clone -a %{buildroot}%{_bindir}/isort-identify-imports +%python_group_libalternatives isort isort-identify-imports %python_expand %fdupes %{buildroot}%{$python_sitelib} %endif @@ -170,11 +170,8 @@ pytest-%{$python_bin_suffix} -v \ %endif %if !%{with test} -%post -%python_install_alternative isort isort-identify-imports - -%postun -%python_uninstall_alternative isort +%pre +%python_libalternatives_reset_alternative isort %files %{python_files} %doc README.md