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