From cd16081c0696ee83068eedd2a6d3d8eb172c4599328d74e6b98b237dfeb2c546 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Wed, 29 Jun 2022 19:38:49 +0000 Subject: [PATCH 1/2] 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 --- mailman-support-sqlalchemy-1-4.patch | 71 ++++++++++++++++++++++++++++ python-mailman.changes | 13 +++++ python-mailman.spec | 2 + 3 files changed, 86 insertions(+) create mode 100644 mailman-support-sqlalchemy-1-4.patch diff --git a/mailman-support-sqlalchemy-1-4.patch b/mailman-support-sqlalchemy-1-4.patch new file mode 100644 index 0000000..cb2f5f0 --- /dev/null +++ b/mailman-support-sqlalchemy-1-4.patch @@ -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) diff --git a/python-mailman.changes b/python-mailman.changes index 0b6507d..cf950ef 100644 --- a/python-mailman.changes +++ b/python-mailman.changes @@ -1,3 +1,16 @@ +------------------------------------------------------------------- +Wed Jun 29 18:14:25 UTC 2022 - Lars Vogdt + +- 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 diff --git a/python-mailman.spec b/python-mailman.spec index b8aa9c5..95b5fc1 100644 --- a/python-mailman.spec +++ b/python-mailman.spec @@ -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 From bf64937b139e3084ac40d6ba944fd69dedef697f4763dea01fd9bc556ca0529a Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Mon, 4 Jul 2022 18:09:33 +0000 Subject: [PATCH 2/2] Accepting request 986649 from home:bnavigator:branches:devel:languages:python:mailman - Go back to Python 3.9 for mailman. Python 3.10 is not supported and it is unclear whether the test failures are due to the production code or only in the setup of aiosmtpd in the test suite. -- https://gitlab.com/mailman/mailman/-/issues/936 OBS-URL: https://build.opensuse.org/request/show/986649 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:mailman/python-mailman?expand=0&rev=64 --- python-mailman.changes | 8 ++++ python-mailman.rpmlintrc | 4 +- python-mailman.spec | 101 ++++++++++++++++++--------------------- 3 files changed, 58 insertions(+), 55 deletions(-) diff --git a/python-mailman.changes b/python-mailman.changes index cf950ef..434e150 100644 --- a/python-mailman.changes +++ b/python-mailman.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Mon Jul 4 13:14:27 UTC 2022 - Ben Greiner + +- Go back to Python 3.9 for mailman. Python 3.10 is not supported + and it is unclear whether the test failures are due to the + production code or only in the setup of aiosmtpd in the test + suite. -- https://gitlab.com/mailman/mailman/-/issues/936 + ------------------------------------------------------------------- Wed Jun 29 18:14:25 UTC 2022 - Lars Vogdt diff --git a/python-mailman.rpmlintrc b/python-mailman.rpmlintrc index af7090f..228ee8b 100644 --- a/python-mailman.rpmlintrc +++ b/python-mailman.rpmlintrc @@ -1,2 +1,4 @@ addFilter("incoherent-logrotate-file /etc/logrotate.d/mailman") -addFilter("zero-length /usr/lib/python3.6/site-packages/mailman/templates/.*") +addFilter("zero-length /usr/lib/python3../site-packages/mailman/templates/.*") +addFilter("obsolete-not-provided python3-mailman") +addFilter("explicit-lib-dependency python3.*-passlib") \ No newline at end of file diff --git a/python-mailman.spec b/python-mailman.spec index 95b5fc1..5e3598e 100644 --- a/python-mailman.spec +++ b/python-mailman.spec @@ -34,8 +34,17 @@ %define psuffix %{nil} %bcond_with test %endif +%if 0%{?suse_version} >= 1550 +# Newest python supported by mailman is Python 3.9 -- https://gitlab.com/mailman/mailman/-/issues/936 +%define pythons python39 +%define mypython python39 +%define mypython_sitelib %{python39_sitelib} +%else %{?!python_module:%define python_module() python3-%{**}} %define pythons python3 +%define mypython python3 +%define mypython_sitelib %{python3_sitelib} +%endif Name: python-mailman%{psuffix} Version: 3.3.5 Release: 0 @@ -74,39 +83,17 @@ Patch3: ARC-message-fail-tests.patch Patch4: mailman-support-sqlalchemy-1-4.patch BuildRequires: %{python_module setuptools} BuildRequires: fdupes +BuildRequires: python-rpm-macros +%if 0%{?suse_version} >= 1550 +# use the real python3 primary for rpm pythondistdeps.py +BuildRequires: python3-packaging +%endif BuildArch: noarch %if %{with test} -BuildRequires: %{python_module SQLAlchemy >= 1.2.3} -BuildRequires: %{python_module aiosmtpd >= 1.1} -BuildRequires: %{python_module alembic} -BuildRequires: %{python_module atpublic} -BuildRequires: %{python_module authheaders >= 0.9.2} -BuildRequires: %{python_module authres >= 1.0.1} -BuildRequires: %{python_module click >= 7.0} -BuildRequires: %{python_module dnspython >= 1.14.0} -BuildRequires: %{python_module falcon > 3.0.0} -BuildRequires: %{python_module flufl.bounce >= 4.0} -BuildRequires: %{python_module flufl.i18n >= 3.2} -BuildRequires: %{python_module flufl.lock >= 5.1} BuildRequires: %{python_module flufl.testing} -BuildRequires: %{python_module gunicorn} -BuildRequires: %{python_module importlib-resources >= 1.1.0} -BuildRequires: %{python_module lazr.config} -BuildRequires: %{python_module mailman >= %{version}} BuildRequires: %{python_module nose2} -BuildRequires: %{python_module passlib} BuildRequires: %{python_module pytest} -BuildRequires: %{python_module python-dateutil >= 2.0} -BuildRequires: %{python_module requests} -BuildRequires: %{python_module zope.component} -BuildRequires: %{python_module zope.configuration} -BuildRequires: %{python_module zope.event} -BuildRequires: %{python_module zope.interface >= 5.0} -%endif -%if 0%{python3_version_nodots} == 38 -# help in replacing any previously installed multiflavor package back to the primary python3 package -Provides: python38-mailman = %{version}-%{release} -Obsoletes: python38-mailman <= %{version}-%{release} +BuildRequires: mailman3 = %{version} %endif %description @@ -114,35 +101,40 @@ Mailman is a mailing list manager from the GNU project. %package -n mailman3 Summary: A mailing list manager +Requires: %{mypython}-SQLAlchemy >= 1.2.3 +Requires: %{mypython}-aiosmtpd >= 1.4.1 +Requires: %{mypython}-alembic +Requires: %{mypython}-atpublic +Requires: %{mypython}-authheaders >= 0.9.2 +Requires: %{mypython}-authres >= 1.0.1 +Requires: %{mypython}-click >= 7.0 +Requires: %{mypython}-dnspython >= 1.14.0 +Requires: %{mypython}-falcon > 3.0.0 +Requires: %{mypython}-flufl.bounce >= 4.0 +Requires: %{mypython}-flufl.i18n >= 3.2 +Requires: %{mypython}-flufl.lock >= 5.1 +Requires: %{mypython}-gunicorn +Requires: %{mypython}-importlib-resources >= 1.1.0 +Requires: %{mypython}-lazr.config +Requires: %{mypython}-passlib +Requires: %{mypython}-python-dateutil >= 2.0 +Requires: %{mypython}-requests +Requires: %{mypython}-setuptools +Requires: %{mypython}-zope.component +Requires: %{mypython}-zope.configuration +Requires: %{mypython}-zope.event +Requires: %{mypython}-zope.interface >= 5.0 Requires: logrotate -Requires: python3-SQLAlchemy >= 1.2.3 -Requires: python3-aiosmtpd >= 1.4.1 -Requires: python3-alembic -Requires: python3-atpublic -Requires: python3-authheaders >= 0.9.2 -Requires: python3-authres >= 1.0.1 -Requires: python3-click >= 7.0 -Requires: python3-dnspython >= 1.14.0 -Requires: python3-falcon > 3.0.0 -Requires: python3-flufl.bounce >= 4.0 -Requires: python3-flufl.i18n >= 3.2 -Requires: python3-flufl.lock >= 5.1 -Requires: python3-gunicorn -Requires: python3-importlib-resources >= 1.1.0 -Requires: python3-lazr.config -Requires: python3-passlib -Requires: python3-python-dateutil >= 2.0 -Requires: python3-requests -Requires: python3-setuptools -Requires: python3-zope.component -Requires: python3-zope.configuration -Requires: python3-zope.event -Requires: python3-zope.interface >= 5.0 Requires(post): update-alternatives Requires(postun):update-alternatives Provides: mailman = %{version} -Provides: python3-mailman = %{version} -Obsoletes: python3-mailman <= %{version} +%if "%{expand:%%%{mypython}_provides}" == "python3" +Provides: python3-mailman = %{version}-%{release} +%endif +Obsoletes: python3-mailman < %{version}-%{release} +# help in replacing any previously installed multiflavor package back to the unprefixed package +Provides: %{mypython}-mailman = %{version}-%{release} +Obsoletes: %{mypython}-mailman < %{version}-%{release} %description -n mailman3 Mailman is a mailing list manager from the GNU project. @@ -257,7 +249,8 @@ getent passwd %{mailman_user} >/dev/null || \ %{_bindir}/runner %{_bindir}/mailman %{_bindir}/master -%{python_sitelib}/* +%{mypython_sitelib}/mailman +%{mypython_sitelib}/mailman-%{version}*-info %{_unitdir}/%{mailman_name}.service %{_unitdir}/%{mailman_name}-digests.service %{_unitdir}/%{mailman_name}-digests.timer