nixpkgs/pkgs/servers/home-assistant/cli.nix

36 lines
895 B
Nix
Raw Normal View History

2019-01-29 14:31:10 -08:00
{ lib, python3, glibcLocales }:
2018-12-12 05:00:44 -08:00
python3.pkgs.buildPythonApplication rec {
pname = "homeassistant-cli";
2019-01-29 14:31:10 -08:00
version = "0.4.2";
2018-12-12 05:00:44 -08:00
src = python3.pkgs.fetchPypi {
inherit pname version;
2019-01-29 14:31:10 -08:00
sha256 = "e0b05af9e49baf88a44f1b36c3446a106223016dceefd5f9910e204af5901f44";
2018-12-12 05:00:44 -08:00
};
postPatch = ''
# Ignore pinned versions
2019-01-29 14:31:10 -08:00
sed -i "s/'\(.*\)\(==\|>=\).*'/'\1'/g" setup.py
2018-12-12 05:00:44 -08:00
'';
propagatedBuildInputs = with python3.pkgs; [
2019-01-29 14:31:10 -08:00
requests pyyaml netdisco click click-log tabulate idna jsonpath_rw jinja2 dateparser
2018-12-12 05:00:44 -08:00
];
checkInputs = with python3.pkgs; [
2019-01-29 14:31:10 -08:00
pytest requests-mock glibcLocales
2018-12-12 05:00:44 -08:00
];
checkPhase = ''
2019-01-29 14:31:10 -08:00
LC_ALL=en_US.UTF-8 pytest
2018-12-12 05:00:44 -08: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 ];
};
}