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