]> git.pld-linux.org Git - packages/python3-pytest.git/blob - python3-pytest.spec
8b67cdea78027e7cd68064de279276b67a597fef
[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.5
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:  8bc467ebd5d571778dc51dd87ff09513
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 < 2.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-pluggy >= 1.0
55 BuildRequires:  python3-pygments_pytest >= 1.1.0
56 BuildRequires:  python3-sphinx_removed_in >= 0.2.0
57 BuildRequires:  python3-sphinxcontrib-trio
58 BuildRequires:  sphinx-pdg-3 >= 3.1
59 #BuildRequires: sphinx-pdg-3 < 4 (? doc/en/requirements.txt says so)
60 %endif
61 Requires:       python3-modules >= 1:3.6
62 Requires:       python3-setuptools >= 1:42.0
63 Obsoletes:      python3-pytest-cache < 1.1
64 Obsoletes:      python3-pytest-catchlog < 1.2.3
65 Conflicts:      python-pytest < 4.6.11-2
66 BuildArch:      noarch
67 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
68
69 %description
70 py.test is a simple and popular testing tool for Python.
71
72 %description -l pl.UTF-8
73 py.test to proste i popularne narzędzie testujące dla Pythona.
74
75 %package apidocs
76 Summary:        Documentation for py.test Pythona package
77 Summary(pl.UTF-8):      Dokumentacja pakietu Pythona py.test
78 Group:          Documentation
79
80 %description apidocs
81 Documentation for py.test Pythona package.
82
83 %description apidocs -l pl.UTF-8
84 Dokumentacja pakietu Pythona py.test.
85
86 %prep
87 %setup -q -n %{module}-%{version}
88 %patch0 -p1
89
90 %build
91 export PYTEST_DISABLE_PLUGIN_AUTOLOAD=1
92 %py3_build
93
94 %if %{with tests}
95 # test_pdb_custom_cls_with_settrace fails without preinstalled pytest
96 # test_pdb_* which spawn pdb hang under some unclear conditions
97 # ...and most test_debugging tests require ptys
98 # test_spawn_uses_tmphome and some terminal tests require ptys
99 PYTHONPATH=$(pwd)/src \
100 %{__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
101 %endif
102
103 %if %{with doc}
104 for l in doc/*; do
105         PYTHONPATH=$(pwd)/src \
106         %{__make} -C $l html \
107                 SPHINXBUILD=sphinx-build-3
108 done
109 %endif
110
111 %install
112 rm -rf $RPM_BUILD_ROOT
113
114 %py3_install
115
116 %{__mv} $RPM_BUILD_ROOT%{_bindir}/py.test{,-3}
117 %{__mv} $RPM_BUILD_ROOT%{_bindir}/pytest{,-3}
118
119 ln -sf py.test-3 $RPM_BUILD_ROOT%{_bindir}/py.test
120 ln -sf pytest-3 $RPM_BUILD_ROOT%{_bindir}/pytest
121
122 %clean
123 rm -rf $RPM_BUILD_ROOT
124
125 %files
126 %defattr(644,root,root,755)
127 %doc AUTHORS CHANGELOG.rst LICENSE README.rst
128 %attr(755,root,root) %{_bindir}/py.test
129 %attr(755,root,root) %{_bindir}/py.test-3
130 %attr(755,root,root) %{_bindir}/pytest
131 %attr(755,root,root) %{_bindir}/pytest-3
132 %{py3_sitescriptdir}/pytest
133 %{py3_sitescriptdir}/_pytest
134 %{py3_sitescriptdir}/pytest-%{version}-py*.egg-info
135
136 %if %{with doc}
137 %files apidocs
138 %defattr(644,root,root,755)
139 %doc doc/en/_build/html/{_images,_modules,_static,announce,example,proposals,*.html,*.js}
140 %endif
This page took 0.074852 seconds and 2 git commands to generate.