1{
2 lib,
3 aiohttp,
4 asyncio-throttle,
5 awesomeversion,
6 buildPythonPackage,
7 fetchFromGitHub,
8 pytestCheckHook,
9 pytest-aiohttp,
10 pytest-asyncio,
11 pytest-cov-stub,
12 pythonOlder,
13 setuptools,
14}:
15
16buildPythonPackage rec {
17 pname = "aiohue";
18 version = "4.8.0";
19 pyproject = true;
20
21 disabled = pythonOlder "3.11";
22
23 src = fetchFromGitHub {
24 owner = "home-assistant-libs";
25 repo = "aiohue";
26 tag = version;
27 hash = "sha256-IL9kKc2IHJJmlAYxC5hZPsgOhtfr14yD7VbEsWX2Klw=";
28 };
29
30 postPatch = ''
31 substituteInPlace pyproject.toml \
32 --replace-fail 'version = "0.0.0"' 'version = "${version}"'
33 '';
34
35 build-system = [ setuptools ];
36
37 dependencies = [
38 awesomeversion
39 aiohttp
40 asyncio-throttle
41 ];
42
43 nativeCheckInputs = [
44 pytestCheckHook
45 pytest-asyncio
46 pytest-aiohttp
47 pytest-cov-stub
48 ];
49
50 pythonImportsCheck = [
51 "aiohue"
52 "aiohue.discovery"
53 ];
54
55 disabledTestPaths = [
56 # File are prefixed with test_
57 "examples/"
58 ];
59
60 meta = with lib; {
61 description = "Python package to talk to Philips Hue";
62 homepage = "https://github.com/home-assistant-libs/aiohue";
63 changelog = "https://github.com/home-assistant-libs/aiohue/releases/tag/${version}";
64 license = with licenses; [ asl20 ];
65 maintainers = with maintainers; [ fab ];
66 };
67}