commit: 4db4e7bc40258c310213ab2d0ff77dd458073b1a Author: Petr Vaněk <arkamar <AT> gentoo <DOT> org> AuthorDate: Wed Mar 6 12:44:33 2024 +0000 Commit: Petr Vaněk <arkamar <AT> gentoo <DOT> org> CommitDate: Wed Mar 6 14:32:42 2024 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4db4e7bc
net-im/synapse: fix tests with >=dev-python/netaddr-1.0.0 Netaddr removed implicit prefix support in netaddr-1.0.0 [1], which breaks tests in synapse. This change backports the upstream patch [2] fixing the issue to all versions present in the tree. [1] https://github.com/netaddr/netaddr/pull/360 [2] https://github.com/element-hq/synapse/pull/16953 Signed-off-by: Petr Vaněk <arkamar <AT> gentoo.org> .../files/synapse-1.101.0-netaddr-tests.patch | 33 ++++++++++++++++++++++ net-im/synapse/synapse-1.100.0.ebuild | 5 ++++ net-im/synapse/synapse-1.101.0.ebuild | 5 ++++ net-im/synapse/synapse-1.99.0.ebuild | 5 ++++ 4 files changed, 48 insertions(+) diff --git a/net-im/synapse/files/synapse-1.101.0-netaddr-tests.patch b/net-im/synapse/files/synapse-1.101.0-netaddr-tests.patch new file mode 100644 index 000000000000..ac8dcd6cd68f --- /dev/null +++ b/net-im/synapse/files/synapse-1.101.0-netaddr-tests.patch @@ -0,0 +1,33 @@ +From 959bcf358cb988f242284afe61a1d99fa705150b Mon Sep 17 00:00:00 2001 +From: "Kai A. Hiller" <v02...@gmail.com> +Date: Thu, 22 Feb 2024 20:52:27 +0100 +Subject: [PATCH] Specify IP subnet literals in canonical form + +This is needed, because the netaddr package removed support for the +implicit prefix form in version 1.0.0: +https://github.com/netaddr/netaddr/pull/360 + +Upstream-PR: https://github.com/element-hq/synapse/pull/16953 + +diff --git a/tests/api/test_auth.py b/tests/api/test_auth.py +index ce85ddf22a..bd229cf7e9 100644 +--- a/tests/api/test_auth.py ++++ b/tests/api/test_auth.py +@@ -128,7 +128,7 @@ def test_get_user_by_req_appservice_valid_token_good_ip(self) -> None: + token="foobar", + url="a_url", + sender=self.test_user, +- ip_range_whitelist=IPSet(["192.168/16"]), ++ ip_range_whitelist=IPSet(["192.168.0.0/16"]), + ) + self.store.get_app_service_by_token = Mock(return_value=app_service) + self.store.get_user_by_access_token = AsyncMock(return_value=None) +@@ -147,7 +147,7 @@ def test_get_user_by_req_appservice_valid_token_bad_ip(self) -> None: + token="foobar", + url="a_url", + sender=self.test_user, +- ip_range_whitelist=IPSet(["192.168/16"]), ++ ip_range_whitelist=IPSet(["192.168.0.0/16"]), + ) + self.store.get_app_service_by_token = Mock(return_value=app_service) + self.store.get_user_by_access_token = AsyncMock(return_value=None) diff --git a/net-im/synapse/synapse-1.100.0.ebuild b/net-im/synapse/synapse-1.100.0.ebuild index 5ff5c92194aa..9a49db29ad94 100644 --- a/net-im/synapse/synapse-1.100.0.ebuild +++ b/net-im/synapse/synapse-1.100.0.ebuild @@ -140,6 +140,11 @@ BDEPEND=" ) " +PATCHES=( + # fix tests with >=dev-python/netaddr-1.0.0 + "${FILESDIR}/${PN}-1.101.0-netaddr-tests.patch" +) + # Rust extension QA_FLAGS_IGNORED="usr/lib/python3.*/site-packages/synapse/synapse_rust.abi3.so" diff --git a/net-im/synapse/synapse-1.101.0.ebuild b/net-im/synapse/synapse-1.101.0.ebuild index bc63eedaa678..73bdacfc0959 100644 --- a/net-im/synapse/synapse-1.101.0.ebuild +++ b/net-im/synapse/synapse-1.101.0.ebuild @@ -140,6 +140,11 @@ BDEPEND=" ) " +PATCHES=( + # fix tests with >=dev-python/netaddr-1.0.0 + "${FILESDIR}/${P}-netaddr-tests.patch" +) + # Rust extension QA_FLAGS_IGNORED="usr/lib/python3.*/site-packages/synapse/synapse_rust.abi3.so" diff --git a/net-im/synapse/synapse-1.99.0.ebuild b/net-im/synapse/synapse-1.99.0.ebuild index d224c35da010..231645a8542e 100644 --- a/net-im/synapse/synapse-1.99.0.ebuild +++ b/net-im/synapse/synapse-1.99.0.ebuild @@ -140,6 +140,11 @@ BDEPEND=" ) " +PATCHES=( + # fix tests with >=dev-python/netaddr-1.0.0 + "${FILESDIR}/${PN}-1.101.0-netaddr-tests.patch" +) + # Rust extension QA_FLAGS_IGNORED="usr/lib/python3.*/site-packages/synapse/synapse_rust.abi3.so"