python-mailman/support-sqlalchemy-1-4.patch
Steve Kowalik 0b0ec08568 - Add support-click-8-0.patch:
* Lightly rebased from upstream to support click 8.0
- Add support-sqlalchemy-1-4.patch:
  * Support running with SQLAlchemy 1.4

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:mailman/python-mailman?expand=0&rev=49
2021-07-21 01:52:20 +00:00

65 lines
2.9 KiB
Diff

Index: mailman-3.3.4/setup.py
===================================================================
--- mailman-3.3.4.orig/setup.py
+++ mailman-3.3.4/setup.py
@@ -127,7 +127,7 @@ case second 'm'. Any other spelling is
'python-dateutil>=2.0',
'passlib',
'requests',
- 'sqlalchemy>=1.2.3,<1.4',
+ 'sqlalchemy>=1.2.3,<1.5',
'zope.component',
'zope.configuration',
'zope.event',
Index: mailman-3.3.4/src/mailman/database/tests/test_factory.py
===================================================================
--- mailman-3.3.4.orig/src/mailman/database/tests/test_factory.py
+++ mailman-3.3.4/src/mailman/database/tests/test_factory.py
@@ -76,10 +76,11 @@ class TestSchemaManager(unittest.TestCas
# In case of MySQL, you cannot create/drop indexes on primary keys
# manually as it is handled automatically by MySQL.
if not is_mysql(config.db.engine):
- Index('ix_user__user_id').drop(bind=config.db.engine)
# Don't pollute our main metadata object, create a new one.
md = MetaData()
user_table = Model.metadata.tables['user'].tometadata(md)
+ Index('ix_user__user_id', user_table.c._user_id).drop(
+ bind=config.db.engine)
Index('ix_user_user_id', user_table.c._user_id).create(
bind=config.db.engine)
config.db.commit()
@@ -98,7 +99,11 @@ class TestSchemaManager(unittest.TestCas
# indexes for primary keys, don't try doing it with that backend.
if not is_mysql(config.db.engine):
with suppress(ProgrammingError, OperationalError):
- Index('ix_user_user_id').drop(bind=config.db.engine)
+ # Don't pollute our main metadata object, create a new one.
+ md = MetaData()
+ user_table = Model.metadata.tables['user'].tometadata(md)
+ Index('ix_user_user_id', user_table.c._user_id).drop(
+ bind=config.db.engine)
config.db.commit()
def test_current_database(self):
Index: mailman-3.3.4/src/mailman/model/listmanager.py
===================================================================
--- mailman-3.3.4.orig/src/mailman/model/listmanager.py
+++ mailman-3.3.4/src/mailman/model/listmanager.py
@@ -31,6 +31,7 @@ from mailman.model.mime import ContentFi
from mailman.utilities.datetime import now
from mailman.utilities.queries import QuerySequence
from public import public
+from sqlalchemy.engine import Row
from zope.event import notify
from zope.interface import implementer
@@ -120,7 +121,7 @@ class ListManager:
"""See `IListManager`."""
result_set = store.query(MailingList)
for list_id in result_set.values(MailingList._list_id):
- assert isinstance(list_id, tuple) and len(list_id) == 1
+ assert isinstance(list_id, (tuple, Row)) and len(list_id) == 1
yield list_id[0]
@property