]>
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 | |
b6e7f217 | 12 | Release: 2 |
44e10bda MK |
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 | |
481c2014 | 23 | BuildRequires: python-setuptools |
44e10bda MK |
24 | %endif |
25 | %if %{with python3} | |
26 | BuildRequires: python3-modules | |
27 | BuildRequires: python3-pytest | |
481c2014 | 28 | BuildRequires: python3-setuptools |
44e10bda MK |
29 | %endif |
30 | Requires: python-modules | |
31 | BuildArch: noarch | |
32 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
33 | ||
34 | %description | |
35 | Pytest plugin which will terminate tests after a certain timeout When | |
36 | doing so it will show a stack dump of all threads running at the time. | |
37 | ||
38 | %description -l pl.UTF-8 | |
39 | Wtyczka Pytest wymuszająca zakończenie testów po przekroczeniu limitu | |
40 | czasu Przy przekroczeniu pokaże zrzut stosu wszystkich wątków | |
41 | biegnących w tym czasie | |
42 | ||
43 | %package -n python3-%{module} | |
44 | Summary: Pytest plugin which will terminate tests after a certain timeout | |
45 | Summary(pl.UTF-8): Wtyczka Pytest wymuszająca zakończenie testów po przekroczeniu limitu czasu | |
46 | Group: Libraries/Python | |
47 | Requires: python3-modules | |
48 | ||
49 | %description -n python3-%{module} | |
50 | Pytest plugin which will terminate tests after a certain timeout When | |
51 | doing so it will show a stack dump of all threads running at the time. | |
52 | ||
53 | %description -n python3-%{module} -l pl.UTF-8 | |
54 | Wtyczka Pytest wymuszająca zakończenie testów po przekroczeniu limitu | |
55 | czasu Przy przekroczeniu pokaże zrzut stosu wszystkich wątków | |
56 | biegnących w tym czasie | |
57 | ||
58 | %package apidocs | |
59 | Summary: %{module} API documentation | |
60 | Summary(pl.UTF-8): Dokumentacja API %{module} | |
61 | Group: Documentation | |
62 | ||
63 | %description apidocs | |
64 | API documentation for %{module}. | |
65 | ||
66 | %description apidocs -l pl.UTF-8 | |
67 | Dokumentacja API %{module}. | |
68 | ||
69 | %prep | |
70 | %setup -q -n %{module}-%{version} | |
71 | ||
72 | %build | |
73 | %if %{with python2} | |
74 | %py_build %{?with_tests:test} | |
75 | %endif | |
76 | ||
77 | %if %{with python3} | |
78 | %py3_build %{?with_tests:test} | |
79 | %endif | |
80 | ||
81 | %if %{with doc} | |
82 | cd docs | |
83 | %{__make} -j1 html | |
84 | rm -rf _build/html/_sources | |
85 | %endif | |
86 | ||
87 | %install | |
88 | rm -rf $RPM_BUILD_ROOT | |
89 | ||
90 | %if %{with python2} | |
91 | %py_install | |
92 | %py_postclean | |
93 | %endif | |
94 | ||
95 | %if %{with python3} | |
96 | %py3_install | |
97 | %endif | |
98 | ||
99 | %clean | |
100 | rm -rf $RPM_BUILD_ROOT | |
101 | ||
102 | %if %{with python2} | |
103 | %files | |
104 | %defattr(644,root,root,755) | |
105 | %doc README | |
16a57b48 | 106 | %{py_sitescriptdir}/pytest_timeout.py[co] |
44e10bda MK |
107 | %{py_sitescriptdir}/pytest_timeout-%{version}-py*.egg-info |
108 | %endif | |
44e10bda MK |
109 | |
110 | %if %{with python3} | |
111 | %files -n python3-%{module} | |
112 | %defattr(644,root,root,755) | |
113 | %doc README | |
114 | %{py3_sitescriptdir}/pytest_timeout.py | |
115 | %{py3_sitescriptdir}/__pycache__/pytest_timeout.*.pyc | |
116 | %{py3_sitescriptdir}/pytest_timeout-%{version}-py*.egg-info | |
117 | %endif | |
118 | ||
119 | %if %{with doc} | |
120 | %files apidocs | |
121 | %defattr(644,root,root,755) | |
122 | %doc docs/_build/html/* | |
123 | %endif |