Merge pull request #330634 from r-ryantm/auto-update/circumflex
[NixPkgs.git] / pkgs / servers / home-assistant / stubs.nix
blobb5c963f2c434735cb81cfeded55ece73f170eb0d
1 { lib
2 , buildPythonPackage
3 , fetchFromGitHub
4 , poetry-core
5 , home-assistant
6 , python
7 }:
9 buildPythonPackage rec {
10   pname = "homeassistant-stubs";
11   version = "2024.7.3";
12   pyproject = true;
14   disabled = python.version != home-assistant.python.version;
16   src = fetchFromGitHub {
17     owner = "KapJI";
18     repo = "homeassistant-stubs";
19     rev = "refs/tags/${version}";
20     hash = "sha256-4n1dnQX7Mo2vFCrSUUAvdO3ZErBKK6oUCITazI9PlIQ=";
21   };
23   build-system = [
24     poetry-core
25     home-assistant
26   ];
28   postPatch = ''
29     # Relax constraint to year and month
30     substituteInPlace pyproject.toml --replace-fail \
31       'homeassistant = "${version}"' \
32       'homeassistant = "~${lib.versions.majorMinor home-assistant.version}"'
33   '';
35   pythonImportsCheck = [
36     "homeassistant-stubs"
37   ];
39   doCheck = false;
41   meta = with lib; {
42     description = "Typing stubs for Home Assistant Core";
43     homepage = "https://github.com/KapJI/homeassistant-stubs";
44     changelog = "https://github.com/KapJI/homeassistant-stubs/releases/tag/${version}";
45     license = licenses.mit;
46     maintainers = teams.home-assistant.members;
47   };