]> git.pld-linux.org Git - packages/python-pytest.git/blame - python-pytest.spec
- pl for python3-; setuptools in optional at runtime
[packages/python-pytest.git] / python-pytest.spec
CommitLineData
bd571570
JB
1#
2# Conditional build:
3%bcond_without doc # HTML documentation build
e4983238
ER
4%bcond_without python3 # CPython 3.x module
5
6%define pylib_version 1.4.12
7%define module pytest
bd571570
JB
8Summary: Simple and popular testing tool for Python
9Summary(pl.UTF-8): Proste i popularne narzędzie testujące dla Pythona
e4983238
ER
10Name: python-%{module}
11Version: 2.3.4
bd571570
JB
12Release: 1
13License: MIT
14Group: Development/Languages/Python
15Source0: http://pypi.python.org/packages/source/p/pytest/pytest-%{version}.zip
e4983238 16# Source0-md5: db319fef9c310dc46798b285d3da3aa1
bd571570
JB
17URL: http://pytest.org/
18BuildRequires: python-devel >= 2.4
e4983238 19BuildRequires: python-py >= %{pylib_version}
bd571570
JB
20BuildRequires: rpm-pythonprov
21BuildRequires: rpmbuild(macros) >= 1.219
e4983238 22BuildRequires: sed >= 4.0
bd571570 23%if %{with doc}
bd571570
JB
24BuildRequires: sphinx-pdg >= 1.0
25%endif
e4983238
ER
26%if %{with python3}
27BuildRequires: python3-devel
6b847094 28BuildRequires: python3-distribute
e4983238
ER
29BuildRequires: python3-modules
30BuildRequires: python3-py >= %{pylib_version}
e4983238
ER
31%endif
32Requires: python-py >= %{pylib_version}
bd571570
JB
33BuildArch: noarch
34BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
35
36%description
37py.test is a simple and popular testing tool for Python.
38
39%description -l pl.UTF-8
40py.test to proste i popularne narzędzie testujące dla Pythona.
41
e4983238
ER
42%package -n python3-pytest
43Summary: Simple powerful testing with Python
6b847094 44Summary(pl.UTF-8): Proste, ale funkcjonalne narzędzie testujące dla Pythona
e4983238
ER
45Group: Development/Languages
46Requires: python3-py >= %{pylib_version}
6b847094 47Suggests: python3-setuptools
e4983238
ER
48
49%description -n python3-pytest
50py.test provides simple, yet powerful testing for Python.
51
6b847094
JB
52%description -n python3-pytest -l pl.UTF-8
53py.test to proste, ale bardzo funkcjonalne narzędzie testujące dla
54Pythona.
55
bd571570 56%prep
e4983238
ER
57%setup -q -n %{module}-%{version}
58
59%if %{with python3}
60rm -rf build-3
61set -- *
62install -d build-3
63cp -a "$@" build-3
64find build-3 -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|'
65%endif
bd571570
JB
66
67%build
68%{__python} setup.py build
69
e4983238
ER
70%if %{with python3}
71%{__python3} setup.py \
72 build -b build-3
73%endif
74
bd571570 75%if %{with doc}
e4983238
ER
76install -d _htmldocs/html
77for l in doc/*; do
78 PYTHONPATH=$(pwd) \
79 %{__make} -C $l html
80 # remove hidden file
81 rm $l/_build/html/.buildinfo
82 mv $l/_build/html _htmldocs/html/${l##doc/}
83done
bd571570
JB
84%endif
85
86%install
87rm -rf $RPM_BUILD_ROOT
e4983238
ER
88%{__python3} -- setup.py \
89 build -b build-3 \
90 install \
91 --root=$RPM_BUILD_ROOT \
92 --optimize=2
93
bd571570
JB
94%{__python} setup.py install \
95 --optimize=2 \
96 --root=$RPM_BUILD_ROOT
97
98%py_postclean
99
100%clean
101rm -rf $RPM_BUILD_ROOT
102
103%files
104%defattr(644,root,root,755)
e4983238 105%doc CHANGELOG LICENSE README.txt %{?with_doc:_htmldocs/html}
bd571570
JB
106%attr(755,root,root) %{_bindir}/py.test
107%attr(755,root,root) %{_bindir}/py.test-%{py_ver}
108%{py_sitescriptdir}/pytest.py[co]
109%{py_sitescriptdir}/_pytest
110%{py_sitescriptdir}/pytest-%{version}-py*.egg-info
e4983238
ER
111
112%if %{with python3}
113%files -n python3-pytest
114%defattr(644,root,root,755)
115%doc CHANGELOG LICENSE README.txt %{?with_doc:_htmldocs/html}
116%attr(755,root,root) %{_bindir}/py.test-%{py3_ver}
6b847094 117%{py3_sitescriptdir}/pytest.py
e4983238 118%{py3_sitescriptdir}/_pytest
6b847094 119%{py3_sitescriptdir}/__pycache__/pytest.*.py[co]
e4983238
ER
120%{py3_sitescriptdir}/pytest-%{version}-py*.egg-info
121%endif
This page took 0.038959 seconds and 4 git commands to generate.