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