15
0
2022-05-11 16:26:07 +00:00
committed by Git OBS Bridge
parent 93dd269c9c
commit f418a91c50
2 changed files with 92 additions and 5 deletions

88
no-relative-imports.patch Normal file
View File

@@ -0,0 +1,88 @@
---
cheroot/ssl/builtin.py | 10 +++++-----
cheroot/test/conftest.py | 6 +++---
cheroot/test/test_server.py | 8 ++++----
cheroot/test/test_ssl.py | 12 ++++++------
4 files changed, 18 insertions(+), 18 deletions(-)
--- a/cheroot/ssl/builtin.py
+++ b/cheroot/ssl/builtin.py
@@ -29,11 +29,11 @@ except ImportError:
import six
-from . import Adapter
-from .. import errors
-from .._compat import IS_ABOVE_OPENSSL10, suppress
-from ..makefile import StreamReader, StreamWriter
-from ..server import HTTPServer
+from cheroot.ssl import Adapter
+from cheroot import errors
+from cheroot._compat import IS_ABOVE_OPENSSL10, suppress
+from cheroot.makefile import StreamReader, StreamWriter
+from cheroot.server import HTTPServer
if six.PY2:
generic_socket_error = socket.error
--- a/cheroot/test/conftest.py
+++ b/cheroot/test/conftest.py
@@ -12,11 +12,11 @@ import time
import pytest
-from ..server import Gateway, HTTPServer
-from ..testing import ( # noqa: F401 # pylint: disable=unused-import
+from cheroot.server import Gateway, HTTPServer
+from cheroot.testing import ( # noqa: F401 # pylint: disable=unused-import
native_server, wsgi_server,
)
-from ..testing import get_server_client
+from cheroot.testing import get_server_client
@pytest.fixture
--- a/cheroot/test/test_server.py
+++ b/cheroot/test/test_server.py
@@ -18,10 +18,10 @@ import six
from six.moves import queue, urllib
-from .._compat import bton, ntob
-from .._compat import IS_LINUX, IS_MACOS, IS_WINDOWS, SYS_PLATFORM
-from ..server import IS_UID_GID_RESOLVABLE, Gateway, HTTPServer
-from ..testing import (
+from cheroot._compat import bton, ntob
+from cheroot._compat import IS_LINUX, IS_MACOS, IS_WINDOWS, SYS_PLATFORM
+from cheroot.server import IS_UID_GID_RESOLVABLE, Gateway, HTTPServer
+from cheroot.testing import (
ANY_INTERFACE_IPV4,
ANY_INTERFACE_IPV6,
EPHEMERAL_PORT,
--- a/cheroot/test/test_ssl.py
+++ b/cheroot/test/test_ssl.py
@@ -21,11 +21,11 @@ import requests
import six
import trustme
-from .._compat import bton, ntob, ntou
-from .._compat import IS_ABOVE_OPENSSL10, IS_CI, IS_PYPY
-from .._compat import IS_LINUX, IS_MACOS, IS_WINDOWS
-from ..server import HTTPServer, get_ssl_adapter_class
-from ..testing import (
+from cheroot._compat import bton, ntob, ntou
+from cheroot._compat import IS_ABOVE_OPENSSL10, IS_CI, IS_PYPY
+from cheroot._compat import IS_LINUX, IS_MACOS, IS_WINDOWS
+from cheroot.server import HTTPServer, get_ssl_adapter_class
+from cheroot.testing import (
ANY_INTERFACE_IPV4,
ANY_INTERFACE_IPV6,
EPHEMERAL_PORT,
@@ -33,7 +33,7 @@ from ..testing import (
_get_conn_data,
_probe_ipv6_sock,
)
-from ..wsgi import Gateway_10
+from cheroot.wsgi import Gateway_10
IS_GITHUB_ACTIONS_WORKFLOW = bool(os.getenv('GITHUB_WORKFLOW'))

View File

@@ -36,6 +36,8 @@ Source: https://files.pythonhosted.org/packages/source/c/%{pypi_name}/%{
# PATCH-FIX-OPENSUSE no-pypytools.patch mcepl@suse.com
# We don't have PyPy at all, so no need support for it
Patch0: no-pypytools.patch
# PATCH-FIX-UPSTREAM no-relative-imports.patch bsc#[0-9]+ mcepl@suse.com
Patch1: no-relative-imports.patch
BuildRequires: %{python_module jaraco.functools}
BuildRequires: %{python_module more-itertools >= 2.6}
BuildRequires: %{python_module setuptools >= 34.4}
@@ -93,7 +95,7 @@ Cheroot is the pure-Python HTTP server used by CherryPy.
%prep
%autosetup -p1 -n cheroot-%{version} -p1
# do not check coverage
sed -i '/--cov/ d' pytest.ini
sed -i -e '/--cov/ d' pytest.ini
%build
%python_build
@@ -112,10 +114,7 @@ pushd testclean
%python_expand pytest_opts+=" --ignore %{buildroot}%{$python_sitelib}/cheroot/test/test_wsgi.py"
%endif
# test_tls_client_auth[...-False-localhost-builtin] fails ocassionally on server-side OBS
donttest="(test_tls_client_auth and False-localhost-builtin)"
# https://github.com/cherrypy/cheroot/issues/502
donttest="$donttest or test_high_number_of_file_descriptors"
%pytest --pyargs cheroot $pytest_opts -k "not ($donttest)"
%pytest --pyargs cheroot $pytest_opts -k "not (test_tls_client_auth and False-localhost-builtin)"
popd
%pre