#6 Update to version 21.2.0
Merged a month ago by carlwgeorge. Opened a month ago by carlwgeorge.
rpms/ carlwgeorge/python-gunicorn update_21.2.0  into  rawhide

file modified
+1
@@ -19,3 +19,4 @@ 

  /gunicorn-20.0.2.tar.gz

  /gunicorn-20.0.4.tar.gz

  /gunicorn-20.1.0.tar.gz

+ /gunicorn-21.2.0.tar.gz

@@ -1,54 +0,0 @@ 

- From 153bf73a2ea2f23681f5cec19a90f212a36fdab9 Mon Sep 17 00:00:00 2001

- From: Sergey Shepelev <temotor@gmail.com>

- Date: Thu, 6 May 2021 12:54:06 +0300

- Subject: [PATCH 2/2] eventlet worker: ALREADY_HANDLED -> WSGI_LOCAL

- 

- Eventlet v0.30.3+ removed wsgi.ALREADY_HANDLED in favor of

- `wsgi.WSGI_LOCAL.already_handled: bool`

- 

- Sorry, this breaking change happened during only patch

- version increase 0.30.2 -> 0.30.3

- 

- https://github.com/eventlet/eventlet/issues/543

- https://github.com/eventlet/eventlet/pull/544

- (cherry picked from commit 6a8ebb4844b2f28596ffe7421eb9f7d08c8dc4d8)

- ---

-  gunicorn/workers/geventlet.py | 11 ++++++++++-

-  1 file changed, 10 insertions(+), 1 deletion(-)

- 

- diff --git a/gunicorn/workers/geventlet.py b/gunicorn/workers/geventlet.py

- index ffdb206c..ea82f3d6 100644

- --- a/gunicorn/workers/geventlet.py

- +++ b/gunicorn/workers/geventlet.py

- @@ -17,11 +17,16 @@ else:

-  

-  from eventlet import hubs, greenthread

-  from eventlet.greenio import GreenSocket

- -from eventlet.wsgi import ALREADY_HANDLED as EVENTLET_ALREADY_HANDLED

- +import eventlet.wsgi

-  import greenlet

-  

-  from gunicorn.workers.base_async import AsyncWorker

-  

- +# ALREADY_HANDLED is removed in 0.30.3+ now it's `WSGI_LOCAL.already_handled: bool`

- +# https://github.com/eventlet/eventlet/pull/544

- +EVENTLET_WSGI_LOCAL = getattr(eventlet.wsgi, "WSGI_LOCAL", None)

- +EVENTLET_ALREADY_HANDLED = getattr(eventlet.wsgi, "ALREADY_HANDLED", None)

- +

-  

-  def _eventlet_socket_sendfile(self, file, offset=0, count=None):

-      # Based on the implementation in gevent which in turn is slightly

- @@ -125,6 +130,10 @@ class EventletWorker(AsyncWorker):

-          patch_sendfile()

-  

-      def is_already_handled(self, respiter):

- +        # eventlet >= 0.30.3

- +        if getattr(EVENTLET_WSGI_LOCAL, "already_handled", None):

- +            raise StopIteration()

- +        # eventlet < 0.30.3

-          if respiter == EVENTLET_ALREADY_HANDLED:

-              raise StopIteration()

-          return super().is_already_handled(respiter)

- -- 

- 2.35.3

- 

@@ -1,163 +0,0 @@ 

- From 3e27f6b994358cba4768e8d9b6dc4905ed46e227 Mon Sep 17 00:00:00 2001

- From: Tal Einat <532281+taleinat@users.noreply.github.com>

- Date: Wed, 22 Mar 2023 21:53:05 +0200

- Subject: [PATCH 1/3] Replace pkg_resources.parse_version with

-  packaging.version.parse

- 

- This is a step towards removing the dependency on pkg_resources, which is part

- of setuptools, and thus makes setuptools a runtime dependency.

- ---

-  gunicorn/workers/geventlet.py | 2 +-

-  gunicorn/workers/ggevent.py   | 2 +-

-  setup.py                      | 1 +

-  3 files changed, 3 insertions(+), 2 deletions(-)

- 

- diff --git a/gunicorn/workers/geventlet.py b/gunicorn/workers/geventlet.py

- index ffdb206c..349abe28 100644

- --- a/gunicorn/workers/geventlet.py

- +++ b/gunicorn/workers/geventlet.py

- @@ -11,7 +11,7 @@ try:

-  except ImportError:

