Accepting request 920177 from devel:languages:python:pytest

revert

OBS-URL: https://build.opensuse.org/request/show/920177
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:pytest/python-pytest?expand=0&rev=94
This commit is contained in:
Matej Cepl 2021-09-19 17:46:29 +00:00 committed by Git OBS Bridge
parent 08828803dd
commit bcd15d03eb
2 changed files with 2 additions and 50 deletions

View File

@ -1,8 +1,3 @@
-------------------------------------------------------------------
Thu Sep 16 13:35:07 UTC 2021 - Stefan Schubert <schubi@schubi.de>
- Use libalternatives instead of update-alternatives.
-------------------------------------------------------------------
Tue Sep 14 09:22:10 UTC 2021 - Ondřej Súkup <mimi.vx@gmail.com>

View File

@ -16,12 +16,6 @@
#
%if 0%{?suse_version} > 1500
%bcond_without libalternatives
%else
%bcond_with libalternatives
%endif
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%global flavor @BUILD_FLAVOR@%{nil}
%if "%{flavor}" == "test"
@ -53,12 +47,8 @@ Requires: python-py >= 1.8.2
Requires: python-setuptools
Requires: python-toml
Requires: python-wcwidth
%if %{with libalternatives}
Requires: alts
%else
Requires(post): update-alternatives
Requires(postun):update-alternatives
%endif
Obsoletes: python-pytest-doc
BuildArch: noarch
%if %{with test}
@ -98,21 +88,8 @@ sed -i '/^\[metadata\]/ a version = %{version}' setup.cfg
%install
%if ! %{with test}
%python_install
%if ! %{with libalternatives}
%python_clone -a %{buildroot}%{_bindir}/pytest
%python_clone -a %{buildroot}%{_bindir}/py.test
%else
%python_clone %{buildroot}%{_bindir}/pytest
%python_clone %{buildroot}%{_bindir}/py.test
ln -sf %{_bindir}/alts %{buildroot}%{_bindir}/pytest
mkdir -p %{buildroot}%{_datadir}/libalternatives/pytest
%python_expand content="binary=%{_bindir}/pytest-%{$python_version}\\ngroup=pytest, py.test"
%python_expand echo -e $content > %{buildroot}%{_datadir}/libalternatives/pytest/10%{$python_version_nodots}.conf
ln -sf %{_bindir}/alts %{buildroot}%{_bindir}/py.test
mkdir -p %{buildroot}%{_datadir}/libalternatives/py.test
%python_expand content="binary=%{_bindir}/py.test-%{$python_version}\\ngroup=pytest, py.test"
%python_expand echo -e $content > %{buildroot}%{_datadir}/libalternatives/py.test/10%{$python_version_nodots}.conf
%endif
%python_clone -a %{buildroot}%{_bindir}/pytest
%python_clone -a %{buildroot}%{_bindir}/py.test
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%endif
@ -122,13 +99,6 @@ sed -i '/^\[metadata\]/ a version = %{version}' setup.cfg
%endif
%if ! %{with test}
%if %{with libalternatives}
%pre
# removing old update-alternatives entries
if [ "$1" -gt 0 ] && [ -f %{_sbindir}/update-alternatives ] ; then
%python_uninstall_alternative pytest py.test
fi
%else
%post
# py.test was the master until Oct 2020. boo#1178547
alternatives=$(update-alternatives --quiet --list py.test 2> /dev/null) && (
@ -147,25 +117,12 @@ alternatives=$(update-alternatives --quiet --list py.test 2> /dev/null) && (
%postun
%python_uninstall_alternative pytest
%endif
%files %{python_files}
%doc AUTHORS CHANGELOG.rst README.rst
%license LICENSE
%if ! 0%{with libalternatives}
%python_alternative %{_bindir}/pytest
%python_alternative %{_bindir}/py.test
%else
%dir %{_datadir}/libalternatives
%dir %{_datadir}/libalternatives/pytest
%{_datadir}/libalternatives/pytest/10%python_version_nodots.conf
%{_bindir}/pytest
%{_bindir}/pytest-%python_version
%dir %{_datadir}/libalternatives/py.test
%{_datadir}/libalternatives/py.test/10%python_version_nodots.conf
%{_bindir}/py.test
%{_bindir}/py.test-%python_version
%endif
%{python_sitelib}/_pytest
%{python_sitelib}/pytest
%{python_sitelib}/pytest-%{version}*-info