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