-      raise RuntimeError("eventlet worker requires eventlet 0.24.1 or higher")

-  else:

- -    from pkg_resources import parse_version

- +    from packaging.version import parse as parse_version

-      if parse_version(eventlet.__version__) < parse_version('0.24.1'):

-          raise RuntimeError("eventlet worker requires eventlet 0.24.1 or higher")

-  

- diff --git a/gunicorn/workers/ggevent.py b/gunicorn/workers/ggevent.py

- index 3941814f..347b8623 100644

- --- a/gunicorn/workers/ggevent.py

- +++ b/gunicorn/workers/ggevent.py

- @@ -14,7 +14,7 @@ try:

-  except ImportError:

-      raise RuntimeError("gevent worker requires gevent 1.4 or higher")

-  else:

- -    from pkg_resources import parse_version

- +    from packaging.version import parse as parse_version

-      if parse_version(gevent.__version__) < parse_version('1.4'):

-          raise RuntimeError("gevent worker requires gevent 1.4 or higher")

-  

- diff --git a/setup.py b/setup.py

- index fb220d90..dab2b9f4 100644

- --- a/setup.py

- +++ b/setup.py

- @@ -74,6 +74,7 @@ install_requires = [

-      # is the first version to support Python 3.4 which we require as a

-      # floor.

-      'setuptools>=3.0',

- +    'packaging',

-  ]

-  

