2018-02-10 23:19:19 +01:00
|
|
|
{ lib, fetchFromGitHub, python3
|
2018-02-01 13:42:07 +01:00
|
|
|
, extraComponents ? []
|
2018-01-14 22:26:52 +01:00
|
|
|
, extraPackages ? ps: []
|
|
|
|
, skipPip ? true }:
|
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
py = python3.override {
|
|
|
|
packageOverrides = self: super: {
|
|
|
|
aiohttp = super.aiohttp.overridePythonAttrs (oldAttrs: rec {
|
2018-04-28 19:58:03 +02:00
|
|
|
version = "3.1.3";
|
2018-01-14 22:26:52 +01:00
|
|
|
src = oldAttrs.src.override {
|
|
|
|
inherit version;
|
2018-04-28 19:58:03 +02:00
|
|
|
sha256 = "9fcef0489e3335b200d31a9c1fb6ba80fdafe14cd82b971168c2f9fa1e4508ad";
|
2018-01-14 22:26:52 +01:00
|
|
|
};
|
|
|
|
});
|
2018-02-08 13:02:57 +01:00
|
|
|
pytest = super.pytest.overridePythonAttrs (oldAttrs: rec {
|
2018-04-11 10:47:38 +02:00
|
|
|
version = "3.4.2";
|
2018-02-08 13:02:57 +01:00
|
|
|
src = oldAttrs.src.override {
|
|
|
|
inherit version;
|
2018-04-11 10:47:38 +02:00
|
|
|
sha256 = "117bad36c1a787e1a8a659df35de53ba05f9f3398fb9e4ac17e80ad5903eb8c5";
|
2018-02-08 13:02:57 +01:00
|
|
|
};
|
|
|
|
});
|
2018-02-19 13:04:36 +01:00
|
|
|
voluptuous = super.voluptuous.overridePythonAttrs (oldAttrs: rec {
|
2018-03-14 18:48:50 +01:00
|
|
|
version = "0.11.1";
|
2018-02-19 13:04:36 +01:00
|
|
|
src = oldAttrs.src.override {
|
|
|
|
inherit version;
|
2018-03-14 18:48:50 +01:00
|
|
|
sha256 = "af7315c9fa99e0bfd195a21106c82c81619b42f0bd9b6e287b797c6b6b6a9918";
|
2018-02-19 13:04:36 +01:00
|
|
|
};
|
|
|
|
});
|
2018-05-11 19:39:37 +02:00
|
|
|
attrs = super.attrs.overridePythonAttrs (oldAttrs: rec {
|
|
|
|
version = "18.1.0";
|
|
|
|
src = oldAttrs.src.override {
|
|
|
|
inherit version;
|
|
|
|
sha256 = "e0d0eb91441a3b53dab4d9b743eafc1ac44476296a2053b6ca3af0b139faf87b";
|
|
|
|
};
|
|
|
|
});
|
2018-02-27 00:27:01 +01:00
|
|
|
astral = super.astral.overridePythonAttrs (oldAttrs: rec {
|
2018-05-11 19:39:37 +02:00
|
|
|
version = "1.6.1";
|
2018-02-27 00:27:01 +01:00
|
|
|
src = oldAttrs.src.override {
|
|
|
|
inherit version;
|
2018-05-11 19:39:37 +02:00
|
|
|
sha256 = "ab0c08f2467d35fcaeb7bad15274743d3ac1ad18b5391f64a0058a9cd192d37d";
|
2018-02-27 00:27:01 +01:00
|
|
|
};
|
|
|
|
});
|
2018-04-06 10:08:12 +02:00
|
|
|
async-timeout = super.async-timeout.overridePythonAttrs (oldAttrs: rec {
|
2018-04-11 10:47:38 +02:00
|
|
|
version = "2.0.1";
|
2018-04-06 10:08:12 +02:00
|
|
|
src = oldAttrs.src.override {
|
|
|
|
inherit version;
|
2018-04-11 10:47:38 +02:00
|
|
|
sha256 = "00cff4d2dce744607335cba84e9929c3165632da2d27970dbc55802a0c7873d0";
|
2018-04-06 10:08:12 +02:00
|
|
|
};
|
|
|
|
});
|
2018-05-11 19:39:37 +02:00
|
|
|
# used by check_config script
|
|
|
|
# can be unpinned once https://github.com/home-assistant/home-assistant/issues/11917 is resolved
|
|
|
|
colorlog = super.colorlog.overridePythonAttrs (oldAttrs: rec {
|
|
|
|
version = "3.1.4";
|
|
|
|
src = oldAttrs.src.override {
|
|
|
|
inherit version;
|
|
|
|
sha256 = "418db638c9577f37f0fae4914074f395847a728158a011be2a193ac491b9779d";
|
|
|
|
};
|
|
|
|
});
|
2018-01-14 22:26:52 +01:00
|
|
|
hass-frontend = super.callPackage ./frontend.nix { };
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2018-02-01 13:42:07 +01:00
|
|
|
componentPackages = import ./component-packages.nix;
|
|
|
|
|
|
|
|
availableComponents = builtins.attrNames componentPackages.components;
|
|
|
|
|
|
|
|
getPackages = component: builtins.getAttr component componentPackages.components;
|
|
|
|
|
2018-04-08 13:21:52 +02:00
|
|
|
componentBuildInputs = lib.concatMap (component: getPackages component py.pkgs) extraComponents;
|
2018-02-01 13:42:07 +01:00
|
|
|
|
2018-01-14 22:26:52 +01:00
|
|
|
# Ensure that we are using a consistent package set
|
|
|
|
extraBuildInputs = extraPackages py.pkgs;
|
|
|
|
|
2018-02-01 13:42:07 +01:00
|
|
|
# Don't forget to run parse-requirements.py after updating
|
2018-05-13 18:30:58 +02:00
|
|
|
hassVersion = "0.69.1";
|
2018-02-01 13:42:07 +01:00
|
|
|
|
2018-01-14 22:26:52 +01:00
|
|
|
in with py.pkgs; buildPythonApplication rec {
|
|
|
|
pname = "homeassistant";
|
2018-02-01 13:42:07 +01:00
|
|
|
version = assert (componentPackages.version == hassVersion); hassVersion;
|
2018-01-14 22:26:52 +01:00
|
|
|
|
2018-03-14 18:48:50 +01:00
|
|
|
disabled = pythonOlder "3.5";
|
|
|
|
|
2018-02-01 13:42:07 +01:00
|
|
|
inherit availableComponents;
|
2018-01-14 22:26:52 +01:00
|
|
|
|
|
|
|
# PyPI tarball is missing tests/ directory
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "home-assistant";
|
|
|
|
repo = "home-assistant";
|
|
|
|
rev = version;
|
2018-05-13 18:30:58 +02:00
|
|
|
sha256 = "1y74zq1nah9k6rif8k384ri11h1f23ggr613f7qnn0107b23asr4";
|
2018-01-14 22:26:52 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
# From setup.py
|
2018-03-14 18:48:50 +01:00
|
|
|
requests pyyaml pytz pip jinja2 voluptuous typing aiohttp async-timeout astral certifi attrs
|
2018-02-10 13:43:05 +01:00
|
|
|
# From http, frontend and recorder components
|
2018-03-14 18:48:50 +01:00
|
|
|
sqlalchemy aiohttp-cors hass-frontend
|
2018-02-01 13:42:07 +01:00
|
|
|
] ++ componentBuildInputs ++ extraBuildInputs;
|
2018-01-14 22:26:52 +01: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
|
2018-05-11 19:39:37 +02:00
|
|
|
py.test \
|
2018-01-14 22:26:52 +01:00
|
|
|
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 23:19:19 +01:00
|
|
|
makeWrapperArgs = lib.optional skipPip "--add-flags --skip-pip";
|
2018-01-14 22:26:52 +01:00
|
|
|
|
2018-02-10 23:19:19 +01:00
|
|
|
meta = with lib; {
|
2018-01-14 22:26:52 +01: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 ];
|
|
|
|
};
|
|
|
|
}
|