14
0
forked from pool/python-flit

- Convert to libalternatives on SLE-16-based and newer systems only

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-flit?expand=0&rev=31
This commit is contained in:
2025-08-19 14:02:55 +00:00
committed by Git OBS Bridge
parent e5ab954f18
commit c1b97aee0c
2 changed files with 23 additions and 3 deletions

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-flit
Version: 3.12.0
@@ -31,16 +35,21 @@ BuildRequires: %{python_module flit-core >= %{version}}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module requests}
BuildRequires: %{python_module tomli-w}
BuildRequires: alts
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires: alts
Requires: python-docutils
Requires: python-flit-core >= %{version}
Requires: python-pip
Requires: python-requests
Requires: python-tomli-w
BuildArch: noarch
%if %{with libalternatives}
BuildRequires: alts
Requires: alts
%else
Requires(post): update-alternatives
Requires(postun): update-alternatives
%endif
# SECTION test requirements
BuildRequires: %{python_module pytest >= 2.7.3}
BuildRequires: %{python_module responses}
@@ -64,7 +73,7 @@ Simplified packaging of Python modules
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%check
%{python_expand # create python name interpreter for test_find_python_excutable"
%{python_expand # create $python name interpreter for test_find_python_excutable"
mkdir build/testbin
ln -s %{_bindir}/$python build/testbin/python
}
@@ -74,6 +83,12 @@ export PATH=$PWD/build/testbin/:$PATH
# "The error you get on a train, going through Oregon, without wifi"
%pytest -k "not (test_invalid_classifier or InstallTests)"
%post
%python_install_alternative flit
%postun
%python_uninstall_alternative flit
%pre
%python_libalternatives_reset_alternative flit