2023-02-02 18:25:31 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, pythonOlder
|
|
|
|
, setuptools
|
|
|
|
|
|
|
|
# build
|
|
|
|
, hassil
|
|
|
|
, jinja2
|
|
|
|
, pyyaml
|
|
|
|
, regex
|
|
|
|
, voluptuous
|
|
|
|
, python
|
|
|
|
|
|
|
|
# tests
|
|
|
|
, pytest-xdist
|
|
|
|
, pytestCheckHook
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "home-assistant-intents";
|
2023-04-12 12:48:02 +00:00
|
|
|
version = "2023.3.29";
|
2023-02-02 18:25:31 +00:00
|
|
|
format = "pyproject";
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.9";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "home-assistant";
|
|
|
|
repo = "intents";
|
|
|
|
rev = "refs/tags/${version}";
|
2023-04-12 12:48:02 +00:00
|
|
|
hash = "sha256-wMm2C2C+2+pW5kgMHoYFKpwnOJbS5RwpZK5HiAno0H8=";
|
2023-02-02 18:25:31 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
sourceRoot = "source/package";
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
hassil
|
|
|
|
jinja2
|
|
|
|
pyyaml
|
|
|
|
regex
|
|
|
|
setuptools
|
|
|
|
voluptuous
|
|
|
|
];
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
pushd ..
|
|
|
|
# https://github.com/home-assistant/intents/blob/main/script/package#L18
|
2023-03-04 12:14:45 +00:00
|
|
|
${python.pythonForBuild.interpreter} -m script.intentfest merged_output $out/${python.sitePackages}/home_assistant_intents/data
|
2023-02-02 18:25:31 +00:00
|
|
|
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;
|
|
|
|
};
|
|
|
|
}
|