python-kombu/sqlalchemy-2.0.patch
Daniel Garcia b5cdef1efd - Add 0001-Support-redis-4.5.2.patch to support latest version of
redis gh#celery/kombu#1735
- Add sqlalchemy-2.0.patch to support latest version of sqlalchemy
  gh#celery/kombu#1651

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-kombu?expand=0&rev=174
2023-05-29 07:16:24 +00:00

55 lines
1.9 KiB
Diff

Index: kombu-5.2.4/kombu/transport/sqlalchemy/__init__.py
===================================================================
--- kombu-5.2.4.orig/kombu/transport/sqlalchemy/__init__.py
+++ kombu-5.2.4/kombu/transport/sqlalchemy/__init__.py
@@ -58,7 +58,7 @@ import threading
from json import dumps, loads
from queue import Empty
-from sqlalchemy import create_engine
+from sqlalchemy import create_engine, text
from sqlalchemy.exc import OperationalError
from sqlalchemy.orm import sessionmaker
@@ -164,7 +164,7 @@ class Channel(virtual.Channel):
def _get(self, queue):
obj = self._get_or_create(queue)
if self.session.bind.name == 'sqlite':
- self.session.execute('BEGIN IMMEDIATE TRANSACTION')
+ self.session.execute(text('BEGIN IMMEDIATE TRANSACTION'))
try:
msg = self.session.query(self.message_cls) \
.with_for_update() \
Index: kombu-5.2.4/kombu/transport/sqlalchemy/models.py
===================================================================
--- kombu-5.2.4.orig/kombu/transport/sqlalchemy/models.py
+++ kombu-5.2.4/kombu/transport/sqlalchemy/models.py
@@ -4,7 +4,7 @@ import datetime
from sqlalchemy import (Boolean, Column, DateTime, ForeignKey, Index, Integer,
Sequence, SmallInteger, String, Text)
-from sqlalchemy.orm import relation
+from sqlalchemy.orm import relationship
from sqlalchemy.schema import MetaData
try:
@@ -35,7 +35,7 @@ class Queue:
@declared_attr
def messages(cls):
- return relation('Message', backref='queue', lazy='noload')
+ return relationship('Message', backref='queue', lazy='noload')
class Message:
Index: kombu-5.2.4/requirements/test.txt
===================================================================
--- kombu-5.2.4.orig/requirements/test.txt
+++ kombu-5.2.4/requirements/test.txt
@@ -1,3 +1,4 @@
-pytest~=7.0.1
+pytz
+pytest>=7.1.1
pytest-sugar
Pyro4