diff options
author | Martin Weinelt <mweinelt@users.noreply.github.com> | 2023-11-28 00:31:52 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-28 00:31:52 +0100 |
commit | c76b72caa421e31d998e4a05387ebd3b40454327 (patch) | |
tree | 3e9149b16dd70460a91aa3669800976ab477f177 | |
parent | f72ea957a987c7f232ec4dc86ab685b93c5db652 (diff) | |
parent | c150877925aacf41aa51d28bc82693ad2da1b541 (diff) |
Merge pull request #270456 from mweinelt/hass-cleanup
home-assistant: some clean up
-rw-r--r-- | pkgs/servers/home-assistant/default.nix | 63 |
1 files changed, 26 insertions, 37 deletions
diff --git a/pkgs/servers/home-assistant/default.nix b/pkgs/servers/home-assistant/default.nix index 1c5f52588e460..7f6fca8a090b1 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 @@ -436,6 +432,9 @@ in python.pkgs.buildPythonApplication rec { voluptuous voluptuous-serialize yarl + # REQUIREMENTS in homeassistant/auth/mfa_modules/totp.py and homeassistant/auth/mfa_modules/notify.py + pyotp + pyqrcode # Implicit dependency via homeassistant/requirements.py setuptools ]; @@ -462,16 +461,12 @@ in python.pkgs.buildPythonApplication rec { respx syrupy tomli - # required through tests/auth/mfa_modules/test_otp.py - pyotp # Sneakily imported in tests/conftest.py paho-mqtt ] ++ lib.concatMap (component: getPackages component python.pkgs) [ # some components are needed even if tests in tests/components are disabled "default_config" "hue" - # for tests/test_config.py::test_merge_id_schema - "qwikswitch" ]; pytestFlagsArray = [ @@ -484,12 +479,6 @@ in python.pkgs.buildPythonApplication rec { "--showlocals" # AssertionError: assert 1 == 0 "--deselect tests/test_config.py::test_merge" - # AssertionError: assert 2 == 1 - "--deselect=tests/helpers/test_translation.py::test_caching" - # AssertionError: assert None == RegistryEntry - "--deselect=tests/helpers/test_entity_registry.py::test_get_or_create_updates_data" - # AssertionError: assert 2 == 1 - "--deselect=tests/helpers/test_entity_values.py::test_override_single_value" # AssertionError: assert 'WARNING' not in '2023-11-10 ...nt abc[L]>\n'" "--deselect=tests/helpers/test_script.py::test_multiple_runs_repeat_choose" # tests are located in tests/ |