From be50a4d290f5959c43849abe7e46f8a2358f4283 Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Sat, 12 Aug 2023 13:02:01 +0200 Subject: [PATCH 1/6] mailmanPackages.postorius: 1.3.6 -> 1.3.8 ChangeLog: https://gitlab.com/mailman/postorius/-/compare/1.3.6...1.3.8 --- pkgs/servers/mail/mailman/postorius.nix | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pkgs/servers/mail/mailman/postorius.nix b/pkgs/servers/mail/mailman/postorius.nix index fefffffc87c8..1e93b20f3232 100644 --- a/pkgs/servers/mail/mailman/postorius.nix +++ b/pkgs/servers/mail/mailman/postorius.nix @@ -4,13 +4,11 @@ with python3.pkgs; buildPythonPackage rec { pname = "postorius"; - # Note: Mailman core must be on the latest version before upgrading Postorious. - # See: https://gitlab.com/mailman/postorius/-/issues/516#note_544571309 - version = "1.3.6"; + version = "1.3.8"; src = fetchPypi { inherit pname version; - sha256 = "sha256-KwzEU9IfcQ6YPZu3jPuFrd6ux/3e2pzoLfTrak/aGmg="; + sha256 = "sha256-1mSt+PVx3xUJDc5JwrCmKiRNIDwbsjjbM2Fi5Sgz6h8="; }; propagatedBuildInputs = [ django-mailman3 readme_renderer ]; From 9c9615018927f47efb18f3da0653a0f269086179 Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Sat, 12 Aug 2023 13:05:57 +0200 Subject: [PATCH 2/6] mailmanPackages.hyperkitty: 1.3.5 -> 1.3.7 ChangeLog: https://gitlab.com/mailman/hyperkitty/-/compare/1.3.5...1.3.7 --- ...ble-broken-test_help_output-testcase.patch | 36 +++++++++++++++++++ pkgs/servers/mail/mailman/hyperkitty.nix | 20 ++--------- 2 files changed, 39 insertions(+), 17 deletions(-) create mode 100644 pkgs/servers/mail/mailman/0001-Disable-broken-test_help_output-testcase.patch diff --git a/pkgs/servers/mail/mailman/0001-Disable-broken-test_help_output-testcase.patch b/pkgs/servers/mail/mailman/0001-Disable-broken-test_help_output-testcase.patch new file mode 100644 index 000000000000..3b6094bd02f0 --- /dev/null +++ b/pkgs/servers/mail/mailman/0001-Disable-broken-test_help_output-testcase.patch @@ -0,0 +1,36 @@ +From 1a914beafe2b00770213fa4d146ffad9d897dc0c Mon Sep 17 00:00:00 2001 +From: Maximilian Bosch +Date: Sat, 12 Aug 2023 12:27:25 +0200 +Subject: [PATCH] Disable broken `test_help_output` testcase + +The assertion fails, but checking for the exact whereabouts of helptext +doesn't bring too much value anyways, so it seems OK to just skip the +test. +--- + .../tests/commands/test_attachments_to_file.py | 13 ------------- + 1 file changed, 13 deletions(-) + +diff --git a/hyperkitty/tests/commands/test_attachments_to_file.py b/hyperkitty/tests/commands/test_attachments_to_file.py +index b3e61f3a..8db7c4b2 100644 +--- a/hyperkitty/tests/commands/test_attachments_to_file.py ++++ b/hyperkitty/tests/commands/test_attachments_to_file.py +@@ -83,16 +83,3 @@ class CommandTestCase(TestCase): + self.assertEqual(fp.getvalue(), """\ + 2 attachments moved. + """) +- +- def test_help_output(self): +- with io.StringIO() as fp, redirect_stdout(fp): +- with suppress(SystemExit): +- call_command('attachments_to_file', '--help') +- +- output_value = fp.getvalue() +- assert ( +- "HYPERKITTY_ATTACHMENT_FOLDER" in output_value +- and "-c CHUNK_SIZE" in output_value +- and "-c CHUNK_SIZE, --chunk-size CHUNK_SIZE" in output_value +- and "-v {0,1}, --verbosity {0,1}" in output_value +- ) +-- +2.40.1 + diff --git a/pkgs/servers/mail/mailman/hyperkitty.nix b/pkgs/servers/mail/mailman/hyperkitty.nix index f0cac80bb5fd..334a24b1ed00 100644 --- a/pkgs/servers/mail/mailman/hyperkitty.nix +++ b/pkgs/servers/mail/mailman/hyperkitty.nix @@ -1,36 +1,22 @@ { lib , python3 , fetchPypi -, fetchpatch }: with python3.pkgs; buildPythonPackage rec { pname = "HyperKitty"; - # Note: Mailman core must be on the latest version before upgrading HyperKitty. - # See: https://gitlab.com/mailman/postorius/-/issues/516#note_544571309 - version = "1.3.5"; + version = "1.3.7"; disabled = pythonOlder "3.8"; src = fetchPypi { inherit pname version; - sha256 = "sha256-gmkiK8pIHfubbbxNdm/D6L2o722FptxYgINYdIUOn4Y="; + sha256 = "sha256-TXSso+wwVGdBymIzns5yOS4pj1EdConmm87b/NyBAss="; }; patches = [ - # FIXME: backport Python 3.10 support fix, remove for next release - (fetchpatch { - url = "https://gitlab.com/mailman/hyperkitty/-/commit/551a44a76e46931fc5c1bcb341235d8f579820be.patch"; - sha256 = "sha256-5XCrvyrDEqH3JryPMoOXSlVVDLQ+PdYBqwGYxkExdvk="; - includes = [ "hyperkitty/*" ]; - }) - - # Fix for Python >=3.9.13 - (fetchpatch { - url = "https://gitlab.com/mailman/hyperkitty/-/commit/3efe7507944dbdbfcfa4c182d332528712476b28.patch"; - sha256 = "sha256-yXuhTbmfDiYEXEsnz+zp+xLHRqI4GtkOhGHN+37W0iQ="; - }) + ./0001-Disable-broken-test_help_output-testcase.patch ]; postPatch = '' From 892661f45b57a188986a2f5518d163146b11fd9e Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Sat, 12 Aug 2023 13:00:00 +0200 Subject: [PATCH 3/6] mailmanPackages.web: 0.0.5 -> 0.0.6 ChangeLog: https://gitlab.com/mailman/mailman-web/-/compare/0.0.5...0.0.6 --- pkgs/servers/mail/mailman/web.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/servers/mail/mailman/web.nix b/pkgs/servers/mail/mailman/web.nix index bb50586e8d56..b63fa8c65505 100644 --- a/pkgs/servers/mail/mailman/web.nix +++ b/pkgs/servers/mail/mailman/web.nix @@ -6,12 +6,12 @@ with python3.pkgs; buildPythonPackage rec { pname = "mailman-web"; - version = "0.0.5"; + version = "0.0.6"; disabled = pythonOlder "3.8"; src = fetchPypi { inherit pname version; - sha256 = "sha256-9pvs/VATAsMcGNrj58b/LifysEPTNhrAP57sfp4nX6Q="; + sha256 = "sha256-UWdqrcx529r6kwgf0YEHiDrpZlGoUBR6OdYtHMTPMGY="; }; postPatch = '' From 2cefe69f6f97b705fc49cdfb9bccca4d01280fa0 Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Sat, 12 Aug 2023 13:10:05 +0200 Subject: [PATCH 4/6] mailmanPackages.python: allow changing python package-set used for mailman When having a patch for a python module that should only be used for mailman, but for nothing else, it's now possible to apply it like this: self: super: { mailmanPackages = super.mailmanPackages.extend (mailmanSelf: mailmanSuper: { python3 = mailmanSuper.python3.override { overlay = pythonSelf: pythonSuper: { psycopg2 = /* ... */; }; }; }); } The underlying issue is that the `packageOverrides`-mechanism of `pkgs.python3` doesn't compose, so an optional overlay is manually applied to the `python3` used for mailman. --- pkgs/servers/mail/mailman/python.nix | 34 +++++++++++++++------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/pkgs/servers/mail/mailman/python.nix b/pkgs/servers/mail/mailman/python.nix index 288e48d814e4..58256a961aba 100644 --- a/pkgs/servers/mail/mailman/python.nix +++ b/pkgs/servers/mail/mailman/python.nix @@ -1,19 +1,21 @@ -{ python3, fetchPypi }: +{ python3, lib, overlay ? (_: _: {}) }: python3.override { - packageOverrides = self: super: { - # does not find tests - alembic = super.alembic.overridePythonAttrs (oldAttrs: { - doCheck = false; - }); - # Fixes `AssertionError: database connection isn't set to UTC` - psycopg2 = super.psycopg2.overridePythonAttrs (a: rec { - version = "2.8.6"; - src = fetchPypi { - inherit version; - inherit (a) pname; - sha256 = "fb23f6c71107c37fd667cb4ea363ddeb936b348bbd6449278eb92c189699f543"; - }; - }); - }; + packageOverrides = lib.composeExtensions + (self: super: { + # does not find tests + alembic = super.alembic.overridePythonAttrs (oldAttrs: { + doCheck = false; + }); + # Fixes `AssertionError: database connection isn't set to UTC` + psycopg2 = super.psycopg2.overridePythonAttrs (a: (rec { + version = "2.8.6"; + src = super.fetchPypi { + inherit version; + inherit (a) pname; + sha256 = "fb23f6c71107c37fd667cb4ea363ddeb936b348bbd6449278eb92c189699f543"; + }; + })); + }) + overlay; } From 8b45dd8698683cd45cf1710666a7542d49b09eb9 Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Sat, 12 Aug 2023 13:17:15 +0200 Subject: [PATCH 5/6] mailmanPackages: remove psycopg2 pin This hack was necessary for django 2.x[1] which was the default `django` version (i.e. current LTS) when this fix was needed. However, 2.x is now EOL and not packaged anymore and mailman is running with django3, so this can be dropped. [1] https://github.com/psycopg/psycopg2/issues/1293 --- pkgs/servers/mail/mailman/python.nix | 9 --------- 1 file changed, 9 deletions(-) diff --git a/pkgs/servers/mail/mailman/python.nix b/pkgs/servers/mail/mailman/python.nix index 58256a961aba..be50e9be7e61 100644 --- a/pkgs/servers/mail/mailman/python.nix +++ b/pkgs/servers/mail/mailman/python.nix @@ -7,15 +7,6 @@ python3.override { alembic = super.alembic.overridePythonAttrs (oldAttrs: { doCheck = false; }); - # Fixes `AssertionError: database connection isn't set to UTC` - psycopg2 = super.psycopg2.overridePythonAttrs (a: (rec { - version = "2.8.6"; - src = super.fetchPypi { - inherit version; - inherit (a) pname; - sha256 = "fb23f6c71107c37fd667cb4ea363ddeb936b348bbd6449278eb92c189699f543"; - }; - })); }) overlay; } From f8a17e4200d3e79ef1e21d802af6eb4979c3e6b6 Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Tue, 15 Aug 2023 12:32:07 +0200 Subject: [PATCH 6/6] mailman/python: remove obsolete almebic override, add explanation why this empty overlay should be kept --- pkgs/servers/mail/mailman/python.nix | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/pkgs/servers/mail/mailman/python.nix b/pkgs/servers/mail/mailman/python.nix index be50e9be7e61..cd18fa161fac 100644 --- a/pkgs/servers/mail/mailman/python.nix +++ b/pkgs/servers/mail/mailman/python.nix @@ -3,10 +3,21 @@ python3.override { packageOverrides = lib.composeExtensions (self: super: { - # does not find tests - alembic = super.alembic.overridePythonAttrs (oldAttrs: { - doCheck = false; - }); + /* + This overlay can be used whenever we need to override + dependencies specific to the mailman ecosystem: in the past + this was necessary for e.g. psycopg2[1] or sqlalchemy[2]. + + In such a large ecosystem this sort of issue is expected + to arise again. Since we don't want to clutter the python package-set + itself with version overrides and don't want to change the APIs + in here back and forth every time this comes up (and as a result + force users to change their code accordingly), this empty overlay + is kept on purpose. + + [1] 72a14ea563a3f5bf85db659349a533fe75a8b0ce + [2] f931bc81d63f5cfda55ac73d754c87b3fd63b291 + */ }) overlay; }