]> git.pld-linux.org Git - packages/python-pytest.git/blob - python-pytest.spec
require package containing pdb
[packages/python-pytest.git] / python-pytest.spec
1 #
2 # Conditional build:
3 %bcond_without  doc     # HTML documentation build
4 %bcond_without  python2 # CPython 2.x module
5 %bcond_without  python3 # CPython 3.x module
6
7 %define         pylib_version   1.4.29
8 %define         module  pytest
9 Summary:        Simple and popular testing tool for Python
10 Summary(pl.UTF-8):      Proste i popularne narzędzie testujące dla Pythona
11 Name:           python-%{module}
12 Version:        3.0.7
13 Release:        2
14 License:        MIT
15 Group:          Development/Languages/Python
16 #Source0Download: https://pypi.python.org/simple/pytest
17 Source0:        https://files.pythonhosted.org/packages/source/p/pytest/pytest-%{version}.tar.gz
18 # Source0-md5:  89c60546507dc7eb6e9e40a6e9f720bd
19 URL:            http://pytest.org/
20 %if %{with python2}
21 BuildRequires:  python-devel >= 1:2.6
22 BuildRequires:  python-modules >= 1:2.6
23 BuildRequires:  python-py >= %{pylib_version}
24 BuildRequires:  python-setuptools >= 7.0
25 %endif
26 %if %{with python3}
27 BuildRequires:  python3-devel >= 1:3.3
28 BuildRequires:  python3-modules >= 1:3.3
29 BuildRequires:  python3-py >= %{pylib_version}
30 BuildRequires:  python3-setuptools >= 7.0
31 %endif
32 BuildRequires:  rpm-pythonprov
33 BuildRequires:  rpmbuild(macros) >= 1.714
34 BuildRequires:  sed >= 4.0
35 %if %{with doc}
36 BuildRequires:  sphinx-pdg >= 1.0
37 %endif
38 Requires:       python-modules
39 Requires:       python-setuptools
40 Obsoletes:      python-pytest-cache
41 BuildArch:      noarch
42 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
43
44 %description
45 py.test is a simple and popular testing tool for Python.
46
47 %description -l pl.UTF-8
48 py.test to proste i popularne narzędzie testujące dla Pythona.
49
50 %package -n python3-pytest
51 Summary:        Simple powerful testing with Python
52 Summary(pl.UTF-8):      Proste, ale funkcjonalne narzędzie testujące dla Pythona
53 Group:          Development/Languages
54 Requires:       python3-devel-tools
55 Requires:       python3-setuptools
56 Obsoletes:      python3-pytest-cache
57
58 %description -n python3-pytest
59 py.test provides simple, yet powerful testing for Python.
60
61 %description -n python3-pytest -l pl.UTF-8
62 py.test to proste, ale bardzo funkcjonalne narzędzie testujące dla
63 Pythona.
64
65 %package apidocs
66 Summary:        Documentation for py.test Pythona package
67 Summary(pl.UTF-8):      Dokumentacja pakietu Pythona py.test
68 Group:          Documentation
69
70 %description apidocs
71 Documentation for py.test Pythona package.
72
73 %description apidocs -l pl.UTF-8
74 Dokumentacja pakietu Pythona py.test.
75
76 %prep
77 %setup -q -n %{module}-%{version}
78
79 %build
80 %if %{with python2}
81 %py_build
82 %endif
83
84 %if %{with python3}
85 %py3_build
86 %endif
87
88 %if %{with doc}
89 install -d _htmldocs/html
90 for l in doc/*; do
91         PYTHONPATH=$(pwd) \
92         %{__make} -C $l html
93         # remove hidden file
94         %{__rm} $l/_build/html/.buildinfo
95         %{__mv} $l/_build/html _htmldocs/html/${l##doc/}
96 done
97 %endif
98
99 %install
100 rm -rf $RPM_BUILD_ROOT
101
102 %if %{with python3}
103 %py3_install
104
105 %{__mv} $RPM_BUILD_ROOT%{_bindir}/py.test{,-3}
106 %{__mv} $RPM_BUILD_ROOT%{_bindir}/pytest{,-3}
107 %endif
108
109 %if %{with python2}
110 %py_install
111
112 ln $RPM_BUILD_ROOT%{_bindir}/py.test{,-2}
113 ln $RPM_BUILD_ROOT%{_bindir}/pytest{,-2}
114
115 # pytest.py source seems required for "monkeypatching" tests
116 %py_postclean -x pytest.py
117 %endif
118
119 %clean
120 rm -rf $RPM_BUILD_ROOT
121
122 %if %{with python2}
123 %files
124 %defattr(644,root,root,755)
125 %doc AUTHORS CHANGELOG.rst LICENSE README.rst
126 %attr(755,root,root) %{_bindir}/py.test
127 %attr(755,root,root) %{_bindir}/py.test-2
128 %attr(755,root,root) %{_bindir}/pytest
129 %attr(755,root,root) %{_bindir}/pytest-2
130 %{py_sitescriptdir}/pytest.py*
131 %{py_sitescriptdir}/_pytest
132 %{py_sitescriptdir}/pytest-%{version}-py*.egg-info
133 %endif
134
135 %if %{with python3}
136 %files -n python3-pytest
137 %defattr(644,root,root,755)
138 %doc AUTHORS CHANGELOG.rst LICENSE README.rst
139 %attr(755,root,root) %{_bindir}/py.test-3
140 %attr(755,root,root) %{_bindir}/pytest-3
141 %{py3_sitescriptdir}/pytest.py
142 %{py3_sitescriptdir}/_pytest
143 %{py3_sitescriptdir}/__pycache__/pytest.*.py[co]
144 %{py3_sitescriptdir}/pytest-%{version}-py*.egg-info
145 %endif
146
147 %if %{with doc}
148 %files apidocs
149 %defattr(644,root,root,755)
150 %doc _htmldocs/html
151 %endif
This page took 0.11376 seconds and 3 git commands to generate.