2012-03-05 18:01:42 +01:00
|
|
|
#
|
2021-12-20 02:04:54 +01:00
|
|
|
# spec file
|
2012-03-05 18:01:42 +01:00
|
|
|
#
|
2021-01-06 11:52:08 +01:00
|
|
|
# Copyright (c) 2021 SUSE LLC
|
2012-03-05 18:01:42 +01:00
|
|
|
#
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
2013-04-23 11:39:08 +02:00
|
|
|
|
2018-09-17 11:46:23 +02:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2012-03-05 18:01:42 +01:00
|
|
|
#
|
|
|
|
|
2017-02-27 18:33:58 +01:00
|
|
|
|
2021-12-20 02:04:54 +01:00
|
|
|
# https://build.opensuse.org/request/show/926611#comment-1560144
|
|
|
|
%bcond_with pytest_is_ready_for_alts
|
|
|
|
%if 0%{?suse_version} > 1500 && %{with pytest_is_ready_for_alts}
|
2021-10-20 20:25:03 +02:00
|
|
|
%bcond_without libalternatives
|
|
|
|
%else
|
|
|
|
%bcond_with libalternatives
|
|
|
|
%endif
|
|
|
|
|
2017-02-27 18:33:58 +01:00
|
|
|
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
2019-01-07 09:53:28 +01:00
|
|
|
%global flavor @BUILD_FLAVOR@%{nil}
|
|
|
|
%if "%{flavor}" == "test"
|
2019-07-09 13:33:21 +02:00
|
|
|
%define psuffix -%{flavor}
|
2019-01-07 09:53:28 +01:00
|
|
|
%bcond_without test
|
|
|
|
%else
|
2019-06-07 13:42:48 +02:00
|
|
|
%define psuffix %{nil}
|
2019-01-07 09:53:28 +01:00
|
|
|
%bcond_with test
|
|
|
|
%endif
|
2019-07-09 13:32:41 +02:00
|
|
|
%define skip_python2 1
|
2019-06-07 13:42:48 +02:00
|
|
|
Name: python-pytest%{psuffix}
|
2021-09-14 11:23:11 +02:00
|
|
|
Version: 6.2.5
|
2012-03-05 18:01:42 +01:00
|
|
|
Release: 0
|
2020-10-29 10:38:57 +01:00
|
|
|
Summary: Simple powerful testing with Python
|
2013-04-23 11:39:08 +02:00
|
|
|
License: MIT
|
2018-06-25 11:35:39 +02:00
|
|
|
URL: https://github.com/pytest-dev/pytest
|
2017-11-02 10:24:10 +01:00
|
|
|
Source: https://files.pythonhosted.org/packages/source/p/pytest/pytest-%{version}.tar.gz
|
2021-12-20 02:04:54 +01:00
|
|
|
# PATCH-FIX-UPSTREAM pytest-pr8664-py3.10-test_trial_error-fail.patch -- gh#pytest-dev/pytest#8664
|
|
|
|
Patch0: pytest-pr8664-py3.10-test_trial_error-fail.patch
|
2021-12-29 01:36:45 +01:00
|
|
|
# PATCH-FIX-UPSTREAM pytest-pr9173-importlib-py310.patch -- gh#pytest-dev/pytest#9173
|
|
|
|
Patch1: pytest-pr9173-importlib-py310.patch
|
2021-12-20 02:04:54 +01:00
|
|
|
# PATCH-FIX-UPSTREAM pytest-pr9417-py3.10.1-fail.patch -- gh#pytest-dev/pytest#9417
|
2021-12-29 01:36:45 +01:00
|
|
|
Patch2: pytest-pr9417-py3.10.1-fail.patch
|
2021-01-06 11:52:08 +01:00
|
|
|
BuildRequires: %{python_module setuptools >= 42.0}
|
2017-11-02 10:24:10 +01:00
|
|
|
BuildRequires: %{python_module setuptools_scm}
|
2020-10-29 10:38:57 +01:00
|
|
|
BuildRequires: %{python_module toml}
|
2017-11-02 10:24:10 +01:00
|
|
|
BuildRequires: fdupes
|
2021-10-20 20:25:03 +02:00
|
|
|
BuildRequires: python-rpm-macros >= 20210929
|
2021-01-06 11:52:08 +01:00
|
|
|
Requires: python-attrs >= 19.2.0
|
2020-08-24 20:43:11 +02:00
|
|
|
Requires: python-importlib-metadata >= 0.12
|
2020-08-24 20:07:07 +02:00
|
|
|
Requires: python-iniconfig
|
2019-06-07 13:42:48 +02:00
|
|
|
Requires: python-packaging
|
|
|
|
Requires: python-pluggy >= 0.12
|
2020-08-24 20:07:07 +02:00
|
|
|
Requires: python-py >= 1.8.2
|
2021-01-06 14:45:18 +01:00
|
|
|
Requires: python-setuptools
|
2020-08-24 20:07:07 +02:00
|
|
|
Requires: python-toml
|
2019-07-09 13:32:41 +02:00
|
|
|
Requires: python-wcwidth
|
2021-10-20 20:25:03 +02:00
|
|
|
%if %{with libalternatives}
|
|
|
|
Requires: alts
|
|
|
|
BuildRequires: alts
|
|
|
|
%else
|
2019-06-07 13:42:48 +02:00
|
|
|
Requires(post): update-alternatives
|
2021-05-14 12:31:12 +02:00
|
|
|
Requires(postun):update-alternatives
|
2021-10-20 20:25:03 +02:00
|
|
|
%endif
|
2019-07-09 13:32:41 +02:00
|
|
|
Obsoletes: python-pytest-doc
|
2019-06-07 13:42:48 +02:00
|
|
|
BuildArch: noarch
|
2019-01-07 09:53:28 +01:00
|
|
|
%if %{with test}
|
2019-09-23 15:19:22 +02:00
|
|
|
BuildRequires: %{python_module Jinja2}
|
|
|
|
BuildRequires: %{python_module Twisted}
|
|
|
|
BuildRequires: %{python_module decorator}
|
2020-04-27 12:52:01 +02:00
|
|
|
BuildRequires: %{python_module hypothesis >= 3.56}
|
2020-08-03 23:51:36 +02:00
|
|
|
# nose is really not REQUIRED, the test suite skips over particular
|
2020-08-03 23:05:07 +02:00
|
|
|
# tests, when the package is not available.
|
|
|
|
# BuildRequires: %%{python_module nose}
|
2019-09-23 15:19:22 +02:00
|
|
|
BuildRequires: %{python_module pexpect}
|
2019-07-09 13:32:41 +02:00
|
|
|
BuildRequires: %{python_module pygments-pytest}
|
|
|
|
BuildRequires: %{python_module pytest >= %{version}}
|
2019-09-23 15:19:22 +02:00
|
|
|
BuildRequires: %{python_module pytest-xdist}
|
|
|
|
BuildRequires: %{python_module requests}
|
2019-09-09 16:58:46 +02:00
|
|
|
BuildRequires: %{python_module xmlschema}
|
2019-09-23 15:19:22 +02:00
|
|
|
BuildRequires: lsof
|
2021-09-14 11:23:11 +02:00
|
|
|
BuildRequires: %{python_module numpy if (%python-base without python36-base)}
|
2019-01-07 09:53:28 +01:00
|
|
|
%endif
|
2021-01-21 16:04:28 +01:00
|
|
|
%if %{?python_version_nodots} < 36
|
2018-08-02 15:12:16 +02:00
|
|
|
Requires: python-pathlib2 >= 2.2.0
|
|
|
|
%endif
|
2017-02-27 18:33:58 +01:00
|
|
|
%python_subpackages
|
2012-03-05 18:01:42 +01:00
|
|
|
|
|
|
|
%description
|
2020-10-29 10:38:57 +01:00
|
|
|
The pytest framework makes it easy to write small tests, yet scales to support
|
|
|
|
complex functional testing for applications and libraries.
|
2013-04-23 11:39:08 +02:00
|
|
|
|
2012-03-05 18:01:42 +01:00
|
|
|
%prep
|
2021-12-20 02:04:54 +01:00
|
|
|
%autosetup -p1 -n pytest-%{version}
|
2020-12-13 09:21:57 +01:00
|
|
|
# fix gh#pytest-dev/pytest#7891 still happening for Leap
|
|
|
|
sed -i '/^\[metadata\]/ a version = %{version}' setup.cfg
|
2012-03-05 18:01:42 +01:00
|
|
|
|
|
|
|
%build
|
2017-02-27 18:33:58 +01:00
|
|
|
%python_build
|
2012-03-05 18:01:42 +01:00
|
|
|
|
|
|
|
%install
|
2019-01-07 09:53:28 +01:00
|
|
|
%if ! %{with test}
|
2017-11-02 10:24:10 +01:00
|
|
|
%python_install
|
2021-09-19 19:46:29 +02:00
|
|
|
%python_clone -a %{buildroot}%{_bindir}/pytest
|
|
|
|
%python_clone -a %{buildroot}%{_bindir}/py.test
|
2018-06-25 11:35:39 +02:00
|
|
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
2019-01-07 09:53:28 +01:00
|
|
|
%endif
|
|
|
|
|
|
|
|
%check
|
|
|
|
%if %{with test}
|
2019-07-09 13:32:41 +02:00
|
|
|
%pytest
|
2019-01-07 09:53:28 +01:00
|
|
|
%endif
|
2017-12-15 14:01:40 +01:00
|
|
|
|
2019-07-09 13:32:41 +02:00
|
|
|
%if ! %{with test}
|
2021-10-20 20:25:03 +02:00
|
|
|
|
|
|
|
%pre
|
|
|
|
# If libalternatives is used: Removing old update-alternatives entries.
|
|
|
|
%python_libalternatives_reset_alternative pytest
|
|
|
|
|
2013-06-25 07:42:24 +02:00
|
|
|
%post
|
2021-10-20 20:25:03 +02:00
|
|
|
%if ! %{with libalternatives}
|
2020-11-11 15:56:06 +01:00
|
|
|
# py.test was the master until Oct 2020. boo#1178547
|
|
|
|
alternatives=$(update-alternatives --quiet --list py.test 2> /dev/null) && (
|
|
|
|
update-alternatives --remove-all py.test
|
|
|
|
# reinstall group with new master for all existing flavors except ourself
|
|
|
|
for a in $alternatives; do
|
|
|
|
if [ $a != %{_bindir}/py.test-%{python_bin_suffix} ]; then
|
|
|
|
bin_suffix=${a##*-}
|
|
|
|
prio=${bin_suffix/./}
|
|
|
|
update-alternatives --quiet --install %{_bindir}/pytest pytest ${a/py.test/pytest} $prio \
|
|
|
|
--slave %{_bindir}/py.test py.test $a
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
) ||:
|
2021-10-20 20:25:03 +02:00
|
|
|
%endif
|
2020-10-29 10:38:57 +01:00
|
|
|
%python_install_alternative pytest py.test
|
2013-06-25 07:42:24 +02:00
|
|
|
|
2017-04-19 18:05:53 +02:00
|
|
|
%postun
|
2020-10-29 10:38:57 +01:00
|
|
|
%python_uninstall_alternative pytest
|
2013-06-25 07:42:24 +02:00
|
|
|
|
2017-02-27 18:33:58 +01:00
|
|
|
%files %{python_files}
|
2018-03-12 12:01:55 +01:00
|
|
|
%doc AUTHORS CHANGELOG.rst README.rst
|
|
|
|
%license LICENSE
|
2017-02-27 18:33:58 +01:00
|
|
|
%python_alternative %{_bindir}/pytest
|
2020-10-29 10:38:57 +01:00
|
|
|
%python_alternative %{_bindir}/py.test
|
|
|
|
%{python_sitelib}/_pytest
|
|
|
|
%{python_sitelib}/pytest
|
|
|
|
%{python_sitelib}/pytest-%{version}*-info
|
2019-01-07 09:53:28 +01:00
|
|
|
%endif
|
|
|
|
|
2012-03-05 18:01:42 +01:00
|
|
|
%changelog
|