]> git.pld-linux.org Git - packages/python-pytest-timeout.git/blob - python-pytest-timeout.spec
rebuild with tests and docs
[packages/python-pytest-timeout.git] / python-pytest-timeout.spec
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 # keep 1.x here for python2/pytest<5 support
12 Version:        1.4.2
13 Release:        5
14 License:        MIT
15 Group:          Libraries/Python
16 #Source0Download: https://pypi.org/simple/pytest-timeout/
17 Source0:        https://files.pythonhosted.org/packages/source/p/pytest-timeout/pytest-timeout-%{version}.tar.gz
18 # Source0-md5:  552cc293447b00f7a294ce7a1fb3839f
19 URL:            https://github.com/pytest-dev/pytest-timeout
20 %if %{with python2}
21 BuildRequires:  python-modules >= 1:2.7
22 BuildRequires:  python-setuptools
23 %if %{with tests}
24 BuildRequires:  python-pexpect
25 BuildRequires:  python-pytest >= 3.6.0
26 %endif
27 %endif
28 %if %{with python3}
29 BuildRequires:  python3-modules >= 1:3.5
30 BuildRequires:  python3-setuptools
31 %if %{with tests}
32 BuildRequires:  python3-pexpect
33 BuildRequires:  python3-pytest >= 3.6.0
34 %endif
35 %endif
36 BuildRequires:  rpm-pythonprov
37 BuildRequires:  rpmbuild(macros) >= 1.714
38 Requires:       python-modules >= 1:2.7
39 BuildArch:      noarch
40 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
41
42 %description
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.
47
48 %description -l pl.UTF-8
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ą.
53
54 %package -n python3-%{module}
55 Summary:        py.test plugin to abort hanging tests
56 Summary(pl.UTF-8):      Wtyczka py.test do przerywania zawieszonych testów
57 Group:          Libraries/Python
58 Requires:       python3-modules >= 1:3.5
59
60 %description -n python3-%{module}
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.
65
66 %description -n python3-%{module} -l pl.UTF-8
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ą.
71
72 %prep
73 %setup -q -n %{module}-%{version}
74
75 %build
76 %if %{with python2}
77 %py_build
78
79 %if %{with tests}
80 PYTHONPATH=$(pwd) \
81 %{__python} -m pytest
82 %endif
83 %endif
84
85 %if %{with python3}
86 %py3_build
87
88 %if %{with tests}
89 PYTHONPATH=$(pwd) \
90 %{__python3} -m pytest
91 %endif
92 %endif
93
94 %install
95 rm -rf $RPM_BUILD_ROOT
96
97 %if %{with python2}
98 %py_install
99
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)
113 %doc LICENSE README.rst
114 %{py_sitescriptdir}/pytest_timeout.py[co]
115 %{py_sitescriptdir}/pytest_timeout-%{version}-py*.egg-info
116 %endif
117
118 %if %{with python3}
119 %files -n python3-%{module}
120 %defattr(644,root,root,755)
121 %doc LICENSE README.rst
122 %{py3_sitescriptdir}/pytest_timeout.py
123 %{py3_sitescriptdir}/__pycache__/pytest_timeout.cpython-*.py[co]
124 %{py3_sitescriptdir}/pytest_timeout-%{version}-py*.egg-info
125 %endif
This page took 0.100641 seconds and 3 git commands to generate.