diff options
Diffstat (limited to 'nixpkgs/pkgs/servers/home-assistant/default.nix')
-rw-r--r-- | nixpkgs/pkgs/servers/home-assistant/default.nix | 81 |
1 files changed, 50 insertions, 31 deletions
diff --git a/nixpkgs/pkgs/servers/home-assistant/default.nix b/nixpkgs/pkgs/servers/home-assistant/default.nix index 3a6b5d353209..fae857fda5dc 100644 --- a/nixpkgs/pkgs/servers/home-assistant/default.nix +++ b/nixpkgs/pkgs/servers/home-assistant/default.nix @@ -1,4 +1,4 @@ -{ stdenv, nixosTests, lib, fetchurl, fetchFromGitHub, fetchpatch, python3, protobuf3_6 +{ stdenv, nixosTests, lib, fetchFromGitHub, python3 # Look up dependencies of specified components in component-packages.nix , extraComponents ? [ ] @@ -57,7 +57,7 @@ let extraBuildInputs = extraPackages py.pkgs; # Don't forget to run parse-requirements.py after updating - hassVersion = "2021.1.5"; + hassVersion = "2021.2.3"; in with py.pkgs; buildPythonApplication rec { pname = "homeassistant"; @@ -76,7 +76,7 @@ in with py.pkgs; buildPythonApplication rec { owner = "home-assistant"; repo = "core"; rev = version; - sha256 = "sha256-xi5rHZlhwgEHll3TFlRu7D963tdcQNMmWcoXVjEFLXo="; + sha256 = "0s1jcd94wwvmvzq86w8s9dwfvnmjs9l661z9pc6kwgagggjjgd8c"; }; # leave this in, so users don't have to constantly update their downstream patch handling @@ -84,49 +84,76 @@ in with py.pkgs; buildPythonApplication rec { postPatch = '' substituteInPlace setup.py \ - --replace "aiohttp==3.7.1" "aiohttp>=3.6.3" \ --replace "attrs==19.3.0" "attrs>=19.3.0" \ --replace "bcrypt==3.1.7" "bcrypt>=3.1.7" \ --replace "cryptography==3.2" "cryptography" \ --replace "pip>=8.0.3,<20.3" "pip" \ - --replace "requests==2.25.0" "requests>=2.24.0" \ + --replace "pytz>=2020.5" "pytz>=2020.4" \ + --replace "pyyaml==5.4.1" "pyyaml" \ + --replace "requests==2.25.1" "requests>=2.25.0" \ --replace "ruamel.yaml==0.15.100" "ruamel.yaml>=0.15.100" substituteInPlace tests/test_config.py --replace '"/usr"' '"/build/media"' ''; propagatedBuildInputs = [ - # From setup.py - aiohttp astral async-timeout attrs bcrypt certifi ciso8601 httpx jinja2 - pyjwt cryptography pip python-slugify pytz pyyaml requests ruamel_yaml - setuptools voluptuous voluptuous-serialize yarl - # From default_config. frontend, http, image, mobile_app and recorder components as well as - # the auth.mfa_modules.totp module - aiohttp-cors defusedxml distro emoji hass-frontend pynacl pillow pyotp - pyqrcode sqlalchemy + # Only packages required in setup.py + hass-frontend + aiohttp + astral + async-timeout + attrs + awesomeversion + bcrypt + certifi + ciso8601 + cryptography + hass-frontend + httpx + jinja2 + pip + pyjwt + python-slugify + pytz + pyyaml + requests + ruamel_yaml + voluptuous + voluptuous-serialize + yarl ] ++ componentBuildInputs ++ extraBuildInputs; # upstream only tests on Linux, so do we. doCheck = stdenv.isLinux; checkInputs = [ - asynctest pytestCheckHook pytest-aiohttp pytest_xdist requests-mock hass-nabucasa netdisco pydispatcher - ]; + # test infrastructure + asynctest + pytest-aiohttp + pytest-xdist + pytestCheckHook + requests-mock + # component dependencies + pyotp + ] ++ lib.concatMap (component: getPackages component py.pkgs) componentTests; # We cannot test all components, since they'd introduce lots of dependencies, some of which are unpackaged, # but we should test very common stuff, like what's in `default_config`. + # https://github.com/home-assistant/core/commits/dev/homeassistant/components/default_config/manifest.json componentTests = [ "api" "automation" "config" "configurator" + "counter" "default_config" "demo" + "dhcp" "discovery" "frontend" "group" "history" "homeassistant" "http" + "hue" "input_boolean" "input_datetime" "input_text" @@ -145,42 +172,34 @@ in with py.pkgs; buildPythonApplication rec { "system_health" "system_log" "tag" + "timer" + "webhook" "websocket_api" "zeroconf" "zone" + "zwave" ]; pytestFlagsArray = [ - "-n auto" + # limit amout of runners to reduce race conditions + "-n 2" + # assign tests grouped by file to workers + "--dist loadfile" # don't bulk test all components "--ignore tests/components" - # prone to race conditions due to parallel file access - "--ignore tests/test_config.py" - # tries to import unpackaged dependencies - "--ignore tests/test_loader.py" # pyotp since v2.4.0 complains about the short mock keys, hass pins v2.3.0 "--ignore tests/auth/mfa_modules/test_notify.py" "tests" ] ++ map (component: "tests/components/" + component) componentTests; disabledTests = [ - # AssertionError: merge_log_err.call_count != 0 + # AssertionError: assert 1 == 0 "test_merge" # ModuleNotFoundError: No module named 'pyqwikswitch' "test_merge_id_schema" - # AssertionError: assert 'unknown' == 'not_home' - "test_device_tracker_not_home" - # Racy https://github.com/home-assistant/core/issues/41425 - "test_cached_event_message" - # ValueError: count must be a positive integer (got 0) - "test_media_view" - # AssertionError: len(events) == 1 - "test_error_posted_as_event" # keyring.errors.NoKeyringError: No recommended backend was available. "test_secrets_from_unrelated_fails" "test_secrets_credstash" - # RuntimeError: Event loop is closed - "test_remove_older_logs" ]; preCheck = '' |