From 28648c60725ce0385ff0c89ab067e9867f17fe10c1063a6ee02114cdb66e9cfc Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Mon, 2 Jan 2023 19:25:56 +0000 Subject: [PATCH] Accepting request 1046271 from home:bnavigator:branches:devel:languages:python - Update to 9.0.0 * #252 via #339 and #510: Cheroot now requires Python 3.6 or later. Python 3.5 and Python 2.7 are still supported by the maint/8.x branch and stabilizing bugfixes will be accepted to that branch -- by @jaraco * Set worker thread names as str by @jarus in #503 * Added types for _compat.py by @kasium in #491 * Configured stubtest hook for stub testing by @kasium in #415 * Started running Python commands in tox in isolated and strict mode by @webknjaz in #562 OBS-URL: https://build.opensuse.org/request/show/1046271 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cheroot?expand=0&rev=50 --- cheroot-8.6.0.tar.gz | 3 --- cheroot-9.0.0.tar.gz | 3 +++ cheroot.rpmlintrc | 2 ++ no-pypytools.patch | 19 ++++++++------ no-relative-imports.patch | 54 +++++++++++++++++++++++---------------- python-cheroot.changes | 14 ++++++++++ python-cheroot.spec | 28 ++++++++++---------- 7 files changed, 76 insertions(+), 47 deletions(-) delete mode 100644 cheroot-8.6.0.tar.gz create mode 100644 cheroot-9.0.0.tar.gz create mode 100644 cheroot.rpmlintrc diff --git a/cheroot-8.6.0.tar.gz b/cheroot-8.6.0.tar.gz deleted file mode 100644 index 81e4553..0000000 --- a/cheroot-8.6.0.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:366adf6e7cac9555486c2d1be6297993022eff6f8c4655c1443268cca3f08e25 -size 134779 diff --git a/cheroot-9.0.0.tar.gz b/cheroot-9.0.0.tar.gz new file mode 100644 index 0000000..2762f2b --- /dev/null +++ b/cheroot-9.0.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3d47ad9ee19ecbec144b4758399036692fdbf67a40b96eef1fb1454367b3d338 +size 152562 diff --git a/cheroot.rpmlintrc b/cheroot.rpmlintrc new file mode 100644 index 0000000..2d71731 --- /dev/null +++ b/cheroot.rpmlintrc @@ -0,0 +1,2 @@ +# empty typing stubs are okay +addFilter("zero-length .*cheroot.*pyi") diff --git a/no-pypytools.patch b/no-pypytools.patch index f669d60..b5119e5 100644 --- a/no-pypytools.patch +++ b/no-pypytools.patch @@ -2,17 +2,20 @@ cheroot/test/test_server.py | 13 ------------- 1 file changed, 13 deletions(-) ---- a/cheroot/test/test_server.py -+++ b/cheroot/test/test_server.py -@@ -16,7 +16,6 @@ import requests +Index: cheroot-9.0.0/cheroot/test/test_server.py +=================================================================== +--- cheroot-9.0.0.orig/cheroot/test/test_server.py ++++ cheroot-9.0.0/cheroot/test/test_server.py +@@ -12,8 +12,6 @@ import pytest + import requests import requests_unixsocket - import six -from pypytools.gc.custom import DefaultGc - from six.moves import queue, urllib - +- from .._compat import bton, ntob -@@ -370,13 +369,6 @@ if not IS_WINDOWS: + from .._compat import IS_LINUX, IS_MACOS, IS_WINDOWS, SYS_PLATFORM + from ..server import IS_UID_GID_RESOLVABLE, Gateway, HTTPServer +@@ -380,13 +378,6 @@ if not IS_WINDOWS and not ISSUE511: @pytest.fixture @@ -26,7 +29,7 @@ def resource_limit(request): """Set the resource limit two times bigger then requested.""" resource = pytest.importorskip( -@@ -405,11 +397,6 @@ def resource_limit(request): +@@ -415,11 +406,6 @@ def resource_limit(request): @pytest.fixture def many_open_sockets(request, resource_limit): """Allocate a lot of file descriptors by opening dummy sockets.""" diff --git a/no-relative-imports.patch b/no-relative-imports.patch index a7734c3..a6d10e9 100644 --- a/no-relative-imports.patch +++ b/no-relative-imports.patch @@ -5,33 +5,39 @@ 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 +Index: cheroot-9.0.0/cheroot/ssl/builtin.py +=================================================================== +--- cheroot-9.0.0.orig/cheroot/ssl/builtin.py ++++ cheroot-9.0.0/cheroot/ssl/builtin.py +@@ -25,11 +25,11 @@ except ImportError: + except ImportError: + DEFAULT_BUFFER_SIZE = -1 -from . import Adapter -from .. import errors --from .._compat import IS_ABOVE_OPENSSL10, suppress +-from .._compat import IS_ABOVE_OPENSSL10 -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._compat import IS_ABOVE_OPENSSL10 +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 + generic_socket_error = OSError + +Index: cheroot-9.0.0/cheroot/test/conftest.py +=================================================================== +--- cheroot-9.0.0.orig/cheroot/test/conftest.py ++++ cheroot-9.0.0/cheroot/test/conftest.py +@@ -9,12 +9,12 @@ import time import pytest +-from .._compat import IS_MACOS, IS_WINDOWS # noqa: WPS436 -from ..server import Gateway, HTTPServer -from ..testing import ( # noqa: F401 # pylint: disable=unused-import ++from cheroot._compat import IS_MACOS, IS_WINDOWS # noqa: WPS436 +from cheroot.server import Gateway, HTTPServer +from cheroot.testing import ( # noqa: F401 # pylint: disable=unused-import native_server, wsgi_server, @@ -41,11 +47,13 @@ @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 +Index: cheroot-9.0.0/cheroot/test/test_server.py +=================================================================== +--- cheroot-9.0.0.orig/cheroot/test/test_server.py ++++ cheroot-9.0.0/cheroot/test/test_server.py +@@ -12,10 +12,10 @@ import pytest + import requests + import requests_unixsocket -from .._compat import bton, ntob -from .._compat import IS_LINUX, IS_MACOS, IS_WINDOWS, SYS_PLATFORM @@ -58,10 +66,12 @@ 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 +Index: cheroot-9.0.0/cheroot/test/test_ssl.py +=================================================================== +--- cheroot-9.0.0.orig/cheroot/test/test_ssl.py ++++ cheroot-9.0.0/cheroot/test/test_ssl.py +@@ -16,11 +16,11 @@ import pytest + import requests import trustme -from .._compat import bton, ntob, ntou @@ -77,7 +87,7 @@ ANY_INTERFACE_IPV4, ANY_INTERFACE_IPV6, EPHEMERAL_PORT, -@@ -33,7 +33,7 @@ from ..testing import ( +@@ -28,7 +28,7 @@ from ..testing import ( _get_conn_data, _probe_ipv6_sock, ) diff --git a/python-cheroot.changes b/python-cheroot.changes index 6f93734..d53f329 100644 --- a/python-cheroot.changes +++ b/python-cheroot.changes @@ -1,3 +1,17 @@ +------------------------------------------------------------------- +Mon Jan 2 18:19:04 UTC 2023 - Ben Greiner + +- Update to 9.0.0 + * #252 via #339 and #510: Cheroot now requires Python 3.6 or + later. Python 3.5 and Python 2.7 are still supported by the + maint/8.x branch and stabilizing bugfixes will be accepted to + that branch -- by @jaraco + * Set worker thread names as str by @jarus in #503 + * Added types for _compat.py by @kasium in #491 + * Configured stubtest hook for stub testing by @kasium in #415 + * Started running Python commands in tox in isolated and strict + mode by @webknjaz in #562 + ------------------------------------------------------------------- Wed Nov 16 08:58:31 UTC 2022 - Daniel Garcia diff --git a/python-cheroot.spec b/python-cheroot.spec index b3d2356..861f0d0 100644 --- a/python-cheroot.spec +++ b/python-cheroot.spec @@ -1,7 +1,7 @@ # # spec file # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -23,32 +23,33 @@ %endif %define pypi_name cheroot -%bcond_without python2 +%define skip_python2 1 %bcond_with ringdisabled Name: python-%{pypi_name} -Version: 8.6.0 +Version: 9.0.0 Release: 0 Summary: Pure-python HTTP server License: BSD-3-Clause URL: https://github.com/cherrypy/cheroot Source: https://files.pythonhosted.org/packages/source/c/%{pypi_name}/%{pypi_name}-%{version}.tar.gz +Source99: cheroot.rpmlintrc # 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 base >= 3.6} +BuildRequires: %{python_module importlib-metadata if %python-base < 3.8} BuildRequires: %{python_module jaraco.functools} BuildRequires: %{python_module more-itertools >= 2.6} +BuildRequires: %{python_module pip} BuildRequires: %{python_module setuptools >= 34.4} BuildRequires: %{python_module setuptools_scm >= 1.15.0} BuildRequires: %{python_module setuptools_scm_git_archive >= 1.0} BuildRequires: %{python_module six >= 1.11.0} +BuildRequires: %{python_module wheel} BuildRequires: fdupes BuildRequires: python-rpm-macros >= 20210929 -%if %{with python2} -BuildRequires: python-backports.functools_lru_cache -BuildRequires: python-selectors2 -%endif # SECTION test requirements %if ! %{with ringdisabled} # This is not in Ring1 for Staging. See check section @@ -60,6 +61,7 @@ BuildRequires: %{python_module pyOpenSSL} BuildRequires: %{python_module pytest >= 4.6} BuildRequires: %{python_module pytest-forked} BuildRequires: %{python_module pytest-mock >= 1.11.0} +BuildRequires: %{python_module pytest-rerunfailures} BuildRequires: %{python_module pytest-xdist} BuildRequires: %{python_module requests-toolbelt} BuildRequires: %{python_module requests-unixsocket} @@ -70,6 +72,9 @@ BuildRequires: %{python_module urllib3 >= 1.25} Requires: python-jaraco.functools Requires: python-more-itertools >= 2.6 Requires: python-six >= 1.11.0 +%if 0%{python_version_nodots} < 38 +Requires: python-importlib-metadata +%endif %if %{with libalternatives} Requires: alts BuildRequires: alts @@ -79,13 +84,8 @@ Requires(postun):update-alternatives %endif # the package and distribution name is lowercase-cheroot, # but PyPI claims the name is capital-Cheroot -# *smacks head against desk* Provides: python-Cheroot = %{version} BuildArch: noarch -%ifpython2 -Requires: python-backports.functools_lru_cache -Requires: python-selectors2 -%endif %python_subpackages %description @@ -97,10 +97,10 @@ Cheroot is the pure-Python HTTP server used by CherryPy. sed -i -e '/--cov/ d' pytest.ini %build -%python_build +%pyproject_wheel %install -%python_install +%pyproject_install %python_clone -a %{buildroot}%{_bindir}/cheroot %python_expand %fdupes %{buildroot}%{$python_sitelib}