]>
Commit | Line | Data |
---|---|---|
bd571570 JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without doc # HTML documentation build | |
08c08cc1 | 4 | %bcond_without python2 # CPython 2.x module |
e4983238 | 5 | %bcond_without python3 # CPython 3.x module |
65ffd36d | 6 | %bcond_without tests # unit tests |
e4983238 | 7 | |
65ffd36d | 8 | %define pylib_version 1.5.0 |
e4983238 | 9 | %define module pytest |
bd571570 JB |
10 | Summary: Simple and popular testing tool for Python |
11 | Summary(pl.UTF-8): Proste i popularne narzędzie testujące dla Pythona | |
e4983238 | 12 | Name: python-%{module} |
65ffd36d JB |
13 | Version: 3.6.3 |
14 | Release: 1 | |
bd571570 JB |
15 | License: MIT |
16 | Group: Development/Languages/Python | |
65ffd36d | 17 | #Source0Download: https://pypi.org/simple/pytest/ |
c4594506 | 18 | Source0: https://files.pythonhosted.org/packages/source/p/pytest/pytest-%{version}.tar.gz |
65ffd36d JB |
19 | # Source0-md5: 8ca6124a3a80f9555c50f5c09056ea02 |
20 | Patch0: %{name}-tests.patch | |
bd571570 | 21 | URL: http://pytest.org/ |
08c08cc1 | 22 | %if %{with python2} |
65ffd36d JB |
23 | BuildRequires: python-devel >= 1:2.7 |
24 | BuildRequires: python-modules >= 1:2.7 | |
e4983238 | 25 | BuildRequires: python-py >= %{pylib_version} |
2f6fd582 | 26 | BuildRequires: python-setuptools >= 7.0 |
65ffd36d JB |
27 | BuildRequires: python-setuptools_scm |
28 | %if %{with tests} | |
29 | BuildRequires: python-atomicwrites >= 1.0 | |
30 | BuildRequires: python-attrs >= 17.4.0 | |
31 | BuildRequires: python-funcsigs | |
32 | BuildRequires: python-hypothesis >= 3.56 | |
33 | BuildRequires: python-mock | |
b67a8b0e | 34 | BuildRequires: python-more_itertools |
65ffd36d JB |
35 | BuildRequires: python-nose |
36 | BuildRequires: python-pluggy >= 0.5 | |
37 | BuildRequires: python-requests | |
38 | BuildRequires: python-six >= 1.10.0 | |
39 | BuildConflicts: python-pytest-catchlog | |
40 | # with xdist requires various modules source | |
41 | BuildConflicts: python-pytest-xdist | |
42 | %endif | |
bd571570 | 43 | %endif |
e4983238 | 44 | %if %{with python3} |
65ffd36d JB |
45 | BuildRequires: python3-devel >= 1:3.4 |
46 | BuildRequires: python3-modules >= 1:3.4 | |
e4983238 | 47 | BuildRequires: python3-py >= %{pylib_version} |
2f6fd582 | 48 | BuildRequires: python3-setuptools >= 7.0 |
65ffd36d JB |
49 | BuildRequires: python3-setuptools_scm |
50 | %if %{with tests} | |
51 | BuildRequires: python3-atomicwrites >= 1.0 | |
52 | BuildRequires: python3-attrs >= 17.4.0 | |
53 | BuildRequires: python3-hypothesis >= 3.56 | |
b67a8b0e | 54 | BuildRequires: python3-more_itertools |
65ffd36d JB |
55 | BuildRequires: python3-nose |
56 | BuildRequires: python3-pluggy >= 0.5 | |
57 | BuildRequires: python3-requests | |
58 | BuildRequires: python3-six >= 1.10.0 | |
59 | BuildConflicts: python3-pytest-catchlog | |
60 | %endif | |
e4983238 | 61 | %endif |
08c08cc1 JB |
62 | BuildRequires: rpm-pythonprov |
63 | BuildRequires: rpmbuild(macros) >= 1.714 | |
64 | BuildRequires: sed >= 4.0 | |
65 | %if %{with doc} | |
65ffd36d JB |
66 | BuildRequires: python3-sphinxcontrib-trio |
67 | BuildRequires: sphinx-pdg-3 >= 1.0 | |
08c08cc1 | 68 | %endif |
2084a849 | 69 | Requires: python-modules |
84b7690d | 70 | Requires: python-setuptools |
fd6ab041 | 71 | Obsoletes: python-pytest-cache |
65ffd36d | 72 | Obsoletes: python-pytest-catchlog |
bd571570 JB |
73 | BuildArch: noarch |
74 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
75 | ||
76 | %description | |
77 | py.test is a simple and popular testing tool for Python. | |
78 | ||
79 | %description -l pl.UTF-8 | |
80 | py.test to proste i popularne narzędzie testujące dla Pythona. | |
81 | ||
e4983238 ER |
82 | %package -n python3-pytest |
83 | Summary: Simple powerful testing with Python | |
6b847094 | 84 | Summary(pl.UTF-8): Proste, ale funkcjonalne narzędzie testujące dla Pythona |
e4983238 | 85 | Group: Development/Languages |
2084a849 | 86 | Requires: python3-devel-tools |
84b7690d | 87 | Requires: python3-setuptools |
fd6ab041 | 88 | Obsoletes: python3-pytest-cache |
65ffd36d | 89 | Obsoletes: python3-pytest-catchlog |
e4983238 ER |
90 | |
91 | %description -n python3-pytest | |
92 | py.test provides simple, yet powerful testing for Python. | |
93 | ||
6b847094 JB |
94 | %description -n python3-pytest -l pl.UTF-8 |
95 | py.test to proste, ale bardzo funkcjonalne narzędzie testujące dla | |
96 | Pythona. | |
97 | ||
c4594506 JB |
98 | %package apidocs |
99 | Summary: Documentation for py.test Pythona package | |
100 | Summary(pl.UTF-8): Dokumentacja pakietu Pythona py.test | |
101 | Group: Documentation | |
102 | ||
103 | %description apidocs | |
104 | Documentation for py.test Pythona package. | |
105 | ||
106 | %description apidocs -l pl.UTF-8 | |
107 | Dokumentacja pakietu Pythona py.test. | |
108 | ||
bd571570 | 109 | %prep |
e4983238 | 110 | %setup -q -n %{module}-%{version} |
65ffd36d | 111 | %patch0 -p1 |
e4983238 | 112 | |
bd571570 | 113 | %build |
08c08cc1 | 114 | %if %{with python2} |
ac22139b | 115 | %py_build |
65ffd36d JB |
116 | |
117 | %if %{with tests} | |
118 | PYTHONPATH=$(pwd)/src \ | |
119 | %{__python} -m pytest testing | |
120 | %endif | |
08c08cc1 | 121 | %endif |
bd571570 | 122 | |
e4983238 | 123 | %if %{with python3} |
ac22139b | 124 | %py3_build |
65ffd36d JB |
125 | |
126 | %if %{with tests} | |
127 | PYTHONPATH=$(pwd)/src \ | |
128 | %{__python3} -m pytest testing | |
129 | %endif | |
e4983238 ER |
130 | %endif |
131 | ||
bd571570 | 132 | %if %{with doc} |
e4983238 | 133 | for l in doc/*; do |
65ffd36d JB |
134 | PYTHONPATH=$(pwd)/src \ |
135 | %{__make} -C $l html \ | |
136 | SPHINXBUILD=sphinx-build-3 | |
e4983238 | 137 | done |
bd571570 JB |
138 | %endif |
139 | ||
140 | %install | |
141 | rm -rf $RPM_BUILD_ROOT | |
ac22139b JK |
142 | |
143 | %if %{with python3} | |
144 | %py3_install | |
84b7690d JB |
145 | |
146 | %{__mv} $RPM_BUILD_ROOT%{_bindir}/py.test{,-3} | |
147 | %{__mv} $RPM_BUILD_ROOT%{_bindir}/pytest{,-3} | |
65ffd36d JB |
148 | |
149 | # avoid python3egg(funcsigs) dependency | |
150 | %{__sed} -i -e '/^\[:python_version < "3\.0"]/,/^$/ d' $RPM_BUILD_ROOT%{py3_sitescriptdir}/pytest-%{version}-py*.egg-info/requires.txt | |
ac22139b JK |
151 | %endif |
152 | ||
08c08cc1 | 153 | %if %{with python2} |
ac22139b | 154 | %py_install |
bd571570 | 155 | |
84b7690d JB |
156 | ln $RPM_BUILD_ROOT%{_bindir}/py.test{,-2} |
157 | ln $RPM_BUILD_ROOT%{_bindir}/pytest{,-2} | |
158 | ||
08c08cc1 JB |
159 | # pytest.py source seems required for "monkeypatching" tests |
160 | %py_postclean -x pytest.py | |
161 | %endif | |
bd571570 JB |
162 | |
163 | %clean | |
164 | rm -rf $RPM_BUILD_ROOT | |
165 | ||
08c08cc1 | 166 | %if %{with python2} |
bd571570 JB |
167 | %files |
168 | %defattr(644,root,root,755) | |
c4594506 | 169 | %doc AUTHORS CHANGELOG.rst LICENSE README.rst |
bd571570 | 170 | %attr(755,root,root) %{_bindir}/py.test |
84b7690d JB |
171 | %attr(755,root,root) %{_bindir}/py.test-2 |
172 | %attr(755,root,root) %{_bindir}/pytest | |
173 | %attr(755,root,root) %{_bindir}/pytest-2 | |
08c08cc1 | 174 | %{py_sitescriptdir}/pytest.py* |
bd571570 JB |
175 | %{py_sitescriptdir}/_pytest |
176 | %{py_sitescriptdir}/pytest-%{version}-py*.egg-info | |
08c08cc1 | 177 | %endif |
e4983238 ER |
178 | |
179 | %if %{with python3} | |
180 | %files -n python3-pytest | |
181 | %defattr(644,root,root,755) | |
c4594506 | 182 | %doc AUTHORS CHANGELOG.rst LICENSE README.rst |
84b7690d JB |
183 | %attr(755,root,root) %{_bindir}/py.test-3 |
184 | %attr(755,root,root) %{_bindir}/pytest-3 | |
6b847094 | 185 | %{py3_sitescriptdir}/pytest.py |
e4983238 | 186 | %{py3_sitescriptdir}/_pytest |
6b847094 | 187 | %{py3_sitescriptdir}/__pycache__/pytest.*.py[co] |
e4983238 ER |
188 | %{py3_sitescriptdir}/pytest-%{version}-py*.egg-info |
189 | %endif | |
c4594506 JB |
190 | |
191 | %if %{with doc} | |
192 | %files apidocs | |
193 | %defattr(644,root,root,755) | |
65ffd36d | 194 | %doc doc/en/_build/html/{_images,_modules,_static,announce,example,proposals,*.html,*.js} |
c4594506 | 195 | %endif |