2023-02-22 23:53:41 +01:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, poetry-core
|
|
|
|
, home-assistant
|
2023-03-02 15:47:46 +01:00
|
|
|
, python
|
2023-02-22 23:53:41 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "homeassistant-stubs";
|
2024-03-07 02:50:06 +01:00
|
|
|
version = "2024.3.0";
|
2023-02-22 23:53:41 +01:00
|
|
|
format = "pyproject";
|
|
|
|
|
2023-03-02 15:47:46 +01:00
|
|
|
disabled = python.version != home-assistant.python.version;
|
|
|
|
|
2023-02-22 23:53:41 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "KapJI";
|
|
|
|
repo = "homeassistant-stubs";
|
|
|
|
rev = "refs/tags/${version}";
|
2024-03-07 02:50:06 +01:00
|
|
|
hash = "sha256-4K/JrmNcvRzso9NgFuh3fThcEQS+Ydk4II6xrWv2KdM=";
|
2023-02-22 23:53:41 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
poetry-core
|
|
|
|
home-assistant
|
|
|
|
];
|
|
|
|
|
2023-03-08 23:47:33 +01:00
|
|
|
postPatch = ''
|
|
|
|
# Relax constraint to year and month
|
2024-02-10 04:22:35 +01:00
|
|
|
substituteInPlace pyproject.toml --replace-fail \
|
2023-03-08 23:47:33 +01:00
|
|
|
'homeassistant = "${version}"' \
|
|
|
|
'homeassistant = "~${lib.versions.majorMinor home-assistant.version}"'
|
|
|
|
'';
|
|
|
|
|
2023-02-22 23:53:41 +01:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"homeassistant-stubs"
|
|
|
|
];
|
|
|
|
|
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Typing stubs for Home Assistant Core";
|
|
|
|
homepage = "https://github.com/KapJI/homeassistant-stubs";
|
|
|
|
changelog = "https://github.com/KapJI/homeassistant-stubs/releases/tag/${version}";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = teams.home-assistant.members;
|
|
|
|
};
|
|
|
|
}
|