Accepting request 985930 from home:lrupp:branches:devel:languages:python:mailman

- added mailman-support-sqlalchemy-1-4.patch (from Andreas Schneider):
  The TypeDecorator.cache_ok class-level flag indicates if this custom
  TypeDecorator is safe to be used as part of a cache key. This flag defaults to
  None which will initially generate a warning when the SQL compiler attempts to
  generate a cache key for a statement that uses this type. If the TypeDecorator
  is not guaranteed to produce the same bind/result behavior and SQL generation
  every time, this flag should be set to False; otherwise if the class produces
  the same behavior each time, it may be set to True. See TypeDecorator.cache_ok
  for further notes on how this works.

OBS-URL: https://build.opensuse.org/request/show/985930
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:mailman/python-mailman?expand=0&rev=63
This commit is contained in:
Andreas Schneider 2022-06-29 19:38:49 +00:00 committed by Git OBS Bridge
parent 85efc6c9c3
commit cd16081c06
3 changed files with 86 additions and 0 deletions

View File

@ -0,0 +1,71 @@
The TypeDecorator.cache_ok class-level flag indicates if this custom
TypeDecorator is safe to be used as part of a cache key. This flag defaults to
None which will initially generate a warning when the SQL compiler attempts to
generate a cache key for a statement that uses this type. If the TypeDecorator
is not guaranteed to produce the same bind/result behavior and SQL generation
every time, this flag should be set to False; otherwise if the class produces
the same behavior each time, it may be set to True. See TypeDecorator.cache_ok
for further notes on how this works.
As I don't know if those can be safely cached, just disable the warning.
Index: mailman-3.3.5/src/mailman/database/types.py
===================================================================
--- mailman-3.3.5.orig/src/mailman/database/types.py 2021-09-06 02:19:59.000000000 +0200
+++ mailman-3.3.5/src/mailman/database/types.py 2022-06-23 08:57:19.527825754 +0200
@@ -34,6 +34,7 @@ class Enum(TypeDecorator):
converts it on-the-fly.
"""
impl = Integer
+ cache_ok = False
def __init__(self, enum, *args, **kw):
super().__init__(*args, **kw)
@@ -59,6 +60,7 @@ class UUID(TypeDecorator):
"""
impl = CHAR
+ cache_ok = False
def load_dialect_impl(self, dialect):
if dialect.name == 'postgresql':
@@ -97,6 +99,7 @@ class SAUnicode(TypeDecorator):
column needs to be indexed, otherwise use SAUnicode4Byte.
"""
impl = Unicode
+ cache_ok = False
@compiles(SAUnicode)
@@ -120,6 +123,7 @@ class SAUnicode4Byte(TypeDecorator):
type and it can still be used if needed in the codebase.
"""
impl = Unicode
+ cache_ok = False
@compiles(SAUnicode4Byte)
@@ -140,6 +144,7 @@ class SAUnicodeLarge(TypeDecorator):
This is double size of SAUnicode defined above.
"""
impl = Unicode
+ cache_ok = False
@compiles(SAUnicodeLarge, 'mysql')
@@ -166,6 +171,7 @@ class SAUnicodeXL(TypeDecorator):
See https://docs.sqlalchemy.org/en/latest/dialects/mysql.html#index-length
"""
impl = Unicode
+ cache_ok = False
@compiles(SAUnicodeXL, 'mysql')
@@ -187,6 +193,7 @@ class SAText(TypeDecorator):
case of other dialects defaults to the Text type.
"""
impl = Text
+ cache_ok = False
@compiles(SAText)

View File

@ -1,3 +1,16 @@
-------------------------------------------------------------------
Wed Jun 29 18:14:25 UTC 2022 - Lars Vogdt <lars@linux-schulserver.de>
- added mailman-support-sqlalchemy-1-4.patch (from Andreas Schneider):
The TypeDecorator.cache_ok class-level flag indicates if this custom
TypeDecorator is safe to be used as part of a cache key. This flag defaults to
None which will initially generate a warning when the SQL compiler attempts to
generate a cache key for a statement that uses this type. If the TypeDecorator
is not guaranteed to produce the same bind/result behavior and SQL generation
every time, this flag should be set to False; otherwise if the class produces
the same behavior each time, it may be set to True. See TypeDecorator.cache_ok
for further notes on how this works.
-------------------------------------------------------------------
Mon Jun 13 09:09:17 UTC 2022 - Andreas Schneider <asn@cryptomilk.org>

View File

@ -70,6 +70,8 @@ Patch2: support-alembic-1-8.patch
# PATCH-FIX-UPSTREAM ARC-message-fail-tests.patch bsc#[0-9]+ mcepl@suse.com
# this patch makes things totally awesome
Patch3: ARC-message-fail-tests.patch
# Disable cache_ok warnings on console messages: disable caching completely at the moment
Patch4: mailman-support-sqlalchemy-1-4.patch
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildArch: noarch