3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/servers/home-assistant/intents.nix
2023-01-26 01:00:17 +01:00

68 lines
1.2 KiB
Nix

{ lib
, buildPythonPackage
, fetchFromGitHub
, pythonOlder
, setuptools
# build
, hassil
, jinja2
, pyyaml
, regex
, voluptuous
, python
# tests
, pytest-xdist
, pytestCheckHook
}:
buildPythonPackage rec {
pname = "home-assistant-intents";
version = "2023.1.25";
format = "pyproject";
disabled = pythonOlder "3.9";
src = fetchFromGitHub {
owner = "home-assistant";
repo = "intents";
rev = "refs/tags/${version}";
hash = "sha256-nMEcN2b0XHF4yRRsHKMplxqcMLl+gJcPAdvwnySN+ug=";
};
sourceRoot = "source/package";
nativeBuildInputs = [
hassil
jinja2
pyyaml
regex
setuptools
voluptuous
];
postInstall = ''
pushd ..
# https://github.com/home-assistant/intents/blob/main/script/package#L18
${python.interpreter} -m script.intentfest merged_output $out/${python.sitePackages}/home-assistant-intents/home_assistant_intents/data
popd
'';
checkInputs = [
pytest-xdist
pytestCheckHook
];
pytestFlagsArray = [
"../tests"
];
meta = with lib; {
description = "Intents to be used with Home Assistant";
homepage = "https://github.com/home-assistant/intents";
license = licenses.cc-by-40;
maintainers = teams.home-assistant.members;
};
}