# Tests by default. No tests: rpm -ba --define 'dotests 0' *.spec %{!?dotests: %define dotests 1} %define name python3-pytest-timeout %define srcname pytest-timeout %define version 1.3.3 %define release 1 %define is_python %(test -e /usr/bin/python3_32 && echo 1 || echo 0) %if %{is_python} %define python_sitelib %(python3_32 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))") %endif %define _libdir64 %{_prefix}/lib64 %define is_python_64 %(test -e /usr/bin/python3 && echo 1 || echo 0) %if %{is_python_64} %define python_sitelib64 %(python3 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))") %endif Summary: Better living through Python with decorators Name: %{name} Version: %{version} Release: %{release} Source0: %{srcname}-%{version}.tar.gz Patch0: pytest4.patch License: MIT Group: Development/Libraries BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot Prefix: %{_prefix} BuildArch: noarch Vendor: Michele Simionato Url: http://pypi.python.org/pypi/decorator BuildRequires: python3 >= 3.7.4-1, python3-devel >= 3.7.4-1 BuildRequires: python3-devel >= 3.7.4-1 BuildRequires: python3-pytest >= 5.3.1-1 Requires: python3 >= 3.7.4-1 Requires: python3-pytest >= 5.3.1-1 %description This is a plugin which will terminate tests after a certain timeout. When doing so it will show a stack dump of all threads running at the time. This is useful when running tests under a continuous integration server or simply if you don’t know why the test suite hangs. %prep %setup -q -n %{srcname}-%{version} %patch0 -p1 %build python3 setup.py build %install [ -d "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT python3 setup.py install --skip-build --root ${RPM_BUILD_ROOT} %if %{dotests} %check PYTHONPATH=`pwd` PYTHONDONTWRITEBYTECODE=1 py.test-3 || true %endif %clean [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %files -n python3-%{srcname} %defattr(-,root,system,-) %doc PKG-INFO README %{python_sitelib}/* %changelog * Mon Dec 30 2019 Reshma V Kumar - 1.3.3-1 - Update to latest version - Build with python3 * Wed Aug 02 2017 Ravi hirekurabar - 1.2.0-1 - Initial port