2023-03-04 12:14:45 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, poetry-core
|
|
|
|
, home-assistant
|
|
|
|
, python
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "homeassistant-stubs";
|
2023-04-12 12:48:02 +00:00
|
|
|
version = "2023.4.2";
|
2023-03-04 12:14:45 +00:00
|
|
|
format = "pyproject";
|
|
|
|
|
|
|
|
disabled = python.version != home-assistant.python.version;
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "KapJI";
|
|
|
|
repo = "homeassistant-stubs";
|
|
|
|
rev = "refs/tags/${version}";
|
2023-04-12 12:48:02 +00:00
|
|
|
hash = "sha256-FzcgGyYtmU8owlvUfP/D+Y6m5QwOWj4njoLTZX6skLE=";
|
2023-03-04 12:14:45 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
poetry-core
|
|
|
|
home-assistant
|
|
|
|
];
|
|
|
|
|
2023-03-15 16:39:30 +00:00
|
|
|
postPatch = ''
|
|
|
|
# Relax constraint to year and month
|
|
|
|
substituteInPlace pyproject.toml --replace \
|
|
|
|
'homeassistant = "${version}"' \
|
|
|
|
'homeassistant = "~${lib.versions.majorMinor home-assistant.version}"'
|
|
|
|
cat pyproject.toml
|
|
|
|
'';
|
|
|
|
|
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;
|
|
|
|
};
|
|
|
|
}
|