]> git.pld-linux.org Git - packages/python3-pytest.git/blame - python3-pytest.spec
- versioned Obsoletes
[packages/python3-pytest.git] / python3-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
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
fe60a648 11Name: python3-%{module}
dcfaa027
AM
12Version: 6.2.2
13Release: 1
bd571570
JB
14License: MIT
15Group: Development/Languages/Python
65ffd36d 16#Source0Download: https://pypi.org/simple/pytest/
c4594506 17Source0: https://files.pythonhosted.org/packages/source/p/pytest/pytest-%{version}.tar.gz
dcfaa027 18# Source0-md5: 828d15f426ce9740627a9b07e47a318a
65ffd36d 19Patch0: %{name}-tests.patch
7359165f 20URL: https://pytest.org/
793efa43
JB
21BuildRequires: python3-devel >= 1:3.6
22BuildRequires: python3-modules >= 1:3.6
23BuildRequires: python3-py >= 1.8.2
24BuildRequires: python3-setuptools >= 1:42.0
25BuildRequires: python3-setuptools_scm >= 3.4
26BuildRequires: python3-toml
65ffd36d 27%if %{with tests}
793efa43 28BuildRequires: pydoc3 >= 1:3.6
aa356db6 29BuildRequires: python3-argcomplete
793efa43 30BuildRequires: python3-attrs >= 19.2.0
65ffd36d 31BuildRequires: python3-hypothesis >= 3.56
aa356db6
JB
32%if "%{py3_ver}" < "3.8"
33BuildRequires: python3-importlib_metadata >= 0.12
34%endif
793efa43 35BuildRequires: python3-iniconfig
65ffd36d 36BuildRequires: python3-nose
7359165f 37BuildRequires: python3-packaging
aa356db6 38BuildRequires: python3-pluggy >= 0.12
7359165f 39BuildRequires: python3-pluggy < 1.0
793efa43 40BuildRequires: python3-pygments >= 2.7.2
65ffd36d 41BuildRequires: python3-requests
fe60a648 42BuildRequires: python3-xmlschema
aa356db6 43BuildConflicts: python3-pytest-benchmark < 3.2.1
7359165f 44# outdated
65ffd36d 45BuildConflicts: python3-pytest-catchlog
7359165f 46# seems to break things
0537ae48 47BuildConflicts: python3-pytest-xdist
65ffd36d 48%endif
08c08cc1
JB
49BuildRequires: rpm-pythonprov
50BuildRequires: rpmbuild(macros) >= 1.714
51BuildRequires: sed >= 4.0
52%if %{with doc}
793efa43
JB
53BuildRequires: python3-pallets-sphinx-themes
54BuildRequires: python3-pygments_pytest >= 1.1.0
7359165f 55BuildRequires: python3-sphinx_removed_in >= 0.2.0
65ffd36d 56BuildRequires: python3-sphinxcontrib-trio
793efa43 57BuildRequires: sphinx-pdg-3 >= 3.1
08c08cc1 58%endif
793efa43
JB
59Requires: python3-modules >= 1:3.6
60Requires: python3-setuptools >= 1:42.0
ddbe3b8a
JB
61Obsoletes: python3-pytest-cache < 1.1
62Obsoletes: python3-pytest-catchlog < 1.2.3
3c0bb99f 63Conflicts: python-pytest < 4.6.11-2
bd571570
JB
64BuildArch: noarch
65BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
66
67%description
68py.test is a simple and popular testing tool for Python.
69
70%description -l pl.UTF-8
71py.test to proste i popularne narzędzie testujące dla Pythona.
72
c4594506
JB
73%package apidocs
74Summary: Documentation for py.test Pythona package
75Summary(pl.UTF-8): Dokumentacja pakietu Pythona py.test
76Group: Documentation
77
78%description apidocs
79Documentation for py.test Pythona package.
80
81%description apidocs -l pl.UTF-8
82Dokumentacja pakietu Pythona py.test.
83
bd571570 84%prep
e4983238 85%setup -q -n %{module}-%{version}
65ffd36d 86%patch0 -p1
e4983238 87
bd571570 88%build
7359165f 89export PYTEST_DISABLE_PLUGIN_AUTOLOAD=1
ac22139b 90%py3_build
65ffd36d
JB
91
92%if %{with tests}
9c502aa4
JB
93# test_pdb_custom_cls_with_settrace fails without preinstalled pytest
94# test_pdb_* which spawn pdb hang under some unclear conditions
3de7690a
JB
95# ...and most test_debugging tests require ptys
96# test_spawn_uses_tmphome and some terminal tests require ptys
65ffd36d 97PYTHONPATH=$(pwd)/src \
3de7690a 98%{__python3} -m pytest -k 'not (test_debugging or test_spawn_uses_tmphome or test_runtest_location_shown_before_test_starts or test_report_collect_after_half_a_second or test_trial_pdb)' testing
65ffd36d 99%endif
e4983238 100
bd571570 101%if %{with doc}
e4983238 102for l in doc/*; do
65ffd36d
JB
103 PYTHONPATH=$(pwd)/src \
104 %{__make} -C $l html \
105 SPHINXBUILD=sphinx-build-3
e4983238 106done
bd571570
JB
107%endif
108
109%install
110rm -rf $RPM_BUILD_ROOT
ac22139b 111
ac22139b 112%py3_install
84b7690d
JB
113
114%{__mv} $RPM_BUILD_ROOT%{_bindir}/py.test{,-3}
115%{__mv} $RPM_BUILD_ROOT%{_bindir}/pytest{,-3}
84b7690d 116
fe60a648
JB
117ln -sf py.test-3 $RPM_BUILD_ROOT%{_bindir}/py.test
118ln -sf pytest-3 $RPM_BUILD_ROOT%{_bindir}/pytest
bd571570
JB
119
120%clean
121rm -rf $RPM_BUILD_ROOT
122
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 127%attr(755,root,root) %{_bindir}/py.test-3
fe60a648 128%attr(755,root,root) %{_bindir}/pytest
84b7690d 129%attr(755,root,root) %{_bindir}/pytest-3
fe60a648 130%{py3_sitescriptdir}/pytest
e4983238 131%{py3_sitescriptdir}/_pytest
e4983238 132%{py3_sitescriptdir}/pytest-%{version}-py*.egg-info
c4594506
JB
133
134%if %{with doc}
135%files apidocs
136%defattr(644,root,root,755)
65ffd36d 137%doc doc/en/_build/html/{_images,_modules,_static,announce,example,proposals,*.html,*.js}
c4594506 138%endif
This page took 0.111064 seconds and 4 git commands to generate.