depot/third_party/nixpkgs/pkgs/development/python-modules/hassil/default.nix
Default email a0cb138ada Project import generated by Copybara.
GitOrigin-RevId: a100acd7bbf105915b0004427802286c37738fef
2023-02-02 18:25:31 +00:00

57 lines
1.1 KiB
Nix

{ lib
, buildPythonPackage
, fetchPypi
# build
, antlr4
# propagates
, antlr4-python3-runtime
, dataclasses-json
, pyyaml
# tests
, pytestCheckHook
}:
let
pname = "hassil";
version = "0.2.6";
in
buildPythonPackage {
inherit pname version;
format = "setuptools";
src = fetchPypi {
inherit pname version;
hash = "sha256-KbzGZLW+HrG4meOa0mVTh3jmt43gRxl9yN9asWMDxiY=";
};
nativeBuildInputs = [
antlr4
];
postPatch = ''
sed -i 's/antlr4-python3-runtime==.*/antlr4-python3-runtime/' requirements.txt
rm hassil/grammar/*.{tokens,interp}
antlr -Dlanguage=Python3 -visitor -o hassil/grammar/ *.g4
'';
propagatedBuildInputs = [
antlr4-python3-runtime
dataclasses-json
pyyaml
];
nativeCheckInputs = [
pytestCheckHook
];
meta = with lib; {
changelog = "https://github.com/home-assistant/hassil/releases/tag/v${version}";
description = "Intent parsing for Home Assistant";
homepage = "https://github.com/home-assistant/hassil";
license = licenses.asl20;
maintainers = teams.home-assistant.members;
};
}