diff options
author | Martin Weinelt <hexa@darmstadt.ccc.de> | 2023-11-27 19:05:49 +0100 |
---|---|---|
committer | Martin Weinelt <hexa@darmstadt.ccc.de> | 2023-11-27 19:05:49 +0100 |
commit | cbbbee5ce3f3deb416c7a495f627233eb8235a1c (patch) | |
tree | 9af1abe5b5a883c5204ee289f68a2f61f9172ac0 /pkgs/servers/home-assistant | |
parent | d4010ce9909dfb02de7b40584877b50b871da7e4 (diff) | |
download | nixlib-cbbbee5ce3f3deb416c7a495f627233eb8235a1c.tar nixlib-cbbbee5ce3f3deb416c7a495f627233eb8235a1c.tar.gz nixlib-cbbbee5ce3f3deb416c7a495f627233eb8235a1c.tar.bz2 nixlib-cbbbee5ce3f3deb416c7a495f627233eb8235a1c.tar.lz nixlib-cbbbee5ce3f3deb416c7a495f627233eb8235a1c.tar.xz nixlib-cbbbee5ce3f3deb416c7a495f627233eb8235a1c.tar.zst nixlib-cbbbee5ce3f3deb416c7a495f627233eb8235a1c.zip |
home-assistant: migrate to pythonRelaxDepsHook
Mutating the resulting wheel, which has a more stable format, is the better solution, than the homegrown sed expression we used up until now.
Diffstat (limited to 'pkgs/servers/home-assistant')
-rw-r--r-- | pkgs/servers/home-assistant/default.nix | 50 |
1 files changed, 23 insertions, 27 deletions
diff --git a/pkgs/servers/home-assistant/default.nix b/pkgs/servers/home-assistant/default.nix index 1c5f52588e46..4b0b4ee83b66 100644 --- a/pkgs/servers/home-assistant/default.nix +++ b/pkgs/servers/home-assistant/default.nix @@ -352,10 +352,32 @@ in python.pkgs.buildPythonApplication rec { }; nativeBuildInputs = with python.pkgs; [ + pythonRelaxDepsHook setuptools wheel ]; + pythonRelaxDeps = [ + "aiohttp" + "attrs" + "awesomeversion" + "bcrypt" + "ciso8601" + "cryptography" + "home-assistant-bluetooth" + "httpx" + "ifaddr" + "orjson" + "pip" + "PyJWT" + "pyOpenSSL" + "PyYAML" + "requests" + "typing-extensions" + "voluptuous-serialize" + "yarl" + ]; + # copy tests early, so patches apply as they would to the git repo prePatch = '' cp --no-preserve=mode --recursive ${gitSrc}/tests ./ @@ -374,33 +396,7 @@ in python.pkgs.buildPythonApplication rec { }) ]; - postPatch = let - relaxedConstraints = [ - "aiohttp" - "attrs" - "awesomeversion" - "bcrypt" - "ciso8601" - "cryptography" - "home-assistant-bluetooth" - "httpx" - "ifaddr" - "orjson" - "pip" - "PyJWT" - "pyOpenSSL" - "PyYAML" - "requests" - "typing-extensions" - "voluptuous-serialize" - "yarl" - ]; - in '' - sed -r -i \ - ${lib.concatStringsSep "\n" (map (package: - ''-e 's/${package}[<>=]+.*/${package}",/g' \'' - ) relaxedConstraints)} - pyproject.toml + postPatch = '' substituteInPlace tests/test_config.py --replace '"/usr"' '"/build/media"' sed -i 's/setuptools[~=]/setuptools>/' pyproject.toml |