From c09da2061b000fb33a706697e05d204e2d3a8723 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sun, 16 Jan 2022 22:04:42 +0100 Subject: [PATCH] home-assistant: update constraint relaxing mechanism And update constraints. --- pkgs/servers/home-assistant/default.nix | 31 ++++++++++++++++--------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/pkgs/servers/home-assistant/default.nix b/pkgs/servers/home-assistant/default.nix index 0cb5e13fbd27..e26c38bc87f3 100644 --- a/pkgs/servers/home-assistant/default.nix +++ b/pkgs/servers/home-assistant/default.nix @@ -206,17 +206,26 @@ in python.pkgs.buildPythonApplication rec { ./patches/tests-ignore-OSErrors-in-hass-fixture.patch ]; - postPatch = '' - substituteInPlace setup.py \ - --replace "aiohttp==3.8.1" "aiohttp" \ - --replace "async_timeout==4.0.0" "async_timeout" \ - --replace "bcrypt==3.1.7" "bcrypt" \ - --replace "cryptography==35.0.0" "cryptography" \ - --replace "httpx==0.21.0" "httpx" \ - --replace "pip>=8.0.3,<20.3" "pip" \ - --replace "PyJWT==2.1.0" "PyJWT" \ - --replace "pyyaml==6.0" "pyyaml" \ - --replace "yarl==1.6.3" "yarl" + postPatch = let + relaxedConstraints = [ + "aiohttp" + "async_timeout" + "attrs" + "awesomeversion" + "bcrypt" + "cryptography" + "httpx" + "pip" + "PyJWT" + "requests" + "yarl" + ]; + in '' + sed -r -i \ + ${lib.concatStringsSep "\n" (map (package: + ''-e 's@${package}[<>=]+.*@${package}",@g' \'' + ) relaxedConstraints)} + setup.py substituteInPlace tests/test_config.py --replace '"/usr"' '"/build/media"' '';