1{
2 lib,
3 aiohttp,
4 buildPythonPackage,
5 fetchFromGitHub,
6 pytest-asyncio,
7 pytestCheckHook,
8 pythonOlder,
9}:
10
11buildPythonPackage rec {
12 pname = "pysmartthings";
13 version = "0.7.8";
14 format = "setuptools";
15
16 disabled = pythonOlder "3.8";
17
18 src = fetchFromGitHub {
19 owner = "andrewsayre";
20 repo = pname;
21 rev = version;
22 hash = "sha256-r+f2+vEXJdQGDlbs/MhraFgEmsAf32PU282blLRLjzc=";
23 };
24
25 postPatch = ''
26 substituteInPlace setup.py \
27 --replace "aiohttp>=3.8.0,<4.0.0" "aiohttp<=4.0.0"
28 '';
29
30 propagatedBuildInputs = [ aiohttp ];
31
32 # https://github.com/andrewsayre/pysmartthings/issues/80
33 doCheck = lib.versionOlder aiohttp.version "3.9.0";
34
35 nativeCheckInputs = [
36 pytest-asyncio
37 pytestCheckHook
38 ];
39
40 pythonImportsCheck = [ "pysmartthings" ];
41
42 meta = with lib; {
43 description = "Python library for interacting with the SmartThings cloud API";
44 homepage = "https://github.com/andrewsayre/pysmartthings";
45 changelog = "https://github.com/andrewsayre/pysmartthings/releases/tag/${version}";
46 license = with licenses; [ mit ];
47 maintainers = with maintainers; [ fab ];
48 };
49}