]>
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} |
beeea2d2 JB |
11 | Version: 1.2.0 |
12 | Release: 1 | |
44e10bda MK |
13 | License: MIT |
14 | Group: Libraries/Python | |
beeea2d2 JB |
15 | Source0: https://pypi.python.org/packages/cc/b7/b2a61365ea6b6d2e8881360ae7ed8dad0327ad2df89f2f0be4a02304deb2/pytest-timeout-%{version}.tar.gz |
16 | # Source0-md5: 83607d91aa163562c7ee835da57d061d | |
44e10bda | 17 | URL: http://bitbucket.org/pytest-dev/pytest-timeout/ |
44e10bda | 18 | %if %{with python2} |
beeea2d2 | 19 | BuildRequires: python-modules >= 1:2.6 |
481c2014 | 20 | BuildRequires: python-setuptools |
beeea2d2 JB |
21 | %if %{with tests} |
22 | BuildRequires: python-pexpect | |
23 | BuildRequires: python-pytest >= 2.8.0 | |
24 | %endif | |
44e10bda MK |
25 | %endif |
26 | %if %{with python3} | |
beeea2d2 | 27 | BuildRequires: python3-modules >= 1:3.3 |
481c2014 | 28 | BuildRequires: python3-setuptools |
beeea2d2 JB |
29 | %if %{with tests} |
30 | BuildRequires: python3-pexpect | |
31 | BuildRequires: python3-pytest >= 2.8.0 | |
32 | %endif | |
44e10bda | 33 | %endif |
beeea2d2 JB |
34 | BuildRequires: rpm-pythonprov |
35 | BuildRequires: rpmbuild(macros) >= 1.714 | |
36 | Requires: python-modules >= 1:2.6 | |
44e10bda MK |
37 | BuildArch: noarch |
38 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
39 | ||
40 | %description | |
beeea2d2 JB |
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. | |
44e10bda MK |
45 | |
46 | %description -l pl.UTF-8 | |
beeea2d2 JB |
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ą. | |
44e10bda MK |
51 | |
52 | %package -n python3-%{module} | |
beeea2d2 JB |
53 | Summary: py.test plugin to abort hanging tests |
54 | Summary(pl.UTF-8): Wtyczka py.test do przerywania zawieszonych testów | |
44e10bda | 55 | Group: Libraries/Python |
beeea2d2 | 56 | Requires: python3-modules >= 1:3.3 |
44e10bda MK |
57 | |
58 | %description -n python3-%{module} | |
beeea2d2 JB |
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. | |
44e10bda MK |
63 | |
64 | %description -n python3-%{module} -l pl.UTF-8 | |
beeea2d2 JB |
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ą. | |
44e10bda MK |
69 | |
70 | %prep | |
71 | %setup -q -n %{module}-%{version} | |
72 | ||
73 | %build | |
74 | %if %{with python2} | |
beeea2d2 JB |
75 | %py_build |
76 | ||
77 | %{?with_tests:PYTHONPATH=$(pwd) %{__python} -m pytest} | |
44e10bda MK |
78 | %endif |
79 | ||
80 | %if %{with python3} | |
beeea2d2 | 81 | %py3_build |
44e10bda | 82 | |
beeea2d2 | 83 | %{?with_tests:PYTHONPATH=$(pwd) %{__python3} -m pytest} |
44e10bda MK |
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) | |
beeea2d2 | 104 | %doc LICENSE README |
16a57b48 | 105 | %{py_sitescriptdir}/pytest_timeout.py[co] |
44e10bda MK |
106 | %{py_sitescriptdir}/pytest_timeout-%{version}-py*.egg-info |
107 | %endif | |
44e10bda MK |
108 | |
109 | %if %{with python3} | |
110 | %files -n python3-%{module} | |
111 | %defattr(644,root,root,755) | |
beeea2d2 | 112 | %doc LICENSE README |
44e10bda | 113 | %{py3_sitescriptdir}/pytest_timeout.py |
beeea2d2 | 114 | %{py3_sitescriptdir}/__pycache__/pytest_timeout.cpython-*.py[co] |
44e10bda MK |
115 | %{py3_sitescriptdir}/pytest_timeout-%{version}-py*.egg-info |
116 | %endif |