From 801c894f10409d2b247fd01e895b7af5d3f0f518 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Mon, 16 Jun 2025 09:32:55 -0700 Subject: [PATCH] python3Packages.aiohttp: fix tests on aarch64-darwin --- .../python-modules/aiohttp/default.nix | 8 ++++++- .../python-modules/aiohttp/remove-isal.patch | 21 +++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 pkgs/development/python-modules/aiohttp/remove-isal.patch diff --git a/pkgs/development/python-modules/aiohttp/default.nix b/pkgs/development/python-modules/aiohttp/default.nix index d331adf8f8cb..1bde94676217 100644 --- a/pkgs/development/python-modules/aiohttp/default.nix +++ b/pkgs/development/python-modules/aiohttp/default.nix @@ -34,6 +34,7 @@ blockbuster, freezegun, gunicorn, + isa-l, isal, proxy-py, pytest-codspeed, @@ -59,6 +60,10 @@ buildPythonPackage rec { hash = "sha256-ciZGOOfVXYoLzYNIkota3MXMRMxlztf+mFFo0y9r+Lk="; }; + patches = lib.optionals (!lib.meta.availableOn stdenv.hostPlatform isa-l) [ + ./remove-isal.patch + ]; + postPatch = '' rm -r vendor patchShebangs tools @@ -105,7 +110,8 @@ buildPythonPackage rec { blockbuster freezegun gunicorn - isal + # broken on aarch64-darwin + (if lib.meta.availableOn stdenv.hostPlatform isa-l then isal else null) proxy-py pytest-codspeed pytest-cov-stub diff --git a/pkgs/development/python-modules/aiohttp/remove-isal.patch b/pkgs/development/python-modules/aiohttp/remove-isal.patch new file mode 100644 index 000000000000..4a91fca368ae --- /dev/null +++ b/pkgs/development/python-modules/aiohttp/remove-isal.patch @@ -0,0 +1,21 @@ +diff --git a/tests/conftest.py b/tests/conftest.py +index 62fb04f2e..bb5b279dd 100644 +--- a/tests/conftest.py ++++ b/tests/conftest.py +@@ -12,7 +12,6 @@ from typing import Any, AsyncIterator, Callable, Generator, Iterator + from unittest import mock + from uuid import uuid4 + +-import isal.isal_zlib + import pytest + import zlib_ng.zlib_ng + from blockbuster import blockbuster_ctx +@@ -333,7 +332,7 @@ def unused_port_socket() -> Generator[socket.socket, None, None]: + s.close() + + +-@pytest.fixture(params=[zlib, zlib_ng.zlib_ng, isal.isal_zlib]) ++@pytest.fixture(params=[zlib, zlib_ng.zlib_ng]) + def parametrize_zlib_backend( + request: pytest.FixtureRequest, + ) -> Generator[None, None, None]: