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