From 9efcaa10c5c8a409684935cb921450f1b8007523 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Finance?= Date: Sat, 13 May 2023 10:50:03 +0200 Subject: [PATCH] python311Packages.boto: fix build --- .../boto/0005-Don-t-mock-list-subclass.patch | 21 +++++++++++++++++++ .../python-modules/boto/default.nix | 3 +++ 2 files changed, 24 insertions(+) create mode 100644 pkgs/development/python-modules/boto/0005-Don-t-mock-list-subclass.patch diff --git a/pkgs/development/python-modules/boto/0005-Don-t-mock-list-subclass.patch b/pkgs/development/python-modules/boto/0005-Don-t-mock-list-subclass.patch new file mode 100644 index 000000000000..4add58640d7a --- /dev/null +++ b/pkgs/development/python-modules/boto/0005-Don-t-mock-list-subclass.patch @@ -0,0 +1,21 @@ +From: Jochen Sprickerhof +Date: Thu, 15 Dec 2022 07:44:54 +0100 +Subject: Don't mock list subclass + +--- + tests/unit/ec2/test_volume.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tests/unit/ec2/test_volume.py b/tests/unit/ec2/test_volume.py +index 81d7f55..d4d8e4f 100644 +--- a/tests/unit/ec2/test_volume.py ++++ b/tests/unit/ec2/test_volume.py +@@ -55,7 +55,7 @@ class VolumeTests(unittest.TestCase): + @mock.patch("boto.resultset.ResultSet") + def test_startElement_with_name_tagSet_calls_ResultSet(self, ResultSet, startElement): + startElement.return_value = None +- result_set = mock.Mock(ResultSet([("item", Tag)])) ++ result_set = ResultSet([("item", Tag)]) + volume = Volume() + volume.tags = result_set + retval = volume.startElement("tagSet", None, None) diff --git a/pkgs/development/python-modules/boto/default.nix b/pkgs/development/python-modules/boto/default.nix index 8d4d8255b953..08a773cf6bb2 100644 --- a/pkgs/development/python-modules/boto/default.nix +++ b/pkgs/development/python-modules/boto/default.nix @@ -22,6 +22,9 @@ buildPythonPackage rec { # fixes hmac tests # https://sources.debian.org/src/python-boto/2.49.0-4/debian/patches/bug-953970_python3.8-compat.patch/ ./bug-953970_python3.8-compat.patch + # fixes test_startElement_with_name_tagSet_calls_ResultSet + # https://sources.debian.org/src/python-boto/2.49.0-4.1/debian/patches/0005-Don-t-mock-list-subclass.patch/ + ./0005-Don-t-mock-list-subclass.patch ]; # boto is deprecated by upstream as of 2021-05-27 (https://github.com/boto/boto/commit/4980ac58764c3d401cb0b9552101f9c61c18f445)