From 1bc4995454b61573a6333376decb6e0b1918abdedb1dce0d79ad9c90651370c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Wed, 27 May 2020 13:10:48 +0000 Subject: [PATCH] Accepting request 809518 from home:pgajdos:python - %python3_only -> %python_alternative OBS-URL: https://build.opensuse.org/request/show/809518 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-geomet?expand=0&rev=4 --- python-geomet.changes | 5 +++++ python-geomet.spec | 18 ++++++++++++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/python-geomet.changes b/python-geomet.changes index f471b27..125ba8f 100644 --- a/python-geomet.changes +++ b/python-geomet.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue May 26 06:34:21 UTC 2020 - Petr Gajdos + +- %python3_only -> %python_alternative + ------------------------------------------------------------------- Mon Jan 20 08:14:34 UTC 2020 - Tomáš Chvátal diff --git a/python-geomet.spec b/python-geomet.spec index 8bcf409..40d8999 100644 --- a/python-geomet.spec +++ b/python-geomet.spec @@ -30,6 +30,8 @@ BuildRequires: fdupes BuildRequires: python-rpm-macros Requires: python-click Requires: python-six +Requires(post): update-alternatives +Requires(postun): update-alternatives BuildArch: noarch # SECTION test requirements BuildRequires: %{python_module click} @@ -49,17 +51,29 @@ GeoJSON <-> WKT/WKB conversion utilities %install %python_install +%python_clone -a %{buildroot}%{_bindir}/geomet rm %{buildroot}%{_prefix}/LICENSE %python_expand %fdupes %{buildroot}%{$python_sitelib} %check export PATH=$PATH:%{buildroot}%{_bindir} -%pytest +export PYTHONDONTWRITEBYTECODE=1 +%{python_expand \ +sed -i 's:geomet:geomet-%{$python_version}:' geomet/tests/test_cli.py +export PYTHONPATH=:%{buildroot}%{$python_sitelib} +$python -m pytest +} + +%post +%python_install_alternative geomet + +%postun +%python_uninstall_alternative geomet %files %{python_files} %doc AUTHORS.txt README.md %license LICENSE -%python3_only %{_bindir}/geomet +%python_alternative %{_bindir}/geomet %{python_sitelib}/geomet %{python_sitelib}/geomet-%{version}-py*.egg-info