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