-  extras_require = {

- -- 

- 2.39.2

- 

- 

- From 28109b2239ec72f1ed2e98ee7fa41ee0faac3f25 Mon Sep 17 00:00:00 2001

- From: Tal Einat <532281+taleinat@users.noreply.github.com>

- Date: Wed, 22 Mar 2023 21:56:52 +0200

- Subject: [PATCH 2/3] Add myself to THANKS

- 

- ---

-  THANKS | 1 +

-  1 file changed, 1 insertion(+)

- 

- diff --git a/THANKS b/THANKS

- index 2b226f35..4cd47416 100644

- --- a/THANKS

- +++ b/THANKS

- @@ -163,6 +163,7 @@ Stephen DiCato <Locker537@gmail.com>

-  Stephen Holsapple <sholsapp@gmail.com>

-  Steven Cummings <estebistec@gmail.com>

-  Sébastien Fievet <zyegfryed@gmail.com>

- +Tal Einat <532281+taleinat@users.noreply.github.com>

-  Talha Malik <talham7391@hotmail.com>

-  TedWantsMore <TedWantsMore@gmx.com>

-  Thomas Grainger <tagrain@gmail.com>

- -- 

- 2.39.2

- 

- 

- From b1815efd5430b29b0ec0dd61c238e4815eaf3c12 Mon Sep 17 00:00:00 2001

- From: Maxwell G <maxwell@gtmx.me>

- Date: Tue, 4 Apr 2023 18:50:22 +0000

- Subject: [PATCH 3/3] replace pkg_resources.load_entry_point

- 

- pkg_resources is deprecated. Use the corresponding importlib.metadata

- interface instead. Use the stdlib version on python >= 3.8 and use the

- importlib_metadata backport on older versions.

- ---

-  gunicorn/util.py | 17 ++++++++++++++---

-  setup.py         |  6 +-----

-  2 files changed, 15 insertions(+), 8 deletions(-)

- 

- diff --git a/gunicorn/util.py b/gunicorn/util.py

- index a821e357..c490852e 100644

- --- a/gunicorn/util.py

- +++ b/gunicorn/util.py

- @@ -22,7 +22,10 @@ import time

-  import traceback

-  import warnings

-  

- -import pkg_resources

- +try:

- +    import importlib.metadata as importlib_metadata

- +except:

- +    import importlib_metadata

-  

-  from gunicorn.errors import AppImportError

-  from gunicorn.workers import SUPPORTED_WORKERS

- @@ -53,6 +56,14 @@ except ImportError:

-      def _setproctitle(title):

-          pass

-  

- +def load_entry_point(distribution, group, name):

- +    dist_obj = importlib_metadata.distribution(distribution)

- +    eps = [ep for ep in dist_obj.entry_points

- +           if ep.group == group and ep.name == name]

- +    if not eps:

- +        raise ImportError("Entry point %r not found" % ((group, name),))

- +    return eps[0].load()

- +

-  

-  def load_class(uri, default="gunicorn.workers.sync.SyncWorker",

-                 section="gunicorn.workers"):

- @@ -68,7 +79,7 @@ def load_class(uri, default="gunicorn.workers.sync.SyncWorker",

-              name = default

-  

-          try:

- -            return pkg_resources.load_entry_point(dist, section, name)

- +            return load_entry_point(dist, section, name)

-          except Exception:

-              exc = traceback.format_exc()

-              msg = "class uri %r invalid or not found: \n\n[%s]"

- @@ -85,7 +96,7 @@ def load_class(uri, default="gunicorn.workers.sync.SyncWorker",

-                      break

-  

-                  try:

- -                    return pkg_resources.load_entry_point(

- +                    return load_entry_point(

-                          "gunicorn", section, uri

-                      )

-                  except Exception:

- diff --git a/setup.py b/setup.py

- index dab2b9f4..4bc3566b 100644

- --- a/setup.py

- +++ b/setup.py

- @@ -69,11 +69,7 @@ class PyTestCommand(TestCommand):

-  

-  

-  install_requires = [

- -    # We depend on functioning pkg_resources.working_set.add_entry() and

- -    # pkg_resources.load_entry_point(). These both work as of 3.0 which

- -    # is the first version to support Python 3.4 which we require as a

- -    # floor.

- -    'setuptools>=3.0',

- +    'importlib_metadata; python_version<"3.8"',

-      'packaging',

-  ]

-  

- -- 

- 2.39.2

- 

file modified
+5 -24
@@ -6,34 +6,14 @@ 

  speedy.}

  

  Name:           python-%{srcname}

- Version:        20.1.0

- Release:        12%{?dist}

+ Version:        21.2.0

+ Release:        1%{?dist}

  Summary:        Python WSGI HTTP Server

  License:        MIT

  URL:            https://gunicorn.org/

  Source:         %pypi_source %{srcname}

  # distro-specific, not upstreamable

  Patch:          0001-use-dev-log-for-syslog.patch

- # Patch for newer eventlet

- # https://github.com/benoitc/gunicorn/commit/6a8ebb4844b2f28596ffe7421eb9f7d08c8dc4d8

- Patch:          0002-eventlet-worker-ALREADY_HANDLED-WSGI_LOCAL.patch

- # The following patch contains the changes from the following two upstream

- # PR’s, rebased on the 20.1.0 release and combined into a single patch file.

- #

- #   2747-Replace pkg_resources.parse_version with packaging.version.parse

- #   https://github.com/benoitc/gunicorn/pull/2958

- #

- #   replace pkg_resources.load_entry_point

- #   https://github.com/benoitc/gunicorn/pull/2963

- #

- # Applying this patch eliminates a DeprecationWarning that was produced when

- # importing pkg_resources (with recent setuptools versions). That warning was

- # treated as an error in the tests for python-aiohttp, so this patch also

- # fixes:

- #

- #   python-aiohttp fails to build with the latest setuptools version

- #   https://bugzilla.redhat.com/show_bug.cgi?id=2183385

- Patch:          gunicorn-20.1.0-remove-setuptools.patch

  BuildArch:      noarch

  

  %description %{_description}
@@ -55,8 +35,6 @@ 

  %autosetup -n %{srcname}-%{version} -p 1

  # disable code coverage checks

  sed -e '/coverage/d' -e '/pytest-cov/d' -i requirements_test.txt

- # Unneeded - https://github.com/benoitc/gunicorn/issues/3014

- sed -e '/aiohttp/d' -i requirements_test.txt

  sed -e '/addopts/d' -i setup.cfg

  

  %generate_buildrequires
@@ -87,6 +65,9 @@ 

  %doc docs/build/html/*

  

  %changelog

+ * Thu Aug 31 2023 Carl George <carlwgeorge@fedoraproject.org> - 21.2.0-1

+ - Update to version 21.2.0, resolves rhbz#2223435

+ 

  * Fri Jul 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 20.1.0-12

  - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild

  

file modified
+1 -1
@@ -1,1 +1,1 @@ 

- SHA512 (gunicorn-20.1.0.tar.gz) = 586c7373504b4018fd462dc9c728991a8cc9f2be71fc2fb5aa23707ff6157dd3953121f6a070cae64d58b10f9ddf77ad59b66ed33981d37919b4764c60609027

+ SHA512 (gunicorn-21.2.0.tar.gz) = 5d3117133ecbf9b8fded9c0ce69206916d273c284726d2a62e1d1d107560f22593baab032afa51e71b004a8b1e47afafd3fd1350b850ca45c1d7064075b795d3