]>
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 | 12 | Version: 3.0.7 |
2084a849 | 13 | Release: 2 |
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 | |
2084a849 | 38 | Requires: python-modules |
84b7690d | 39 | Requires: python-setuptools |
fd6ab041 | 40 | Obsoletes: python-pytest-cache |
bd571570 JB |
41 | BuildArch: noarch |
42 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
43 | ||
44 | %description | |
45 | py.test is a simple and popular testing tool for Python. | |
46 | ||
47 | %description -l pl.UTF-8 | |
48 | py.test to proste i popularne narzędzie testujące dla Pythona. | |
49 | ||
e4983238 ER |
50 | %package -n python3-pytest |
51 | Summary: Simple powerful testing with Python | |
6b847094 | 52 | Summary(pl.UTF-8): Proste, ale funkcjonalne narzędzie testujące dla Pythona |
e4983238 | 53 | Group: Development/Languages |
2084a849 | 54 | Requires: python3-devel-tools |
84b7690d | 55 | Requires: python3-setuptools |
fd6ab041 | 56 | Obsoletes: python3-pytest-cache |
e4983238 ER |
57 | |
58 | %description -n python3-pytest | |
59 | py.test provides simple, yet powerful testing for Python. | |
60 | ||
6b847094 JB |
61 | %description -n python3-pytest -l pl.UTF-8 |
62 | py.test to proste, ale bardzo funkcjonalne narzędzie testujące dla | |
63 | Pythona. | |
64 | ||
c4594506 JB |
65 | %package apidocs |
66 | Summary: Documentation for py.test Pythona package | |
67 | Summary(pl.UTF-8): Dokumentacja pakietu Pythona py.test | |
68 | Group: Documentation | |
69 | ||
70 | %description apidocs | |
71 | Documentation for py.test Pythona package. | |
72 | ||
73 | %description apidocs -l pl.UTF-8 | |
74 | Dokumentacja pakietu Pythona py.test. | |
75 | ||
bd571570 | 76 | %prep |
e4983238 ER |
77 | %setup -q -n %{module}-%{version} |
78 | ||
bd571570 | 79 | %build |
08c08cc1 | 80 | %if %{with python2} |
ac22139b | 81 | %py_build |
08c08cc1 | 82 | %endif |
bd571570 | 83 | |
e4983238 | 84 | %if %{with python3} |
ac22139b | 85 | %py3_build |
e4983238 ER |
86 | %endif |
87 | ||
bd571570 | 88 | %if %{with doc} |
e4983238 ER |
89 | install -d _htmldocs/html |
90 | for l in doc/*; do | |
91 | PYTHONPATH=$(pwd) \ | |
92 | %{__make} -C $l html | |
93 | # remove hidden file | |
c4594506 JB |
94 | %{__rm} $l/_build/html/.buildinfo |
95 | %{__mv} $l/_build/html _htmldocs/html/${l##doc/} | |
e4983238 | 96 | done |
bd571570 JB |
97 | %endif |
98 | ||
99 | %install | |
100 | rm -rf $RPM_BUILD_ROOT | |
ac22139b JK |
101 | |
102 | %if %{with python3} | |
103 | %py3_install | |
84b7690d JB |
104 | |
105 | %{__mv} $RPM_BUILD_ROOT%{_bindir}/py.test{,-3} | |
106 | %{__mv} $RPM_BUILD_ROOT%{_bindir}/pytest{,-3} | |
ac22139b JK |
107 | %endif |
108 | ||
08c08cc1 | 109 | %if %{with python2} |
ac22139b | 110 | %py_install |
bd571570 | 111 | |
84b7690d JB |
112 | ln $RPM_BUILD_ROOT%{_bindir}/py.test{,-2} |
113 | ln $RPM_BUILD_ROOT%{_bindir}/pytest{,-2} | |
114 | ||
08c08cc1 JB |
115 | # pytest.py source seems required for "monkeypatching" tests |
116 | %py_postclean -x pytest.py | |
117 | %endif | |
bd571570 JB |
118 | |
119 | %clean | |
120 | rm -rf $RPM_BUILD_ROOT | |
121 | ||
08c08cc1 | 122 | %if %{with python2} |
bd571570 JB |
123 | %files |
124 | %defattr(644,root,root,755) | |
c4594506 | 125 | %doc AUTHORS CHANGELOG.rst LICENSE README.rst |
bd571570 | 126 | %attr(755,root,root) %{_bindir}/py.test |
84b7690d JB |
127 | %attr(755,root,root) %{_bindir}/py.test-2 |
128 | %attr(755,root,root) %{_bindir}/pytest | |
129 | %attr(755,root,root) %{_bindir}/pytest-2 | |
08c08cc1 | 130 | %{py_sitescriptdir}/pytest.py* |
bd571570 JB |
131 | %{py_sitescriptdir}/_pytest |
132 | %{py_sitescriptdir}/pytest-%{version}-py*.egg-info | |
08c08cc1 | 133 | %endif |
e4983238 ER |
134 | |
135 | %if %{with python3} | |
136 | %files -n python3-pytest | |
137 | %defattr(644,root,root,755) | |
c4594506 | 138 | %doc AUTHORS CHANGELOG.rst LICENSE README.rst |
84b7690d JB |
139 | %attr(755,root,root) %{_bindir}/py.test-3 |
140 | %attr(755,root,root) %{_bindir}/pytest-3 | |
6b847094 | 141 | %{py3_sitescriptdir}/pytest.py |
e4983238 | 142 | %{py3_sitescriptdir}/_pytest |
6b847094 | 143 | %{py3_sitescriptdir}/__pycache__/pytest.*.py[co] |
e4983238 ER |
144 | %{py3_sitescriptdir}/pytest-%{version}-py*.egg-info |
145 | %endif | |
c4594506 JB |
146 | |
147 | %if %{with doc} | |
148 | %files apidocs | |
149 | %defattr(644,root,root,755) | |
150 | %doc _htmldocs/html | |
151 | %endif |