]>
Commit | Line | Data |
---|---|---|
16a57b48 | 1 | # |
44e10bda | 2 | # Conditional build: |
44e10bda MK |
3 | %bcond_without tests # do not perform "make test" |
4 | %bcond_without python2 # CPython 2.x module | |
5 | %bcond_without python3 # CPython 3.x module | |
6 | ||
44e10bda MK |
7 | %define module pytest-timeout |
8 | Summary: Pytest plugin which will terminate tests after a certain timeout | |
9 | Summary(pl.UTF-8): Wtyczka Pytest wymuszająca zakończenie testów po przekroczeniu limitu czasu | |
44e10bda MK |
10 | Name: python-%{module} |
11 | Version: 1.0.0 | |
12 | Release: 1 | |
13 | License: MIT | |
14 | Group: Libraries/Python | |
15 | Source0: https://pypi.python.org/packages/cf/92/ab29b9baa54d47dfd50e43be35577de9af4e7ebf27d29f546ddeb6c3b6f5/pytest-timeout-%{version}.tar.gz | |
16 | # Source0-md5: f9f162bd079689980b5614673ddfdae4 | |
17 | URL: http://bitbucket.org/pytest-dev/pytest-timeout/ | |
18 | BuildRequires: rpm-pythonprov | |
19 | BuildRequires: rpmbuild(macros) >= 1.714 | |
20 | %if %{with python2} | |
21 | BuildRequires: python-modules | |
22 | BuildRequires: python-pytest | |
23 | %endif | |
24 | %if %{with python3} | |
25 | BuildRequires: python3-modules | |
26 | BuildRequires: python3-pytest | |
27 | %endif | |
28 | Requires: python-modules | |
29 | BuildArch: noarch | |
30 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
31 | ||
32 | %description | |
33 | Pytest plugin which will terminate tests after a certain timeout When | |
34 | doing so it will show a stack dump of all threads running at the time. | |
35 | ||
36 | %description -l pl.UTF-8 | |
37 | Wtyczka Pytest wymuszająca zakończenie testów po przekroczeniu limitu | |
38 | czasu Przy przekroczeniu pokaże zrzut stosu wszystkich wątków | |
39 | biegnących w tym czasie | |
40 | ||
41 | %package -n python3-%{module} | |
42 | Summary: Pytest plugin which will terminate tests after a certain timeout | |
43 | Summary(pl.UTF-8): Wtyczka Pytest wymuszająca zakończenie testów po przekroczeniu limitu czasu | |
44 | Group: Libraries/Python | |
45 | Requires: python3-modules | |
46 | ||
47 | %description -n python3-%{module} | |
48 | Pytest plugin which will terminate tests after a certain timeout When | |
49 | doing so it will show a stack dump of all threads running at the time. | |
50 | ||
51 | %description -n python3-%{module} -l pl.UTF-8 | |
52 | Wtyczka Pytest wymuszająca zakończenie testów po przekroczeniu limitu | |
53 | czasu Przy przekroczeniu pokaże zrzut stosu wszystkich wątków | |
54 | biegnących w tym czasie | |
55 | ||
56 | %package apidocs | |
57 | Summary: %{module} API documentation | |
58 | Summary(pl.UTF-8): Dokumentacja API %{module} | |
59 | Group: Documentation | |
60 | ||
61 | %description apidocs | |
62 | API documentation for %{module}. | |
63 | ||
64 | %description apidocs -l pl.UTF-8 | |
65 | Dokumentacja API %{module}. | |
66 | ||
67 | %prep | |
68 | %setup -q -n %{module}-%{version} | |
69 | ||
70 | %build | |
71 | %if %{with python2} | |
72 | %py_build %{?with_tests:test} | |
73 | %endif | |
74 | ||
75 | %if %{with python3} | |
76 | %py3_build %{?with_tests:test} | |
77 | %endif | |
78 | ||
79 | %if %{with doc} | |
80 | cd docs | |
81 | %{__make} -j1 html | |
82 | rm -rf _build/html/_sources | |
83 | %endif | |
84 | ||
85 | %install | |
86 | rm -rf $RPM_BUILD_ROOT | |
87 | ||
88 | %if %{with python2} | |
89 | %py_install | |
90 | %py_postclean | |
91 | %endif | |
92 | ||
93 | %if %{with python3} | |
94 | %py3_install | |
95 | %endif | |
96 | ||
97 | %clean | |
98 | rm -rf $RPM_BUILD_ROOT | |
99 | ||
100 | %if %{with python2} | |
101 | %files | |
102 | %defattr(644,root,root,755) | |
103 | %doc README | |
16a57b48 | 104 | %{py_sitescriptdir}/pytest_timeout.py[co] |
44e10bda MK |
105 | %{py_sitescriptdir}/pytest_timeout-%{version}-py*.egg-info |
106 | %endif | |
44e10bda MK |
107 | |
108 | %if %{with python3} | |
109 | %files -n python3-%{module} | |
110 | %defattr(644,root,root,755) | |
111 | %doc README | |
112 | %{py3_sitescriptdir}/pytest_timeout.py | |
113 | %{py3_sitescriptdir}/__pycache__/pytest_timeout.*.pyc | |
114 | %{py3_sitescriptdir}/pytest_timeout-%{version}-py*.egg-info | |
115 | %endif | |
116 | ||
117 | %if %{with doc} | |
118 | %files apidocs | |
119 | %defattr(644,root,root,755) | |
120 | %doc docs/_build/html/* | |
121 | %endif |