- Fix build with pytest4 from upstream:

* pytest4.patch

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:pytest/python-pytest-timeout?expand=0&rev=8
This commit is contained in:
Tomáš Chvátal
2019-02-12 15:46:13 +00:00
committed by Git OBS Bridge
parent 3b0eb5d150
commit 42796e60f4
3 changed files with 41 additions and 16 deletions

View File

@@ -1,7 +1,7 @@
#
# spec file for package python-pytest-timeout
#
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -17,7 +17,6 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%bcond_without test
Name: python-pytest-timeout
Version: 1.3.3
Release: 0
@@ -26,17 +25,16 @@ License: MIT
Group: Development/Languages/Python
URL: http://bitbucket.org/pytest-dev/pytest-timeout/
Source: https://files.pythonhosted.org/packages/source/p/pytest-timeout/pytest-timeout-%{version}.tar.gz
Patch0: pytest4.patch
BuildRequires: %{python_module devel}
BuildRequires: %{python_module pexpect}
BuildRequires: %{python_module pytest >= 3.6.0}
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires: python-pexpect
Requires: python-pytest >= 3.6.0
BuildArch: noarch
%if %{with test}
BuildRequires: %{python_module pexpect}
BuildRequires: %{python_module pytest >= 3.6.0}
%endif
%python_subpackages
%description
@@ -58,6 +56,7 @@ side-effects.
%prep
%setup -q -n pytest-timeout-%{version}
%patch0 -p1
%build
%python_build
@@ -66,17 +65,9 @@ side-effects.
%python_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%if %{with test}
%check
mkdir tester
pushd tester
ln -s ../test_pytest_timeout.py .
%{python_expand export PYTHONPATH=%{buildroot}%{$python_sitelib}
$python -B -m pytest test_pytest_timeout.py
rm %{buildroot}%{$python_sitelib}/__pycache__/pytest_timeout*-PYTEST.py*
}
popd
%endif
export PYTHONDONTWRITEBYTECODE=1
%python_expand PYTHONPATH=%{buildroot}%{$python_sitelib} $python -m pytest test_pytest_timeout.py
%files %{python_files}
%license LICENSE