2018-02-10 22:19:19 +00:00
|
|
|
{ lib, fetchFromGitHub, python3
|
2018-02-01 12:42:07 +00:00
|
|
|
, extraComponents ? []
|
2018-01-14 21:26:52 +00:00
|
|
|
, extraPackages ? ps: []
|
|
|
|
, skipPip ? true }:
|
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
py = python3.override {
|
|
|
|
packageOverrides = self: super: {
|
|
|
|
yarl = super.yarl.overridePythonAttrs (oldAttrs: rec {
|
2018-02-10 22:19:19 +00:00
|
|
|
version = "1.1.0";
|
2018-01-14 21:26:52 +00:00
|
|
|
src = oldAttrs.src.override {
|
|
|
|
inherit version;
|
2018-02-10 22:19:19 +00:00
|
|
|
sha256 = "162630v7f98l27h11msk9416lqwm2mpgxh4s636594nlbfs9by3a";
|
2018-01-14 21:26:52 +00:00
|
|
|
};
|
|
|
|
});
|
|
|
|
aiohttp = super.aiohttp.overridePythonAttrs (oldAttrs: rec {
|
2018-02-10 22:19:19 +00:00
|
|
|
version = "2.3.10";
|
2018-01-14 21:26:52 +00:00
|
|
|
src = oldAttrs.src.override {
|
|
|
|
inherit version;
|
2018-02-10 22:19:19 +00:00
|
|
|
sha256 = "8adda6583ba438a4c70693374e10b60168663ffa6564c5c75d3c7a9055290964";
|
2018-01-14 21:26:52 +00:00
|
|
|
};
|
|
|
|
});
|
2018-02-08 12:02:57 +00:00
|
|
|
pytest = super.pytest.overridePythonAttrs (oldAttrs: rec {
|
|
|
|
version = "3.3.1";
|
|
|
|
src = oldAttrs.src.override {
|
|
|
|
inherit version;
|
|
|
|
sha256 = "14zbnbn53yvrpv79ch6n02myq9b4winjkaykzi356sfqb7f3d16g";
|
|
|
|
};
|
|
|
|
});
|
2018-01-14 21:26:52 +00:00
|
|
|
hass-frontend = super.callPackage ./frontend.nix { };
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2018-02-01 12:42:07 +00:00
|
|
|
componentPackages = import ./component-packages.nix;
|
|
|
|
|
|
|
|
availableComponents = builtins.attrNames componentPackages.components;
|
|
|
|
|
|
|
|
getPackages = component: builtins.getAttr component componentPackages.components;
|
|
|
|
|
|
|
|
componentBuildInputs = map (component: getPackages component py.pkgs) extraComponents;
|
|
|
|
|
2018-01-14 21:26:52 +00:00
|
|
|
# Ensure that we are using a consistent package set
|
|
|
|
extraBuildInputs = extraPackages py.pkgs;
|
|
|
|
|
2018-02-01 12:42:07 +00:00
|
|
|
# Don't forget to run parse-requirements.py after updating
|
2018-02-18 10:59:24 +00:00
|
|
|
hassVersion = "0.63.3";
|
2018-02-01 12:42:07 +00:00
|
|
|
|
2018-01-14 21:26:52 +00:00
|
|
|
in with py.pkgs; buildPythonApplication rec {
|
|
|
|
pname = "homeassistant";
|
2018-02-01 12:42:07 +00:00
|
|
|
version = assert (componentPackages.version == hassVersion); hassVersion;
|
2018-01-14 21:26:52 +00:00
|
|
|
|
2018-02-01 12:42:07 +00:00
|
|
|
inherit availableComponents;
|
2018-01-14 21:26:52 +00:00
|
|
|
|
|
|
|
# PyPI tarball is missing tests/ directory
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "home-assistant";
|
|
|
|
repo = "home-assistant";
|
|
|
|
rev = version;
|
2018-02-18 10:59:24 +00:00
|
|
|
sha256 = "1lrdrn0x8i81vbqxziv5fgcc8ldz7x5r62kfz3nyg4g43rk3dqq8";
|
2018-01-14 21:26:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
# From setup.py
|
2018-02-12 17:15:29 +00:00
|
|
|
requests pyyaml pytz pip jinja2 voluptuous typing aiohttp yarl async-timeout chardet astral certifi attrs
|
2018-02-10 12:43:05 +00:00
|
|
|
# From http, frontend and recorder components
|
|
|
|
sqlalchemy aiohttp-cors hass-frontend user-agents
|
2018-02-01 12:42:07 +00:00
|
|
|
] ++ componentBuildInputs ++ extraBuildInputs;
|
2018-01-14 21:26:52 +00:00
|
|
|
|
|
|
|
checkInputs = [
|
|
|
|
pytest requests-mock pydispatcher pytest-aiohttp
|
|
|
|
];
|
|
|
|
|
|
|
|
checkPhase = ''
|
|
|
|
# The components' dependencies are not included, so they cannot be tested
|
|
|
|
py.test --ignore tests/components
|
|
|
|
# Some basic components should be tested however
|
|
|
|
py.test \
|
|
|
|
tests/components/{group,http} \
|
|
|
|
tests/components/test_{api,configurator,demo,discovery,frontend,init,introduction,logger,script,shell_command,system_log,websocket_api}.py
|
|
|
|
'';
|
|
|
|
|
2018-02-10 22:19:19 +00:00
|
|
|
makeWrapperArgs = lib.optional skipPip "--add-flags --skip-pip";
|
2018-01-14 21:26:52 +00:00
|
|
|
|
2018-02-10 22:19:19 +00:00
|
|
|
meta = with lib; {
|
2018-01-14 21:26:52 +00:00
|
|
|
homepage = https://home-assistant.io/;
|
|
|
|
description = "Open-source home automation platform running on Python 3";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ f-breidenstein dotlambda ];
|
|
|
|
};
|
|
|
|
}
|