aboutsummaryrefslogtreecommitdiff
path: root/nixpkgs/pkgs/development/python-modules/hass-nabucasa/default.nix
blob: e13cae3396016156000f0826e5590cb2228c3283 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
{ lib, buildPythonPackage, fetchFromGitHub, fetchpatch
, acme, aiohttp, snitun, attrs, pycognito, warrant
, pytest-aiohttp, asynctest, pytest  }:

buildPythonPackage rec {
  pname = "hass-nabucasa";
  version = "0.32.2";

  src = fetchFromGitHub {
    owner = "nabucasa";
    repo = pname;
    rev = version;
    sha256 = "1hfi5q222kgbgrj5yvr4lbhca49hcs6sc2yhxc4pjxqsc12bv1f1";
  };

  # upstreamed in https://github.com/NabuCasa/hass-nabucasa/pull/119
  postPatch = ''
    sed -i 's/"acme.*/"acme>=0.40.0,<2.0"/' setup.py
    cat setup.py
  '';

  propagatedBuildInputs = [ acme aiohttp snitun attrs warrant pycognito ];

  checkInputs = [ pytest pytest-aiohttp asynctest ];

  checkPhase = ''
    pytest tests/
  '';

  meta = with lib; {
    homepage = "https://github.com/NabuCasa/hass-nabucasa";
    description = "Home Assistant cloud integration by Nabu Casa, inc.";
    license = licenses.gpl3;
    maintainers = with maintainers; [ Scriptkiddi ];
  };
}