2023-03-04 12:14:45 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
2024-09-26 11:04:55 +00:00
|
|
|
, hatchling
|
|
|
|
, hatch-vcs
|
2023-03-04 12:14:45 +00:00
|
|
|
, home-assistant
|
|
|
|
, python
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "homeassistant-stubs";
|
2024-10-29 11:11:06 +00:00
|
|
|
version = "2024.10.4";
|
2024-06-20 14:57:18 +00:00
|
|
|
pyproject = true;
|
2023-03-04 12:14:45 +00:00
|
|
|
|
|
|
|
disabled = python.version != home-assistant.python.version;
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "KapJI";
|
|
|
|
repo = "homeassistant-stubs";
|
|
|
|
rev = "refs/tags/${version}";
|
2024-10-29 11:11:06 +00:00
|
|
|
hash = "sha256-MjHqX1OP1mEEypAxZ8Xc+ZWBsfj4yiFG9oItFnf/svk=";
|
2023-03-04 12:14:45 +00:00
|
|
|
};
|
|
|
|
|
2024-06-20 14:57:18 +00:00
|
|
|
build-system = [
|
2024-09-26 11:04:55 +00:00
|
|
|
hatchling
|
|
|
|
hatch-vcs
|
2023-03-04 12:14:45 +00:00
|
|
|
home-assistant
|
|
|
|
];
|
|
|
|
|
2023-03-15 16:39:30 +00:00
|
|
|
postPatch = ''
|
|
|
|
# Relax constraint to year and month
|
2024-02-29 20:09:43 +00:00
|
|
|
substituteInPlace pyproject.toml --replace-fail \
|
2024-09-26 11:04:55 +00:00
|
|
|
'homeassistant==${version}' \
|
|
|
|
'homeassistant~=${lib.versions.majorMinor home-assistant.version}'
|
2023-03-15 16:39:30 +00:00
|
|
|
'';
|
|
|
|
|
2023-03-04 12:14:45 +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;
|
|
|
|
};
|
|
|
|
}
|