14
0
forked from pool/python-flake8

- 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
This commit is contained in:
2025-08-19 13:36:10 +00:00
committed by Git OBS Bridge
parent 8d5c16da25
commit eed053d537
2 changed files with 22 additions and 4 deletions

View File

@@ -1,3 +1,8 @@
-------------------------------------------------------------------
Tue Aug 19 13:33:42 UTC 2025 - Markéta Machová <mmachova@suse.com>
- Convert to libalternatives on SLE-16-based and newer systems only
-------------------------------------------------------------------
Sun Jul 13 12:32:48 UTC 2025 - Dirk Müller <dmueller@suse.com>

View File

@@ -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