2023-02-22 22:53:41 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, poetry-core
|
|
|
|
, home-assistant
|
2023-03-02 14:47:46 +00:00
|
|
|
, python
|
2023-02-22 22:53:41 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "homeassistant-stubs";
|
2024-01-31 16:12:05 +00:00
|
|
|
version = "2024.1.6";
|
2023-02-22 22:53:41 +00:00
|
|
|
format = "pyproject";
|
|
|
|
|
2023-03-02 14:47:46 +00:00
|
|
|
disabled = python.version != home-assistant.python.version;
|
|
|
|
|
2023-02-22 22:53:41 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "KapJI";
|
|
|
|
repo = "homeassistant-stubs";
|
|
|
|
rev = "refs/tags/${version}";
|
2024-01-31 16:12:05 +00:00
|
|
|
hash = "sha256-htFz3Cw5AvI1h2YvECOJdMA4N3JAQRRRhx1tfR4h5co=";
|
2023-02-22 22:53:41 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
poetry-core
|
|
|
|
home-assistant
|
|
|
|
];
|
|
|
|
|
2023-03-08 22:47:33 +00:00
|
|
|
postPatch = ''
|
|
|
|
# Relax constraint to year and month
|
|
|
|
substituteInPlace pyproject.toml --replace \
|
|
|
|
'homeassistant = "${version}"' \
|
|
|
|
'homeassistant = "~${lib.versions.majorMinor home-assistant.version}"'
|
|
|
|
'';
|
|
|
|
|
2023-02-22 22:53:41 +00: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;
|
|
|
|
};
|
|
|
|
}
|