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