]>
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 ER |
5 | %bcond_without python3 # CPython 3.x module |
6 | ||
8246eb60 | 7 | %define pylib_version 1.4.29 |
e4983238 | 8 | %define module pytest |
bd571570 JB |
9 | Summary: Simple and popular testing tool for Python |
10 | Summary(pl.UTF-8): Proste i popularne narzędzie testujące dla Pythona | |
e4983238 | 11 | Name: python-%{module} |
84b7690d JB |
12 | Version: 3.0.7 |
13 | Release: 1 | |
bd571570 JB |
14 | License: MIT |
15 | Group: Development/Languages/Python | |
c4594506 JB |
16 | #Source0Download: https://pypi.python.org/simple/pytest |
17 | Source0: https://files.pythonhosted.org/packages/source/p/pytest/pytest-%{version}.tar.gz | |
84b7690d | 18 | # Source0-md5: 89c60546507dc7eb6e9e40a6e9f720bd |
bd571570 | 19 | URL: http://pytest.org/ |
08c08cc1 | 20 | %if %{with python2} |
93a87154 | 21 | BuildRequires: python-devel >= 1:2.6 |
08c08cc1 | 22 | BuildRequires: python-modules >= 1:2.6 |
e4983238 | 23 | BuildRequires: python-py >= %{pylib_version} |
2f6fd582 | 24 | BuildRequires: python-setuptools >= 7.0 |
bd571570 | 25 | %endif |
e4983238 | 26 | %if %{with python3} |
93a87154 JB |
27 | BuildRequires: python3-devel >= 1:3.3 |
28 | BuildRequires: python3-modules >= 1:3.3 | |
e4983238 | 29 | BuildRequires: python3-py >= %{pylib_version} |
2f6fd582 | 30 | BuildRequires: python3-setuptools >= 7.0 |
e4983238 | 31 | %endif |
08c08cc1 JB |
32 | BuildRequires: rpm-pythonprov |
33 | BuildRequires: rpmbuild(macros) >= 1.714 | |
34 | BuildRequires: sed >= 4.0 | |
35 | %if %{with doc} | |
36 | BuildRequires: sphinx-pdg >= 1.0 | |
37 | %endif | |
84b7690d | 38 | Requires: python-setuptools |
fd6ab041 | 39 | Obsoletes: python-pytest-cache |
bd571570 JB |
40 | BuildArch: noarch |
41 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
42 | ||
43 | %description | |
44 | py.test is a simple and popular testing tool for Python. | |
45 | ||
46 | %description -l pl.UTF-8 | |
47 | py.test to proste i popularne narzędzie testujące dla Pythona. | |
48 | ||
e4983238 ER |
49 | %package -n python3-pytest |
50 | Summary: Simple powerful testing with Python | |
6b847094 | 51 | Summary(pl.UTF-8): Proste, ale funkcjonalne narzędzie testujące dla Pythona |
e4983238 | 52 | Group: Development/Languages |
84b7690d | 53 | Requires: python3-setuptools |
fd6ab041 | 54 | Obsoletes: python3-pytest-cache |
e4983238 ER |
55 | |
56 | %description -n python3-pytest | |
57 | py.test provides simple, yet powerful testing for Python. | |
58 | ||
6b847094 JB |
59 | %description -n python3-pytest -l pl.UTF-8 |
60 | py.test to proste, ale bardzo funkcjonalne narzędzie testujące dla | |
61 | Pythona. | |
62 | ||
c4594506 JB |
63 | %package apidocs |
64 | Summary: Documentation for py.test Pythona package | |
65 | Summary(pl.UTF-8): Dokumentacja pakietu Pythona py.test | |
66 | Group: Documentation | |
67 | ||
68 | %description apidocs | |
69 | Documentation for py.test Pythona package. | |
70 | ||
71 | %description apidocs -l pl.UTF-8 | |
72 | Dokumentacja pakietu Pythona py.test. | |
73 | ||
bd571570 | 74 | %prep |
e4983238 ER |
75 | %setup -q -n %{module}-%{version} |
76 | ||
bd571570 | 77 | %build |
08c08cc1 | 78 | %if %{with python2} |
ac22139b | 79 | %py_build |
08c08cc1 | 80 | %endif |
bd571570 | 81 | |
e4983238 | 82 | %if %{with python3} |
ac22139b | 83 | %py3_build |
e4983238 ER |
84 | %endif |
85 | ||
bd571570 | 86 | %if %{with doc} |
e4983238 ER |
87 | install -d _htmldocs/html |
88 | for l in doc/*; do | |
89 | PYTHONPATH=$(pwd) \ | |
90 | %{__make} -C $l html | |
91 | # remove hidden file | |
c4594506 JB |
92 | %{__rm} $l/_build/html/.buildinfo |
93 | %{__mv} $l/_build/html _htmldocs/html/${l##doc/} | |
e4983238 | 94 | done |
bd571570 JB |
95 | %endif |
96 | ||
97 | %install | |
98 | rm -rf $RPM_BUILD_ROOT | |
ac22139b JK |
99 | |
100 | %if %{with python3} | |
101 | %py3_install | |
84b7690d JB |
102 | |
103 | %{__mv} $RPM_BUILD_ROOT%{_bindir}/py.test{,-3} | |
104 | %{__mv} $RPM_BUILD_ROOT%{_bindir}/pytest{,-3} | |
ac22139b JK |
105 | %endif |
106 | ||
08c08cc1 | 107 | %if %{with python2} |
ac22139b | 108 | %py_install |
bd571570 | 109 | |
84b7690d JB |
110 | ln $RPM_BUILD_ROOT%{_bindir}/py.test{,-2} |
111 | ln $RPM_BUILD_ROOT%{_bindir}/pytest{,-2} | |
112 | ||
08c08cc1 JB |
113 | # pytest.py source seems required for "monkeypatching" tests |
114 | %py_postclean -x pytest.py | |
115 | %endif | |
bd571570 JB |
116 | |
117 | %clean | |
118 | rm -rf $RPM_BUILD_ROOT | |
119 | ||
08c08cc1 | 120 | %if %{with python2} |
bd571570 JB |
121 | %files |
122 | %defattr(644,root,root,755) | |
c4594506 | 123 | %doc AUTHORS CHANGELOG.rst LICENSE README.rst |
bd571570 | 124 | %attr(755,root,root) %{_bindir}/py.test |
84b7690d JB |
125 | %attr(755,root,root) %{_bindir}/py.test-2 |
126 | %attr(755,root,root) %{_bindir}/pytest | |
127 | %attr(755,root,root) %{_bindir}/pytest-2 | |
08c08cc1 | 128 | %{py_sitescriptdir}/pytest.py* |
bd571570 JB |
129 | %{py_sitescriptdir}/_pytest |
130 | %{py_sitescriptdir}/pytest-%{version}-py*.egg-info | |
08c08cc1 | 131 | %endif |
e4983238 ER |
132 | |
133 | %if %{with python3} | |
134 | %files -n python3-pytest | |
135 | %defattr(644,root,root,755) | |
c4594506 | 136 | %doc AUTHORS CHANGELOG.rst LICENSE README.rst |
84b7690d JB |
137 | %attr(755,root,root) %{_bindir}/py.test-3 |
138 | %attr(755,root,root) %{_bindir}/pytest-3 | |
6b847094 | 139 | %{py3_sitescriptdir}/pytest.py |
e4983238 | 140 | %{py3_sitescriptdir}/_pytest |
6b847094 | 141 | %{py3_sitescriptdir}/__pycache__/pytest.*.py[co] |
e4983238 ER |
142 | %{py3_sitescriptdir}/pytest-%{version}-py*.egg-info |
143 | %endif | |
c4594506 JB |
144 | |
145 | %if %{with doc} | |
146 | %files apidocs | |
147 | %defattr(644,root,root,755) | |
148 | %doc _htmldocs/html | |
149 | %endif |