From 08b01b4771281dd90917d552adb429457f0191f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Wed, 12 Nov 2025 19:22:40 -0800 Subject: [PATCH 1/2] python3Packages.aiomodernforms: replace async-timeout with asyncio.timeout --- .../python-modules/aiomodernforms/default.nix | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/pkgs/development/python-modules/aiomodernforms/default.nix b/pkgs/development/python-modules/aiomodernforms/default.nix index 103c2e9fad03..1654ae5a92f3 100644 --- a/pkgs/development/python-modules/aiomodernforms/default.nix +++ b/pkgs/development/python-modules/aiomodernforms/default.nix @@ -2,6 +2,8 @@ lib, buildPythonPackage, fetchFromGitHub, + fetchpatch, + setuptools, aiohttp, backoff, yarl, @@ -13,7 +15,7 @@ buildPythonPackage rec { pname = "aiomodernforms"; version = "0.1.8"; - format = "setuptools"; + pyproject = true; src = fetchFromGitHub { owner = "wonderslug"; @@ -22,13 +24,18 @@ buildPythonPackage rec { hash = "sha256-Vx51WBjjNPIfLlwMnAuwHnGNljhnjKkU0tWB9M9rjsw="; }; - postPatch = '' - substituteInPlace aiomodernforms/modernforms.py --replace-fail \ - "with async_timeout.timeout(self._request_timeout):" \ - "async with async_timeout.timeout(self._request_timeout):" - ''; + patches = [ + # https://github.com/wonderslug/aiomodernforms/pull/274 + (fetchpatch { + name = "replace-async-timeout-with-asyncio.timeout.patch"; + url = "https://github.com/wonderslug/aiomodernforms/commit/61f1330b2fc244565fd97ae392b9778faa1bab09.patch"; + hash = "sha256-7sy5/HgPYgVpULgeEu3tFBa2iXIskAqcarf0RndxTpE="; + }) + ]; - propagatedBuildInputs = [ + build-system = [ setuptools ]; + + dependencies = [ aiohttp backoff yarl From 07e7f6f517ff74ecbf56b2b262f37229c93ca8ba Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sat, 15 Nov 2025 14:08:21 +0100 Subject: [PATCH 2/2] python3Packages.aimodernfroms: allow local networking on darwin Fixes the test suite. --- pkgs/development/python-modules/aiomodernforms/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/development/python-modules/aiomodernforms/default.nix b/pkgs/development/python-modules/aiomodernforms/default.nix index 1654ae5a92f3..bd3f05b94273 100644 --- a/pkgs/development/python-modules/aiomodernforms/default.nix +++ b/pkgs/development/python-modules/aiomodernforms/default.nix @@ -53,6 +53,8 @@ buildPythonPackage rec { "test_empty_response" ]; + __darwinAllowLocalNetworking = true; + pythonImportsCheck = [ "aiomodernforms" ]; meta = with lib; {