]> git.pld-linux.org Git - packages/python-pytest.git/blame - python-pytest.spec
- updated to 3.6.3
[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 5%bcond_without python3 # CPython 3.x module
65ffd36d 6%bcond_without tests # unit tests
e4983238 7
65ffd36d 8%define pylib_version 1.5.0
e4983238 9%define module pytest
bd571570
JB
10Summary: Simple and popular testing tool for Python
11Summary(pl.UTF-8): Proste i popularne narzędzie testujące dla Pythona
e4983238 12Name: python-%{module}
65ffd36d
JB
13Version: 3.6.3
14Release: 1
bd571570
JB
15License: MIT
16Group: Development/Languages/Python
65ffd36d 17#Source0Download: https://pypi.org/simple/pytest/
c4594506 18Source0: https://files.pythonhosted.org/packages/source/p/pytest/pytest-%{version}.tar.gz
65ffd36d
JB
19# Source0-md5: 8ca6124a3a80f9555c50f5c09056ea02
20Patch0: %{name}-tests.patch
bd571570 21URL: http://pytest.org/
08c08cc1 22%if %{with python2}
65ffd36d
JB
23BuildRequires: python-devel >= 1:2.7
24BuildRequires: python-modules >= 1:2.7
e4983238 25BuildRequires: python-py >= %{pylib_version}
2f6fd582 26BuildRequires: python-setuptools >= 7.0
65ffd36d
JB
27BuildRequires: python-setuptools_scm
28%if %{with tests}
29BuildRequires: python-atomicwrites >= 1.0
30BuildRequires: python-attrs >= 17.4.0
31BuildRequires: python-funcsigs
32BuildRequires: python-hypothesis >= 3.56
33BuildRequires: python-mock
34BuildRequires: python-nose
35BuildRequires: python-pluggy >= 0.5
36BuildRequires: python-requests
37BuildRequires: python-six >= 1.10.0
38BuildConflicts: python-pytest-catchlog
39# with xdist requires various modules source
40BuildConflicts: python-pytest-xdist
41%endif
bd571570 42%endif
e4983238 43%if %{with python3}
65ffd36d
JB
44BuildRequires: python3-devel >= 1:3.4
45BuildRequires: python3-modules >= 1:3.4
e4983238 46BuildRequires: python3-py >= %{pylib_version}
2f6fd582 47BuildRequires: python3-setuptools >= 7.0
65ffd36d
JB
48BuildRequires: python3-setuptools_scm
49%if %{with tests}
50BuildRequires: python3-atomicwrites >= 1.0
51BuildRequires: python3-attrs >= 17.4.0
52BuildRequires: python3-hypothesis >= 3.56
53BuildRequires: python3-nose
54BuildRequires: python3-pluggy >= 0.5
55BuildRequires: python3-requests
56BuildRequires: python3-six >= 1.10.0
57BuildConflicts: python3-pytest-catchlog
58%endif
e4983238 59%endif
08c08cc1
JB
60BuildRequires: rpm-pythonprov
61BuildRequires: rpmbuild(macros) >= 1.714
62BuildRequires: sed >= 4.0
63%if %{with doc}
65ffd36d
JB
64BuildRequires: python3-sphinxcontrib-trio
65BuildRequires: sphinx-pdg-3 >= 1.0
08c08cc1 66%endif
2084a849 67Requires: python-modules
84b7690d 68Requires: python-setuptools
fd6ab041 69Obsoletes: python-pytest-cache
65ffd36d 70Obsoletes: python-pytest-catchlog
bd571570
JB
71BuildArch: noarch
72BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
73
74%description
75py.test is a simple and popular testing tool for Python.
76
77%description -l pl.UTF-8
78py.test to proste i popularne narzędzie testujące dla Pythona.
79
e4983238
ER
80%package -n python3-pytest
81Summary: Simple powerful testing with Python
6b847094 82Summary(pl.UTF-8): Proste, ale funkcjonalne narzędzie testujące dla Pythona
e4983238 83Group: Development/Languages
2084a849 84Requires: python3-devel-tools
84b7690d 85Requires: python3-setuptools
fd6ab041 86Obsoletes: python3-pytest-cache
65ffd36d 87Obsoletes: python3-pytest-catchlog
e4983238
ER
88
89%description -n python3-pytest
90py.test provides simple, yet powerful testing for Python.
91
6b847094
JB
92%description -n python3-pytest -l pl.UTF-8
93py.test to proste, ale bardzo funkcjonalne narzędzie testujące dla
94Pythona.
95
c4594506
JB
96%package apidocs
97Summary: Documentation for py.test Pythona package
98Summary(pl.UTF-8): Dokumentacja pakietu Pythona py.test
99Group: Documentation
100
101%description apidocs
102Documentation for py.test Pythona package.
103
104%description apidocs -l pl.UTF-8
105Dokumentacja pakietu Pythona py.test.
106
bd571570 107%prep
e4983238 108%setup -q -n %{module}-%{version}
65ffd36d 109%patch0 -p1
e4983238 110
bd571570 111%build
08c08cc1 112%if %{with python2}
ac22139b 113%py_build
65ffd36d
JB
114
115%if %{with tests}
116PYTHONPATH=$(pwd)/src \
117%{__python} -m pytest testing
118%endif
08c08cc1 119%endif
bd571570 120
e4983238 121%if %{with python3}
ac22139b 122%py3_build
65ffd36d
JB
123
124%if %{with tests}
125PYTHONPATH=$(pwd)/src \
126%{__python3} -m pytest testing
127%endif
e4983238
ER
128%endif
129
bd571570 130%if %{with doc}
e4983238 131for l in doc/*; do
65ffd36d
JB
132 PYTHONPATH=$(pwd)/src \
133 %{__make} -C $l html \
134 SPHINXBUILD=sphinx-build-3
e4983238 135done
bd571570
JB
136%endif
137
138%install
139rm -rf $RPM_BUILD_ROOT
ac22139b
JK
140
141%if %{with python3}
142%py3_install
84b7690d
JB
143
144%{__mv} $RPM_BUILD_ROOT%{_bindir}/py.test{,-3}
145%{__mv} $RPM_BUILD_ROOT%{_bindir}/pytest{,-3}
65ffd36d
JB
146
147# avoid python3egg(funcsigs) dependency
148%{__sed} -i -e '/^\[:python_version < "3\.0"]/,/^$/ d' $RPM_BUILD_ROOT%{py3_sitescriptdir}/pytest-%{version}-py*.egg-info/requires.txt
ac22139b
JK
149%endif
150
08c08cc1 151%if %{with python2}
ac22139b 152%py_install
bd571570 153
84b7690d
JB
154ln $RPM_BUILD_ROOT%{_bindir}/py.test{,-2}
155ln $RPM_BUILD_ROOT%{_bindir}/pytest{,-2}
156
08c08cc1
JB
157# pytest.py source seems required for "monkeypatching" tests
158%py_postclean -x pytest.py
159%endif
bd571570
JB
160
161%clean
162rm -rf $RPM_BUILD_ROOT
163
08c08cc1 164%if %{with python2}
bd571570
JB
165%files
166%defattr(644,root,root,755)
c4594506 167%doc AUTHORS CHANGELOG.rst LICENSE README.rst
bd571570 168%attr(755,root,root) %{_bindir}/py.test
84b7690d
JB
169%attr(755,root,root) %{_bindir}/py.test-2
170%attr(755,root,root) %{_bindir}/pytest
171%attr(755,root,root) %{_bindir}/pytest-2
08c08cc1 172%{py_sitescriptdir}/pytest.py*
bd571570
JB
173%{py_sitescriptdir}/_pytest
174%{py_sitescriptdir}/pytest-%{version}-py*.egg-info
08c08cc1 175%endif
e4983238
ER
176
177%if %{with python3}
178%files -n python3-pytest
179%defattr(644,root,root,755)
c4594506 180%doc AUTHORS CHANGELOG.rst LICENSE README.rst
84b7690d
JB
181%attr(755,root,root) %{_bindir}/py.test-3
182%attr(755,root,root) %{_bindir}/pytest-3
6b847094 183%{py3_sitescriptdir}/pytest.py
e4983238 184%{py3_sitescriptdir}/_pytest
6b847094 185%{py3_sitescriptdir}/__pycache__/pytest.*.py[co]
e4983238
ER
186%{py3_sitescriptdir}/pytest-%{version}-py*.egg-info
187%endif
c4594506
JB
188
189%if %{with doc}
190%files apidocs
191%defattr(644,root,root,755)
65ffd36d 192%doc doc/en/_build/html/{_images,_modules,_static,announce,example,proposals,*.html,*.js}
c4594506 193%endif
This page took 0.147712 seconds and 4 git commands to generate.