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