移除redis强依赖检测,将其修改为报错信息提示

This commit is contained in:
rabbitali 2024-07-05 16:54:35 +08:00
parent fcd692f286
commit 0a818ced12
2 changed files with 39 additions and 2 deletions

View File

@ -0,0 +1,33 @@
From b1fd781018c9006b252d4eb19178b288f6c9d10a Mon Sep 17 00:00:00 2001
From: rabbitali <wenxin32@foxmail.com>
Date: Fri, 5 Jul 2024 15:15:19 +0800
Subject: [PATCH 1/1] removed the strong dependency detection of redis version
---
kombu/transport/redis.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/kombu/transport/redis.py b/kombu/transport/redis.py
index 6797854..611e56d 100644
--- a/kombu/transport/redis.py
+++ b/kombu/transport/redis.py
@@ -3,6 +3,7 @@
import os
import numbers
import socket
+import warnings
from bisect import bisect
from collections import namedtuple
@@ -979,7 +980,7 @@ class Channel(virtual.Channel):
def _get_client(self):
if redis.VERSION < (3, 2, 0):
- raise VersionMismatch(
+ warnings.warn(
'Redis transport requires redis-py versions 3.2.0 or later. '
'You have {0.__version__}'.format(redis))
return redis.StrictRedis
--
2.33.0

View File

@ -1,11 +1,12 @@
%global _empty_manifest_terminate_build 0
Name: python-kombu
Version: 5.0.2
Release: 1
Release: 2
Summary: Messaging library for Python.
License: BSD
URL: https://github.com/celery/kombu
Source0: https://files.pythonhosted.org/packages/3b/3a/f880f867bb2690aee3454aa31143d441fee79c5c5ce4d9537114675447b3/kombu-5.0.2.tar.gz
Patch0001: 0001-removed-the-strong-dependency-detection-of-redis-ver.patch
BuildArch: noarch
Requires: python3-amqp
@ -58,7 +59,7 @@ The aim of Kombu is to make messaging in Python as easy as possible by providing
AMQP is the Advanced Message Queuing Protocol, an open standard protocol for message orientation, queuing, routing, reliability and security, for which the RabbitMQ messaging server is the most popular implementation.
%prep
%autosetup -n kombu-5.0.2
%autosetup -n kombu-5.0.2 -p1
%build
%py3_build
@ -98,5 +99,8 @@ mv %{buildroot}/doclist.lst .
%{_docdir}/*
%changelog
* Wed Jul 10 2024 wenxin <wenxin32@foxmail.com> - 5.0.2-2
- Removed redis version strong dependency detection and changed it to alarm information reminder
* Mon Dec 28 2020 Python_Bot <Python_Bot@openeuler.org>
- Package Spec generated