From eed053d537aadf08774f1af300b3ca33d986c54780c65e3a8f00d343113e1bed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mark=C3=A9ta=20Machov=C3=A1?= Date: Tue, 19 Aug 2025 13:36:10 +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-flake8?expand=0&rev=104 --- python-flake8.changes | 5 +++++ python-flake8.spec | 21 +++++++++++++++++---- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/python-flake8.changes b/python-flake8.changes index 3f5c2b3..aeacf8c 100644 --- a/python-flake8.changes +++ b/python-flake8.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Aug 19 13:33:42 UTC 2025 - Markéta Machová + +- Convert to libalternatives on SLE-16-based and newer systems only + ------------------------------------------------------------------- Sun Jul 13 12:32:48 UTC 2025 - Dirk Müller diff --git a/python-flake8.spec b/python-flake8.spec index 6630f24..f8d773e 100644 --- a/python-flake8.spec +++ b/python-flake8.spec @@ -16,7 +16,11 @@ # +%if 0%{?suse_version} > 1500 %bcond_without libalternatives +%else +%bcond_with libalternatives +%endif %{?sle15_python_module_pythons} Name: python-flake8 Version: 7.3.0 @@ -31,16 +35,19 @@ BuildRequires: %{python_module base >= 3.8} BuildRequires: %{python_module pip} BuildRequires: %{python_module setuptools} BuildRequires: %{python_module wheel} -%if %{with libalternatives} -BuildRequires: alts -Requires: alts -%endif BuildRequires: fdupes BuildRequires: python-rpm-macros # https://flake8.pycqa.org/en/latest/faq.html#why-does-flake8-use-ranges-for-its-dependencies Requires: (python-mccabe >= 0.7.0 with python-mccabe < 0.8.0) Requires: (python-pycodestyle >= 2.14.0 with python-pycodestyle < 2.15.0) Requires: (python-pyflakes >= 3.4.0 with python-pyflakes < 3.5.0) +%if %{with libalternatives} +BuildRequires: alts +Requires: alts +%else +Requires(post): update-alternatives +Requires(postun): update-alternatives +%endif BuildArch: noarch # SECTION test requirements BuildRequires: %{python_module mccabe >= 0.7.0 with %python-mccabe < 0.8.0} @@ -84,6 +91,12 @@ install -m 0755 -D %{SOURCE2} bin/gen-pycodestyle-plugin %pre %python_libalternatives_reset_alternative flake8 +%post +%python_install_alternative flake8 + +%postun +%python_uninstall_alternative flake8 + %check %pytest tests