]>
Commit | Line | Data |
---|---|---|
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 |
9 | Summary: Simple and popular testing tool for Python |
10 | Summary(pl.UTF-8): Proste i popularne narzędzie testujące dla Pythona | |
fe60a648 | 11 | Name: python3-%{module} |
dcfaa027 AM |
12 | Version: 6.2.2 |
13 | Release: 1 | |
bd571570 JB |
14 | License: MIT |
15 | Group: Development/Languages/Python | |
65ffd36d | 16 | #Source0Download: https://pypi.org/simple/pytest/ |
c4594506 | 17 | Source0: https://files.pythonhosted.org/packages/source/p/pytest/pytest-%{version}.tar.gz |
dcfaa027 | 18 | # Source0-md5: 828d15f426ce9740627a9b07e47a318a |
65ffd36d | 19 | Patch0: %{name}-tests.patch |
7359165f | 20 | URL: https://pytest.org/ |
793efa43 JB |
21 | BuildRequires: python3-devel >= 1:3.6 |
22 | BuildRequires: python3-modules >= 1:3.6 | |
23 | BuildRequires: python3-py >= 1.8.2 | |
24 | BuildRequires: python3-setuptools >= 1:42.0 | |
25 | BuildRequires: python3-setuptools_scm >= 3.4 | |
26 | BuildRequires: python3-toml | |
65ffd36d | 27 | %if %{with tests} |
793efa43 | 28 | BuildRequires: pydoc3 >= 1:3.6 |
aa356db6 | 29 | BuildRequires: python3-argcomplete |
793efa43 | 30 | BuildRequires: python3-attrs >= 19.2.0 |
65ffd36d | 31 | BuildRequires: python3-hypothesis >= 3.56 |
aa356db6 JB |
32 | %if "%{py3_ver}" < "3.8" |
33 | BuildRequires: python3-importlib_metadata >= 0.12 | |
34 | %endif | |
793efa43 | 35 | BuildRequires: python3-iniconfig |
65ffd36d | 36 | BuildRequires: python3-nose |
7359165f | 37 | BuildRequires: python3-packaging |
aa356db6 | 38 | BuildRequires: python3-pluggy >= 0.12 |
7359165f | 39 | BuildRequires: python3-pluggy < 1.0 |
793efa43 | 40 | BuildRequires: python3-pygments >= 2.7.2 |
65ffd36d | 41 | BuildRequires: python3-requests |
fe60a648 | 42 | BuildRequires: python3-xmlschema |
aa356db6 | 43 | BuildConflicts: python3-pytest-benchmark < 3.2.1 |
7359165f | 44 | # outdated |
65ffd36d | 45 | BuildConflicts: python3-pytest-catchlog |
7359165f | 46 | # seems to break things |
0537ae48 | 47 | BuildConflicts: python3-pytest-xdist |
65ffd36d | 48 | %endif |
08c08cc1 JB |
49 | BuildRequires: rpm-pythonprov |
50 | BuildRequires: rpmbuild(macros) >= 1.714 | |
51 | BuildRequires: sed >= 4.0 | |
52 | %if %{with doc} | |
793efa43 JB |
53 | BuildRequires: python3-pallets-sphinx-themes |
54 | BuildRequires: python3-pygments_pytest >= 1.1.0 | |
7359165f | 55 | BuildRequires: python3-sphinx_removed_in >= 0.2.0 |
65ffd36d | 56 | BuildRequires: python3-sphinxcontrib-trio |
793efa43 | 57 | BuildRequires: sphinx-pdg-3 >= 3.1 |
08c08cc1 | 58 | %endif |
793efa43 JB |
59 | Requires: python3-modules >= 1:3.6 |
60 | Requires: python3-setuptools >= 1:42.0 | |
ddbe3b8a JB |
61 | Obsoletes: python3-pytest-cache < 1.1 |
62 | Obsoletes: python3-pytest-catchlog < 1.2.3 | |
3c0bb99f | 63 | Conflicts: python-pytest < 4.6.11-2 |
bd571570 JB |
64 | BuildArch: noarch |
65 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
66 | ||
67 | %description | |
68 | py.test is a simple and popular testing tool for Python. | |
69 | ||
70 | %description -l pl.UTF-8 | |
71 | py.test to proste i popularne narzędzie testujące dla Pythona. | |
72 | ||
c4594506 JB |
73 | %package apidocs |
74 | Summary: Documentation for py.test Pythona package | |
75 | Summary(pl.UTF-8): Dokumentacja pakietu Pythona py.test | |
76 | Group: Documentation | |
77 | ||
78 | %description apidocs | |
79 | Documentation for py.test Pythona package. | |
80 | ||
81 | %description apidocs -l pl.UTF-8 | |
82 | Dokumentacja 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 | 89 | export 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 | 97 | PYTHONPATH=$(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 | 102 | for l in doc/*; do |
65ffd36d JB |
103 | PYTHONPATH=$(pwd)/src \ |
104 | %{__make} -C $l html \ | |
105 | SPHINXBUILD=sphinx-build-3 | |
e4983238 | 106 | done |
bd571570 JB |
107 | %endif |
108 | ||
109 | %install | |
110 | rm -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 |
117 | ln -sf py.test-3 $RPM_BUILD_ROOT%{_bindir}/py.test |
118 | ln -sf pytest-3 $RPM_BUILD_ROOT%{_bindir}/pytest | |
bd571570 JB |
119 | |
120 | %clean | |
121 | rm -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 |