]> git.pld-linux.org Git - packages/python3-pytest.git/blob - python3-pytest.spec
- versioned Obsoletes
[packages/python3-pytest.git] / python3-pytest.spec
1 #
2 # Conditional build:
3 %bcond_without  doc     # HTML documentation build
4 %bcond_without  python2 # CPython 2.x module
5 %bcond_without  python3 # CPython 3.x module
6 %bcond_without  tests   # unit tests
7
8 %define         module  pytest
9 Summary:        Simple and popular testing tool for Python
10 Summary(pl.UTF-8):      Proste i popularne narzędzie testujące dla Pythona
11 Name:           python3-%{module}
12 Version:        6.2.2
13 Release:        1
14 License:        MIT
15 Group:          Development/Languages/Python
16 #Source0Download: https://pypi.org/simple/pytest/
17 Source0:        https://files.pythonhosted.org/packages/source/p/pytest/pytest-%{version}.tar.gz
18 # Source0-md5:  828d15f426ce9740627a9b07e47a318a
19 Patch0:         %{name}-tests.patch
20 URL:            https://pytest.org/
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
27 %if %{with tests}
28 BuildRequires:  pydoc3 >= 1:3.6
29 BuildRequires:  python3-argcomplete
30 BuildRequires:  python3-attrs >= 19.2.0
31 BuildRequires:  python3-hypothesis >= 3.56
32 %if "%{py3_ver}" < "3.8"
33 BuildRequires:  python3-importlib_metadata >= 0.12
34 %endif
35 BuildRequires:  python3-iniconfig
36 BuildRequires:  python3-nose
37 BuildRequires:  python3-packaging
38 BuildRequires:  python3-pluggy >= 0.12
39 BuildRequires:  python3-pluggy < 1.0
40 BuildRequires:  python3-pygments >= 2.7.2
41 BuildRequires:  python3-requests
42 BuildRequires:  python3-xmlschema
43 BuildConflicts: python3-pytest-benchmark < 3.2.1
44 # outdated
45 BuildConflicts: python3-pytest-catchlog
46 # seems to break things
47 BuildConflicts: python3-pytest-xdist
48 %endif
49 BuildRequires:  rpm-pythonprov
50 BuildRequires:  rpmbuild(macros) >= 1.714
51 BuildRequires:  sed >= 4.0
52 %if %{with doc}
53 BuildRequires:  python3-pallets-sphinx-themes
54 BuildRequires:  python3-pygments_pytest >= 1.1.0
55 BuildRequires:  python3-sphinx_removed_in >= 0.2.0
56 BuildRequires:  python3-sphinxcontrib-trio
57 BuildRequires:  sphinx-pdg-3 >= 3.1
58 %endif
59 Requires:       python3-modules >= 1:3.6
60 Requires:       python3-setuptools >= 1:42.0
61 Obsoletes:      python3-pytest-cache < 1.1
62 Obsoletes:      python3-pytest-catchlog < 1.2.3
63 Conflicts:      python-pytest < 4.6.11-2
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
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
84 %prep
85 %setup -q -n %{module}-%{version}
86 %patch0 -p1
87
88 %build
89 export PYTEST_DISABLE_PLUGIN_AUTOLOAD=1
90 %py3_build
91
92 %if %{with tests}
93 # test_pdb_custom_cls_with_settrace fails without preinstalled pytest
94 # test_pdb_* which spawn pdb hang under some unclear conditions
95 # ...and most test_debugging tests require ptys
96 # test_spawn_uses_tmphome and some terminal tests require ptys
97 PYTHONPATH=$(pwd)/src \
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
99 %endif
100
101 %if %{with doc}
102 for l in doc/*; do
103         PYTHONPATH=$(pwd)/src \
104         %{__make} -C $l html \
105                 SPHINXBUILD=sphinx-build-3
106 done
107 %endif
108
109 %install
110 rm -rf $RPM_BUILD_ROOT
111
112 %py3_install
113
114 %{__mv} $RPM_BUILD_ROOT%{_bindir}/py.test{,-3}
115 %{__mv} $RPM_BUILD_ROOT%{_bindir}/pytest{,-3}
116
117 ln -sf py.test-3 $RPM_BUILD_ROOT%{_bindir}/py.test
118 ln -sf pytest-3 $RPM_BUILD_ROOT%{_bindir}/pytest
119
120 %clean
121 rm -rf $RPM_BUILD_ROOT
122
123 %files
124 %defattr(644,root,root,755)
125 %doc AUTHORS CHANGELOG.rst LICENSE README.rst
126 %attr(755,root,root) %{_bindir}/py.test
127 %attr(755,root,root) %{_bindir}/py.test-3
128 %attr(755,root,root) %{_bindir}/pytest
129 %attr(755,root,root) %{_bindir}/pytest-3
130 %{py3_sitescriptdir}/pytest
131 %{py3_sitescriptdir}/_pytest
132 %{py3_sitescriptdir}/pytest-%{version}-py*.egg-info
133
134 %if %{with doc}
135 %files apidocs
136 %defattr(644,root,root,755)
137 %doc doc/en/_build/html/{_images,_modules,_static,announce,example,proposals,*.html,*.js}
138 %endif
This page took 0.118521 seconds and 3 git commands to generate.