| |
@@ -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
|
| |
-
|
| |
Resolves rhbz#2223435