2019-01-29 23:40:11 +01:00
|
|
|
# dateparser tests fail on pyton37: https://github.com/NixOS/nixpkgs/issues/52766
|
|
|
|
{ lib, python36, glibcLocales }:
|
2018-12-12 14:00:44 +01:00
|
|
|
|
2019-01-29 23:40:11 +01:00
|
|
|
python36.pkgs.buildPythonApplication rec {
|
2018-12-12 14:00:44 +01:00
|
|
|
pname = "homeassistant-cli";
|
2019-01-30 09:20:44 +01:00
|
|
|
version = "0.4.4";
|
2018-12-12 14:00:44 +01:00
|
|
|
|
2019-01-29 23:40:11 +01:00
|
|
|
src = python36.pkgs.fetchPypi {
|
2018-12-12 14:00:44 +01:00
|
|
|
inherit pname version;
|
2019-01-30 09:20:44 +01:00
|
|
|
sha256 = "ad3722062ffb7b4fa730f61991b831dbf083e4e079c560993a023ce4bb11c55d";
|
2018-12-12 14:00:44 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
# Ignore pinned versions
|
2019-01-29 23:31:10 +01:00
|
|
|
sed -i "s/'\(.*\)\(==\|>=\).*'/'\1'/g" setup.py
|
2018-12-12 14:00:44 +01:00
|
|
|
'';
|
|
|
|
|
2019-02-06 14:42:59 +01:00
|
|
|
nativeBuildInputs = [
|
|
|
|
glibcLocales
|
|
|
|
];
|
|
|
|
|
2019-01-29 23:40:11 +01:00
|
|
|
propagatedBuildInputs = with python36.pkgs; [
|
2019-01-29 23:31:10 +01:00
|
|
|
requests pyyaml netdisco click click-log tabulate idna jsonpath_rw jinja2 dateparser
|
2018-12-12 14:00:44 +01:00
|
|
|
];
|
|
|
|
|
2019-02-06 14:42:59 +01:00
|
|
|
LC_ALL = "en_US.UTF-8";
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
mkdir -p "$out/share/bash-completion/completions" "$out/share/zsh/site-functions"
|
|
|
|
$out/bin/hass-cli completion bash > "$out/share/bash-completion/completions/hass-cli"
|
|
|
|
$out/bin/hass-cli completion zsh > "$out/share/zsh/site-functions/_hass-cli"
|
|
|
|
'';
|
|
|
|
|
2019-01-29 23:40:11 +01:00
|
|
|
checkInputs = with python36.pkgs; [
|
2019-02-06 14:42:59 +01:00
|
|
|
pytest requests-mock
|
2018-12-12 14:00:44 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
checkPhase = ''
|
2019-02-06 14:42:59 +01:00
|
|
|
pytest
|
2018-12-12 14:00:44 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Command-line tool for Home Asssistant";
|
|
|
|
homepage = https://github.com/home-assistant/home-assistant-cli;
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ dotlambda ];
|
|
|
|
};
|
|
|
|
}
|