From f418a91c5087c65d340f2633f6130939df58d0008c29bd614b1a2cdaae441bf9 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Wed, 11 May 2022 16:26:07 +0000 Subject: [PATCH 1/3] Fix SPEC OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cheroot?expand=0&rev=46 --- no-relative-imports.patch | 88 +++++++++++++++++++++++++++++++++++++++ python-cheroot.spec | 9 ++-- 2 files changed, 92 insertions(+), 5 deletions(-) create mode 100644 no-relative-imports.patch diff --git a/no-relative-imports.patch b/no-relative-imports.patch new file mode 100644 index 0000000..a7734c3 --- /dev/null +++ b/no-relative-imports.patch @@ -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')) diff --git a/python-cheroot.spec b/python-cheroot.spec index b49a649..025737e 100644 --- a/python-cheroot.spec +++ b/python-cheroot.spec @@ -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 From 6bf83f48100d026477322df5ae932f437b029bc320c452b468a3e872bc1535f6 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Wed, 11 May 2022 16:28:15 +0000 Subject: [PATCH 2/3] Fix changelog OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cheroot?expand=0&rev=47 --- python-cheroot.changes | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/python-cheroot.changes b/python-cheroot.changes index 6655756..80632c9 100644 --- a/python-cheroot.changes +++ b/python-cheroot.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed May 11 16:26:15 UTC 2022 - Matej Cepl + +- Add no-relative-imports.patch to work around seriously broken + system of imports. + ------------------------------------------------------------------- Sat Apr 2 11:22:09 UTC 2022 - Ben Greiner From 47a423c703e76a2d27307e38faa6a7f76734f7066f306cde9ca895e18f632836 Mon Sep 17 00:00:00 2001 From: Daniel Garcia Date: Wed, 16 Nov 2022 09:02:01 +0000 Subject: [PATCH 3/3] - Remove python_module macro definition - Disable broken tests https://github.com/cherrypy/cheroot/issues/511 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cheroot?expand=0&rev=48 --- python-cheroot.changes | 6 ++++++ python-cheroot.spec | 7 +++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/python-cheroot.changes b/python-cheroot.changes index 80632c9..6f93734 100644 --- a/python-cheroot.changes +++ b/python-cheroot.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Nov 16 08:58:31 UTC 2022 - Daniel Garcia + +- Remove python_module macro definition +- Disable broken tests https://github.com/cherrypy/cheroot/issues/511 + ------------------------------------------------------------------- Wed May 11 16:26:15 UTC 2022 - Matej Cepl diff --git a/python-cheroot.spec b/python-cheroot.spec index 025737e..b3d2356 100644 --- a/python-cheroot.spec +++ b/python-cheroot.spec @@ -22,7 +22,6 @@ %bcond_with libalternatives %endif -%{?!python_module:%define python_module() python-%{**} python3-%{**}} %define pypi_name cheroot %bcond_without python2 %bcond_with ringdisabled @@ -114,7 +113,11 @@ 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 -%pytest --pyargs cheroot $pytest_opts -k "not (test_tls_client_auth and False-localhost-builtin)" +donttest="(test_tls_client_auth and False-localhost-builtin)" +# looks like there's a bug with pytest.mark.forked +# https://github.com/cherrypy/cheroot/issues/511 +donttest+=" or test_high_number_of_file_descriptor" +%pytest --pyargs cheroot $pytest_opts -k "not ($donttest)" popd %pre