]> git.pld-linux.org Git - packages/python-pytest-timeout.git/blobdiff - python-pytest-timeout.spec
rebuild with tests and docs
[packages/python-pytest-timeout.git] / python-pytest-timeout.spec
index a41a8700f227b38dd0257f035b9d3baafac2f825..6fa1cc9d0333101e196feb849f87b2ee438a6de6 100644 (file)
@@ -1,87 +1,94 @@
 #
 # Conditional build:
-%bcond_without tests   # do not perform "make test"
+%bcond_with    tests   # py.test tests [use ptys, so not on builders]
 %bcond_without python2 # CPython 2.x module
 %bcond_without python3 # CPython 3.x module
 
 %define        module  pytest-timeout
-Summary:       Pytest plugin which will terminate tests after a certain timeout
-Summary(pl.UTF-8):     Wtyczka Pytest wymuszająca zakończenie testów po przekroczeniu limitu czasu
+Summary:       py.test plugin to abort hanging tests
+Summary(pl.UTF-8):     Wtyczka py.test do przerywania zawieszonych testów
 Name:          python-%{module}
-Version:       1.0.0
-Release:       1
+# keep 1.x here for python2/pytest<5 support
+Version:       1.4.2
+Release:       5
 License:       MIT
 Group:         Libraries/Python
-Source0:       https://pypi.python.org/packages/cf/92/ab29b9baa54d47dfd50e43be35577de9af4e7ebf27d29f546ddeb6c3b6f5/pytest-timeout-%{version}.tar.gz
-# Source0-md5: f9f162bd079689980b5614673ddfdae4
-URL:           http://bitbucket.org/pytest-dev/pytest-timeout/
-BuildRequires: rpm-pythonprov
-BuildRequires: rpmbuild(macros) >= 1.714
+#Source0Download: https://pypi.org/simple/pytest-timeout/
+Source0:       https://files.pythonhosted.org/packages/source/p/pytest-timeout/pytest-timeout-%{version}.tar.gz
+# Source0-md5: 552cc293447b00f7a294ce7a1fb3839f
+URL:           https://github.com/pytest-dev/pytest-timeout
 %if %{with python2}
-BuildRequires: python-modules
-BuildRequires: python-pytest
+BuildRequires: python-modules >= 1:2.7
 BuildRequires: python-setuptools
+%if %{with tests}
+BuildRequires: python-pexpect
+BuildRequires: python-pytest >= 3.6.0
+%endif
 %endif
 %if %{with python3}
-BuildRequires: python3-modules
-BuildRequires: python3-pytest
+BuildRequires: python3-modules >= 1:3.5
 BuildRequires: python3-setuptools
+%if %{with tests}
+BuildRequires: python3-pexpect
+BuildRequires: python3-pytest >= 3.6.0
 %endif
-Requires:      python-modules
+%endif
+BuildRequires: rpm-pythonprov
+BuildRequires: rpmbuild(macros) >= 1.714
+Requires:      python-modules >= 1:2.7
 BuildArch:     noarch
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %description
-Pytest 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 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.
 
 %description -l pl.UTF-8
-Wtyczka Pytest wymuszająca zakończenie testów po przekroczeniu limitu
-czasu Przy przekroczeniu pokaże zrzut stosu wszystkich wątków
-biegnących w tym czasie
+Ta wtyczka przerywa testy po upłynięciu określonego limitu czasu. Przy
+tym pokazuje zrzut stosu wszystkich wątków działających w tej chwili.
+Jest to przydatne przy uruchamianiu testów na serwerze ciągłej
+integracji lub jeśli nie wiemy, dlaczego testy się zawieszają.
 
 %package -n python3-%{module}
-Summary:       Pytest plugin which will terminate tests after a certain timeout
-Summary(pl.UTF-8):     Wtyczka Pytest wymuszająca zakończenie testów po przekroczeniu limitu czasu
+Summary:       py.test plugin to abort hanging tests
+Summary(pl.UTF-8):     Wtyczka py.test do przerywania zawieszonych testów
 Group:         Libraries/Python
-Requires:      python3-modules
+Requires:      python3-modules >= 1:3.5
 
 %description -n python3-%{module}
-Pytest 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 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.
 
 %description -n python3-%{module} -l pl.UTF-8
-Wtyczka Pytest wymuszająca zakończenie testów po przekroczeniu limitu
-czasu Przy przekroczeniu pokaże zrzut stosu wszystkich wątków
-biegnących w tym czasie
-
-%package apidocs
-Summary:       %{module} API documentation
-Summary(pl.UTF-8):     Dokumentacja API %{module}
-Group:         Documentation
-
-%description apidocs
-API documentation for %{module}.
-
-%description apidocs -l pl.UTF-8
-Dokumentacja API %{module}.
+Ta wtyczka przerywa testy po upłynięciu określonego limitu czasu. Przy
+tym pokazuje zrzut stosu wszystkich wątków działających w tej chwili.
+Jest to przydatne przy uruchamianiu testów na serwerze ciągłej
+integracji lub jeśli nie wiemy, dlaczego testy się zawieszają.
 
 %prep
 %setup -q -n %{module}-%{version}
 
 %build
 %if %{with python2}
-%py_build %{?with_tests:test}
+%py_build
+
+%if %{with tests}
+PYTHONPATH=$(pwd) \
+%{__python} -m pytest
+%endif
 %endif
 
 %if %{with python3}
-%py3_build %{?with_tests:test}
-%endif
+%py3_build
 
-%if %{with doc}
-cd docs
-%{__make} -j1 html
-rm -rf _build/html/_sources
+%if %{with tests}
+PYTHONPATH=$(pwd) \
+%{__python3} -m pytest
+%endif
 %endif
 
 %install
@@ -89,6 +96,7 @@ rm -rf $RPM_BUILD_ROOT
 
 %if %{with python2}
 %py_install
+
 %py_postclean
 %endif
 
@@ -102,7 +110,7 @@ rm -rf $RPM_BUILD_ROOT
 %if %{with python2}
 %files
 %defattr(644,root,root,755)
-%doc README
+%doc LICENSE README.rst
 %{py_sitescriptdir}/pytest_timeout.py[co]
 %{py_sitescriptdir}/pytest_timeout-%{version}-py*.egg-info
 %endif
@@ -110,14 +118,8 @@ rm -rf $RPM_BUILD_ROOT
 %if %{with python3}
 %files -n python3-%{module}
 %defattr(644,root,root,755)
-%doc README
+%doc LICENSE README.rst
 %{py3_sitescriptdir}/pytest_timeout.py
-%{py3_sitescriptdir}/__pycache__/pytest_timeout.*.pyc
+%{py3_sitescriptdir}/__pycache__/pytest_timeout.cpython-*.py[co]
 %{py3_sitescriptdir}/pytest_timeout-%{version}-py*.egg-info
 %endif
-
-%if %{with doc}
-%files apidocs
-%defattr(644,root,root,755)
-%doc docs/_build/html/*
-%endif
This page took 0.109829 seconds and 4 git commands to generate.