mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-15 06:14:57 +01:00
6a50b2a918
Diff: https://github.com/home-assistant/intents-package/compare/refs/tags/2024.8.7...2024.9.4 Changelog: https://github.com/home-assistant/intents/releases/tag/2024.8.29 https://github.com/home-assistant/intents/releases/tag/2024.9.4
71 lines
1.5 KiB
Nix
71 lines
1.5 KiB
Nix
{ lib
|
|
, buildPythonPackage
|
|
, fetchFromGitHub
|
|
, pythonOlder
|
|
|
|
# build-system
|
|
, setuptools
|
|
|
|
# codegen
|
|
, hassil
|
|
, python
|
|
, pyyaml
|
|
, voluptuous
|
|
, regex
|
|
, jinja2
|
|
|
|
# tests
|
|
, pytest-xdist
|
|
, pytestCheckHook
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "home-assistant-intents";
|
|
version = "2024.9.4";
|
|
pyproject = true;
|
|
|
|
disabled = pythonOlder "3.9";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "home-assistant";
|
|
repo = "intents-package";
|
|
rev = "refs/tags/${version}";
|
|
fetchSubmodules = true;
|
|
hash = "sha256-8wsszLbrOLvJJoXFHx40zJJbXKT6yNRS5Kgam9P8yGQ=";
|
|
};
|
|
|
|
build-system = [
|
|
setuptools
|
|
|
|
# build-time codegen; https://github.com/home-assistant/intents/blob/main/requirements.txt#L1-L5
|
|
hassil
|
|
pyyaml
|
|
voluptuous
|
|
regex
|
|
jinja2
|
|
];
|
|
|
|
postInstall = ''
|
|
# https://github.com/home-assistant/intents-package/blob/main/script/package#L23-L24
|
|
PACKAGE_DIR=$out/${python.sitePackages}/home_assistant_intents
|
|
${python.pythonOnBuildForHost.interpreter} script/merged_output.py $PACKAGE_DIR/data
|
|
${python.pythonOnBuildForHost.interpreter} script/write_languages.py $PACKAGE_DIR/data > $PACKAGE_DIR/languages.py
|
|
'';
|
|
|
|
nativeCheckInputs = [
|
|
pytest-xdist
|
|
pytestCheckHook
|
|
];
|
|
|
|
pytestFlagsArray = [
|
|
"intents/tests"
|
|
];
|
|
|
|
meta = with lib; {
|
|
changelog = "https://github.com/home-assistant/intents/releases/tag/${version}";
|
|
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;
|
|
};
|
|
}
|