2023-01-12 05:06:41 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, pythonOlder
|
|
|
|
|
|
|
|
# build
|
|
|
|
, hassil
|
|
|
|
, jinja2
|
|
|
|
, pyyaml
|
|
|
|
, regex
|
|
|
|
, voluptuous
|
|
|
|
, python
|
2023-08-20 08:50:04 +00:00
|
|
|
, setuptools
|
|
|
|
, wheel
|
2023-01-12 05:06:41 +00:00
|
|
|
|
|
|
|
# tests
|
|
|
|
, pytest-xdist
|
|
|
|
, pytestCheckHook
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "home-assistant-intents";
|
2023-08-04 12:59:46 +00:00
|
|
|
version = "2023.8.2";
|
2023-01-12 05:06:41 +00:00
|
|
|
format = "pyproject";
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.9";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "home-assistant";
|
2023-08-02 18:10:01 +00:00
|
|
|
repo = "intents-package";
|
2023-01-12 05:06:41 +00:00
|
|
|
rev = "refs/tags/${version}";
|
2023-08-04 12:59:46 +00:00
|
|
|
hash = "sha256-pNLH3GGfY8upKi7uYGZ466cIQkpdA16tR1tjwuiQ3JI=";
|
2023-08-02 18:10:01 +00:00
|
|
|
fetchSubmodules = true;
|
2023-01-12 05:06:41 +00:00
|
|
|
};
|
|
|
|
|
2023-08-20 08:50:04 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace pyproject.toml --replace 'requires = ["setuptools~=62.3", "wheel~=0.37.1"]' 'requires = ["setuptools", "wheel"]'
|
|
|
|
'';
|
|
|
|
|
2023-01-12 05:06:41 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
hassil
|
|
|
|
jinja2
|
|
|
|
pyyaml
|
|
|
|
regex
|
|
|
|
setuptools
|
2023-08-20 08:50:04 +00:00
|
|
|
wheel
|
2023-01-12 05:06:41 +00:00
|
|
|
voluptuous
|
|
|
|
];
|
|
|
|
|
|
|
|
postInstall = ''
|
2023-08-02 18:10:01 +00:00
|
|
|
pushd intents
|
2023-01-12 05:06:41 +00:00
|
|
|
# https://github.com/home-assistant/intents/blob/main/script/package#L18
|
2023-02-26 20:26:17 +00:00
|
|
|
${python.pythonForBuild.interpreter} -m script.intentfest merged_output $out/${python.sitePackages}/home_assistant_intents/data
|
2023-01-12 05:06:41 +00:00
|
|
|
popd
|
|
|
|
'';
|
|
|
|
|
|
|
|
checkInputs = [
|
|
|
|
pytest-xdist
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
|
|
|
pytestFlagsArray = [
|
2023-08-02 18:10:01 +00:00
|
|
|
"intents/tests"
|
|
|
|
];
|
|
|
|
|
|
|
|
disabledTests = [
|
|
|
|
# AssertionError: Recognition failed for 'put apples on the list'
|
|
|
|
"test_shopping_list_HassShoppingListAddItem"
|
2023-01-12 05:06:41 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
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;
|
|
|
|
};
|
|
|
|
}
|