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