[arch-commits] Commit in mailman3/trunk (2 files)

David Runge dvzrv at archlinux.org
Thu Apr 2 08:54:13 UTC 2020


    Date: Thursday, April 2, 2020 @ 08:54:12
  Author: dvzrv
Revision: 609403

upgpkg: mailman3 3.3.0-6: Adding (backported) upstream patch for a changed importlib_resources API, that breaks postorius.

Added:
  mailman3/trunk/mailman3-3.3.0-importlib_resources.patch
Modified:
  mailman3/trunk/PKGBUILD

------------------------------------------+
 PKGBUILD                                 |   14 ++-
 mailman3-3.3.0-importlib_resources.patch |  104 +++++++++++++++++++++++++++++
 2 files changed, 114 insertions(+), 4 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2020-04-02 08:46:14 UTC (rev 609402)
+++ PKGBUILD	2020-04-02 08:54:12 UTC (rev 609403)
@@ -3,7 +3,7 @@
 _name=mailman
 pkgname=mailman3
 pkgver=3.3.0
-pkgrel=5
+pkgrel=6
 pkgdesc="The GNU mailing list manager"
 arch=('any')
 url="https://www.list.org/"
@@ -16,7 +16,7 @@
 'python-zope-component' 'python-zope-configuration' 'python-zope-event'
 'python-zope-interface')
 checkdepends=('python-coverage' 'python-diff-cover' 'python-flufl.testing'
-'python-nose2' 'python-psycopg2' 'python-pymysql' 'python-pytest')
+'python-psycopg2' 'python-pymysql' 'python-pytest')
 optdepends=('hyperkitty: for local archive and list interaction'
             'postorius: for local configuration interaction'
             'mailman3-hyperkitty: for archiving mails with an instance of hyperkitty'
@@ -28,6 +28,7 @@
 replaces=('mailman-core')
 backup=('etc/mailman.cfg')
 source=("https://files.pythonhosted.org/packages/source/${_name::1}/${_name}/${_name}-${pkgver}.tar.gz"{,.asc}
+        "${pkgname}-3.3.0-importlib_resources.patch"
         "${pkgname}.service"
         "${pkgname}-digests.service"
         "${pkgname}-digests.timer"
@@ -39,6 +40,7 @@
         "${pkgname}.tmpfiles")
 sha512sums=('63cf30c102751c1cae086f4c046767c2d817ad57097bd60bc838ead19c4e29ed1bc5d4cc2c1eef40f41787daf60d8b98033f64064d6ad4567a9552b5fb2cabd8'
             'SKIP'
+            '0ade63abfc95ed0f5941e44657059c7a8b25382bc10d19b1ad60c7fb8b398ac9579dc2bdac9160cb023f2e323b74c15b90a1ea91b51ef1c8f930547889722d3e'
             '6d1fbb52f72a93c66cc8018d83cbdde1878a3a759743f54252d711c027a732e942d2154a4ef62d011844373c66706dc91fc85757239ddcd07f77782d31b78d60'
             '734e0cdf1198f6609a5e41312c48c5c4e492ba5b9acc3af4cd302a6ed148933396333077932e25aedfc50ff3f68b1d4898137193bdadaf71e23045ec8e96be10'
             '5d7ccba8cf1262ab052078f2188ded15e43e1201302c7c24ce763efef9789ec99d8ea9a19e8fbd9bc5a38f47a162fe5cf4b0ade284894cb57af66350f23507bc'
@@ -53,6 +55,9 @@
 prepare() {
   mv -v "${_name}-$pkgver" "$pkgname-$pkgver"
   cd "$pkgname-$pkgver"
+  # backport of: fixing importlib_resources, which has changed API
+  # https://gitlab.com/mailman/mailman/-/merge_requests/605
+  patch -Np1 -i "../${pkgname}-3.3.0-importlib_resources.patch"
   # making sure, mailman runs in a FHS compliant way
   echo -e "[mailman]\nlayout: fhs" >> var/etc/mailman.cfg
 }
@@ -62,10 +67,11 @@
   python setup.py build
 }
 
-# tests are only integration tests
+# # tests are only integration tests and don't work without a previously setup
+# # mail server
 # check() {
 #   cd "$pkgname-$pkgver"
-#   nose2 -v
+#   pytest -v
 # }
 
 package() {

Added: mailman3-3.3.0-importlib_resources.patch
===================================================================
--- mailman3-3.3.0-importlib_resources.patch	                        (rev 0)
+++ mailman3-3.3.0-importlib_resources.patch	2020-04-02 08:54:12 UTC (rev 609403)
@@ -0,0 +1,104 @@
+From d507a90a39558d35217109393aba314f531e924e Mon Sep 17 00:00:00 2001
+From: Abhilash Raj <raj.abhilash1 at gmail.com>
+Date: Sun, 8 Mar 2020 23:07:44 -0700
+Subject: [PATCH] Fix the TemplateLoader for the new API in
+ importlib_resources.
+
+---
+ setup.py                                      | 2 +-
+ src/mailman/utilities/i18n.py                 | 4 ++--
+ src/mailman/utilities/tests/test_modules.py   | 6 +++---
+ src/mailman/utilities/tests/test_templates.py | 4 ++--
+ 5 files changed, 10 insertions(+), 8 deletions(-)
+
+diff --git a/setup.py b/setup.py
+index 10c13c04c..22f04b709 100644
+--- a/setup.py
++++ b/setup.py
+@@ -115,7 +115,7 @@ case second 'm'.  Any other spelling is incorrect.""",
+         'flufl.bounce',
+         'flufl.i18n>=2.0',
+         'flufl.lock>=3.1',
+-        'importlib_resources',
++        'importlib_resources>=1.1.0',
+         'gunicorn',
+         'lazr.config',
+         'python-dateutil>=2.0',
+diff --git a/src/mailman/utilities/i18n.py b/src/mailman/utilities/i18n.py
+index 17d6c23ba..77e042020 100644
+--- a/src/mailman/utilities/i18n.py
++++ b/src/mailman/utilities/i18n.py
+@@ -21,7 +21,7 @@ import os
+ import sys
+ 
+ from contextlib import ExitStack
+-from importlib_resources import path
++from importlib_resources import files
+ from itertools import product
+ from mailman.config import config
+ from mailman.core.constants import system_preferences
+@@ -114,7 +114,7 @@ def search(resources, template_file, mlist=None, language=None):
+         languages.append(language)
+     languages.reverse()
+     # The non-language qualified $template_dir paths in search order.
+-    templates_dir = str(resources.enter_context(path('mailman', 'templates')))
++    templates_dir = str(resources.enter_context(files('mailman.templates')))
+     paths = [templates_dir, os.path.join(config.TEMPLATE_DIR, 'site')]
+     if mlist is not None:
+         # Don't forget these are in REVERSE search order!
+diff --git a/src/mailman/utilities/tests/test_modules.py b/src/mailman/utilities/tests/test_modules.py
+index 669c07abe..f3c1bb6bb 100644
+--- a/src/mailman/utilities/tests/test_modules.py
++++ b/src/mailman/utilities/tests/test_modules.py
+@@ -22,7 +22,7 @@ import sys
+ import unittest
+ 
+ from contextlib import ExitStack, contextmanager
+-from importlib_resources import path
++from importlib_resources import files
+ from mailman.interfaces.rules import IRule
+ from mailman.interfaces.styles import IStyle
+ from mailman.testing.helpers import configuration
+@@ -162,7 +162,7 @@ class AbstractStyle:
+     def test_find_pluggable_components_by_plugin_name(self):
+         with ExitStack() as resources:
+             testing_path = resources.enter_context(
+-                path('mailman.plugins.testing', ''))
++                files('mailman.plugins.testing'))
+             resources.enter_context(hack_syspath(0, str(testing_path)))
+             resources.enter_context(configuration('plugin.example', **{
+                 'class': 'example.hooks.ExamplePlugin',
+@@ -174,7 +174,7 @@ class AbstractStyle:
+     def test_find_pluggable_components_by_component_package(self):
+         with ExitStack() as resources:
+             testing_path = resources.enter_context(
+-                path('mailman.plugins.testing', ''))
++                files('mailman.plugins.testing'))
+             resources.enter_context(hack_syspath(0, str(testing_path)))
+             resources.enter_context(configuration('plugin.example', **{
+                 'class': 'example.hooks.ExamplePlugin',
+diff --git a/src/mailman/utilities/tests/test_templates.py b/src/mailman/utilities/tests/test_templates.py
+index 32e8c5ad9..34ac5bcdf 100644
+--- a/src/mailman/utilities/tests/test_templates.py
++++ b/src/mailman/utilities/tests/test_templates.py
+@@ -23,7 +23,7 @@ import tempfile
+ import unittest
+ 
+ from contextlib import ExitStack
+-from importlib_resources import path as resource_path
++from importlib_resources import files as resource_path
+ from mailman.app.lifecycle import create_list
+ from mailman.config import config
+ from mailman.interfaces.languages import ILanguageManager
+@@ -64,7 +64,7 @@ class TestSearchOrder(unittest.TestCase):
+         # /m/ as the root.
+         with ExitStack() as resources:
+             in_tree = str(resources.enter_context(
+-                resource_path('mailman', 'templates')).parent)
++                resource_path('mailman.templates')).parent)
+             raw_search_order = search(
+                 resources, template_file, mailing_list, language)
+         for path in raw_search_order:
+-- 
+2.24.1
+


More information about the arch-commits mailing list