From 560e4c28a8568f18993db41ea2846774b26fefbd961f91528b06670739e7f166 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Fri, 15 May 2020 17:41:18 +0000 Subject: [PATCH] Accepting request 805854 from home:pgajdos:python submit OBS-URL: https://build.opensuse.org/request/show/805854 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-yappi?expand=0&rev=9 --- python-yappi.changes | 5 +++++ python-yappi.spec | 16 +++++++++++++--- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/python-yappi.changes b/python-yappi.changes index 305e9bd..1e22431 100644 --- a/python-yappi.changes +++ b/python-yappi.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Fri May 15 12:52:55 UTC 2020 - Petr Gajdos + +- %python3_only -> %python_alternative + ------------------------------------------------------------------- Tue Mar 17 23:52:17 UTC 2020 - Hans-Peter Jansen diff --git a/python-yappi.spec b/python-yappi.spec index 6b5f3c0..f8def71 100644 --- a/python-yappi.spec +++ b/python-yappi.spec @@ -34,6 +34,8 @@ BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros Requires: python-setuptools +Requires(post): update-alternatives +Requires(postun): update-alternatives %python_subpackages %description @@ -48,23 +50,31 @@ export CFLAGS="%{optflags}" %install %python_install +%python_clone -a %{buildroot}%{_bindir}/yappi %python_expand %fdupes %{buildroot}%{$python_sitearch} %check export PYTHONPATH="tests/" -export PATH="$PATH:%{buildroot}/%{_bindir}" # Skip two flaky tests skip_tests="not test_basic_old_style and not test_basic" %if %{python3_version_nodots} < 37 # this test relies on asyncio.run method - skip_tests="$skip_tests and not test_asyncio_context_vars" + skip_tests="$skip_tests and not test_asyncio_context_vars" %endif +# yappi binary is not available (only yappi-%python_version) +skip_tests="$skip_tests and not test_run_as_script" %pytest_arch -k "$skip_tests" +%post +%python_install_alternative yappi + +%postun +%python_uninstall_alternative yappi + %files %{python_files} %doc README.md %license LICENSE -%python3_only %{_bindir}/yappi +%python_alternative %{_bindir}/yappi %{python_sitearch}/* %changelog