]>
Commit | Line | Data |
---|---|---|
16a57b48 | 1 | # |
44e10bda | 2 | # Conditional build: |
d2e171a5 | 3 | %bcond_with tests # py.test tests [use ptys, so not on builders] |
44e10bda MK |
4 | %bcond_without python2 # CPython 2.x module |
5 | %bcond_without python3 # CPython 3.x module | |
6 | ||
44e10bda | 7 | %define module pytest-timeout |
beeea2d2 JB |
8 | Summary: py.test plugin to abort hanging tests |
9 | Summary(pl.UTF-8): Wtyczka py.test do przerywania zawieszonych testów | |
44e10bda | 10 | Name: python-%{module} |
9d94fc17 | 11 | # keep 1.x here for python2/pytest<5 support |
ac1ada54 | 12 | Version: 1.4.2 |
98d71b24 | 13 | Release: 5 |
44e10bda MK |
14 | License: MIT |
15 | Group: Libraries/Python | |
93140855 JB |
16 | #Source0Download: https://pypi.org/simple/pytest-timeout/ |
17 | Source0: https://files.pythonhosted.org/packages/source/p/pytest-timeout/pytest-timeout-%{version}.tar.gz | |
ac1ada54 | 18 | # Source0-md5: 552cc293447b00f7a294ce7a1fb3839f |
93140855 | 19 | URL: https://github.com/pytest-dev/pytest-timeout |
44e10bda | 20 | %if %{with python2} |
93140855 | 21 | BuildRequires: python-modules >= 1:2.7 |
481c2014 | 22 | BuildRequires: python-setuptools |
beeea2d2 JB |
23 | %if %{with tests} |
24 | BuildRequires: python-pexpect | |
93140855 | 25 | BuildRequires: python-pytest >= 3.6.0 |
beeea2d2 | 26 | %endif |
44e10bda MK |
27 | %endif |
28 | %if %{with python3} | |
93140855 | 29 | BuildRequires: python3-modules >= 1:3.5 |
481c2014 | 30 | BuildRequires: python3-setuptools |
beeea2d2 JB |
31 | %if %{with tests} |
32 | BuildRequires: python3-pexpect | |
93140855 | 33 | BuildRequires: python3-pytest >= 3.6.0 |
beeea2d2 | 34 | %endif |
44e10bda | 35 | %endif |
beeea2d2 JB |
36 | BuildRequires: rpm-pythonprov |
37 | BuildRequires: rpmbuild(macros) >= 1.714 | |
93140855 | 38 | Requires: python-modules >= 1:2.7 |
44e10bda MK |
39 | BuildArch: noarch |
40 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
41 | ||
42 | %description | |
beeea2d2 JB |
43 | This is a plugin which will terminate tests after a certain timeout. |
44 | When doing so it will show a stack dump of all threads running at the | |
45 | time. This is useful when running tests under a continuous integration | |
46 | server or simply if you don't know why the test suite hangs. | |
44e10bda MK |
47 | |
48 | %description -l pl.UTF-8 | |
beeea2d2 JB |
49 | Ta wtyczka przerywa testy po upłynięciu określonego limitu czasu. Przy |
50 | tym pokazuje zrzut stosu wszystkich wątków działających w tej chwili. | |
51 | Jest to przydatne przy uruchamianiu testów na serwerze ciągłej | |
52 | integracji lub jeśli nie wiemy, dlaczego testy się zawieszają. | |
44e10bda MK |
53 | |
54 | %package -n python3-%{module} | |
beeea2d2 JB |
55 | Summary: py.test plugin to abort hanging tests |
56 | Summary(pl.UTF-8): Wtyczka py.test do przerywania zawieszonych testów | |
44e10bda | 57 | Group: Libraries/Python |
93140855 | 58 | Requires: python3-modules >= 1:3.5 |
44e10bda MK |
59 | |
60 | %description -n python3-%{module} | |
beeea2d2 JB |
61 | This is a plugin which will terminate tests after a certain timeout. |
62 | When doing so it will show a stack dump of all threads running at the | |
63 | time. This is useful when running tests under a continuous integration | |
64 | server or simply if you don't know why the test suite hangs. | |
44e10bda MK |
65 | |
66 | %description -n python3-%{module} -l pl.UTF-8 | |
beeea2d2 JB |
67 | Ta wtyczka przerywa testy po upłynięciu określonego limitu czasu. Przy |
68 | tym pokazuje zrzut stosu wszystkich wątków działających w tej chwili. | |
69 | Jest to przydatne przy uruchamianiu testów na serwerze ciągłej | |
70 | integracji lub jeśli nie wiemy, dlaczego testy się zawieszają. | |
44e10bda MK |
71 | |
72 | %prep | |
73 | %setup -q -n %{module}-%{version} | |
74 | ||
75 | %build | |
76 | %if %{with python2} | |
beeea2d2 JB |
77 | %py_build |
78 | ||
93140855 JB |
79 | %if %{with tests} |
80 | PYTHONPATH=$(pwd) \ | |
81 | %{__python} -m pytest | |
82 | %endif | |
44e10bda MK |
83 | %endif |
84 | ||
85 | %if %{with python3} | |
beeea2d2 | 86 | %py3_build |
44e10bda | 87 | |
93140855 JB |
88 | %if %{with tests} |
89 | PYTHONPATH=$(pwd) \ | |
90 | %{__python3} -m pytest | |
91 | %endif | |
44e10bda MK |
92 | %endif |
93 | ||
94 | %install | |
95 | rm -rf $RPM_BUILD_ROOT | |
96 | ||
97 | %if %{with python2} | |
98 | %py_install | |
93140855 | 99 | |
44e10bda MK |
100 | %py_postclean |
101 | %endif | |
102 | ||
103 | %if %{with python3} | |
104 | %py3_install | |
105 | %endif | |
106 | ||
107 | %clean | |
108 | rm -rf $RPM_BUILD_ROOT | |
109 | ||
110 | %if %{with python2} | |
111 | %files | |
112 | %defattr(644,root,root,755) | |
93140855 | 113 | %doc LICENSE README.rst |
16a57b48 | 114 | %{py_sitescriptdir}/pytest_timeout.py[co] |
44e10bda MK |
115 | %{py_sitescriptdir}/pytest_timeout-%{version}-py*.egg-info |
116 | %endif | |
44e10bda MK |
117 | |
118 | %if %{with python3} | |
119 | %files -n python3-%{module} | |
120 | %defattr(644,root,root,755) | |
93140855 | 121 | %doc LICENSE README.rst |
44e10bda | 122 | %{py3_sitescriptdir}/pytest_timeout.py |
beeea2d2 | 123 | %{py3_sitescriptdir}/__pycache__/pytest_timeout.cpython-*.py[co] |
44e10bda MK |
124 | %{py3_sitescriptdir}/pytest_timeout-%{version}-py*.egg-info |
125 | %endif |