From 8433a7dec8dd81ba2e72abbce8d7ba39367ca106 Mon Sep 17 00:00:00 2001 From: Matthias Runge Date: Dec 03 2019 08:36:40 +0000 Subject: Use importlib.metadata from standard lib for Python3.8+ --- diff --git a/97e887605b21a110e0ec304913930a8115987c6a.patch b/97e887605b21a110e0ec304913930a8115987c6a.patch new file mode 100644 index 0000000..d50bb0e --- /dev/null +++ b/97e887605b21a110e0ec304913930a8115987c6a.patch @@ -0,0 +1,37 @@ +From 97e887605b21a110e0ec304913930a8115987c6a Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= +Date: Tue, 3 Dec 2019 02:57:07 +0100 +Subject: [PATCH] Use importlib.metadata from the standard library on Python + 3.8+ (#1086) + +--- + kombu/utils/compat.py | 6 +++++- + requirements/default.txt | 3 ++- + 2 files changed, 7 insertions(+), 2 deletions(-) + +diff --git a/kombu/utils/compat.py b/kombu/utils/compat.py +index c5f0bf118..a741c4350 100644 +--- a/kombu/utils/compat.py ++++ b/kombu/utils/compat.py +@@ -7,7 +7,11 @@ + from functools import wraps + + from contextlib import contextmanager +-import importlib_metadata ++ ++try: ++ from importlib import metadata as importlib_metadata ++except ImportError: ++ import importlib_metadata + + from kombu.five import reraise + +diff --git a/requirements/default.txt b/requirements/default.txt +index 67311143c..bf121e54c 100644 +--- a/requirements/default.txt ++++ b/requirements/default.txt +@@ -1,2 +1,3 @@ ++importlib-metadata>=0.18; python_version<"3.8" + amqp>=2.5.2,<2.6 +-importlib-metadata>=0.18 ++ diff --git a/python-kombu.spec b/python-kombu.spec index e1eeb35..fbd2254 100644 --- a/python-kombu.spec +++ b/python-kombu.spec @@ -14,7 +14,7 @@ Name: python-%{srcname} Version: 4.6.6 -Release: 1%{?dist} +Release: 2%{?dist} Epoch: 1 Summary: An AMQP Messaging Framework for Python @@ -23,6 +23,9 @@ License: BSD and Python URL: http://kombu.readthedocs.org/ Source0: https://github.com/celery/kombu/archive/%{version}/%{srcname}-%{version}.tar.gz +# [PATCH] Use importlib.metadata from the standard library on Python 3.8+ +Patch0001: https://github.com/celery/kombu/commit/97e887605b21a110e0ec304913930a8115987c6a.patch + BuildArch: noarch %description @@ -146,6 +149,9 @@ also provide proven and tested solutions to common messaging problems. %endif %changelog +* Tue Dec 03 2019 Matthias Runge -4.6.6-2 +- use importlib.metadata from the standard library in python + * Tue Dec 03 2019 Yatin Karel - 4.6.6-1 - Update to 4.6.6