home-assistant.intents: 2024.1.2 -> 2024.2.2

Temporarily switch to source build, because the intents-package repo
content does not match the pypi source.

https://github.com/home-assistant/intents/releases/tag/2024.2.1
https://github.com/home-assistant/intents/releases/tag/2024.2.2
This commit is contained in:
Martin Weinelt 2024-02-09 16:38:52 +01:00
parent 94860de45a
commit 01ef6421f7
No known key found for this signature in database
GPG Key ID: 87C1E9888F856759

View File

@ -1,73 +1,41 @@
{ lib
, buildPythonPackage
, fetchFromGitHub
, fetchPypi
, pythonOlder
# build
, hassil
, jinja2
, pyyaml
, regex
, voluptuous
, python
# build-system
, setuptools
, wheel
# tests
, pytest-xdist
, pytestCheckHook
}:
buildPythonPackage rec {
pname = "home-assistant-intents";
version = "2024.1.2";
version = "2024.2.2";
format = "pyproject";
disabled = pythonOlder "3.9";
src = fetchFromGitHub {
owner = "home-assistant";
repo = "intents-package";
rev = "refs/tags/${version}";
hash = "sha256-uOrSvkzymG31nRmAgrn6z1IDJWahxqXHcPDflLPRVT4=";
fetchSubmodules = true;
src = fetchPypi {
inherit pname version;
hash = "sha256-Tb9ZZvs5Wyzm2TS5INUSua4Y3/2H+kHEhjpfYWJi+d0=";
};
postPatch = ''
substituteInPlace pyproject.toml --replace 'requires = ["setuptools~=62.3", "wheel~=0.37.1"]' 'requires = ["setuptools", "wheel"]'
substituteInPlace pyproject.toml --replace-fail \
'requires = ["setuptools~=62.3", "wheel~=0.37.1"]' \
'requires = ["setuptools"]'
'';
nativeBuildInputs = [
hassil
jinja2
pyyaml
regex
setuptools
wheel
voluptuous
];
postInstall = ''
pushd intents
# https://github.com/home-assistant/intents/blob/main/script/package#L18
${python.pythonOnBuildForHost.interpreter} -m script.intentfest merged_output $out/${python.sitePackages}/home_assistant_intents/data
popd
'';
checkInputs = [
pytest-xdist
pytestCheckHook
];
# sdist does not ship tests
doCheck = false;
pytestFlagsArray = [
"intents/tests"
];
disabledTests = [
# AssertionError: Recognition failed for 'put apples on the list'
"test_shopping_list_HassShoppingListAddItem"
];
meta = with lib; {
description = "Intents to be used with Home Assistant";
homepage = "https://github.com/home-assistant/intents";