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