1{
2 lib,
3 async-timeout,
4 buildPythonPackage,
5 click,
6 cryptography,
7 fetchFromGitHub,
8 hatchling,
9 pytest-asyncio,
10 pytest-timeout,
11 pytestCheckHook,
12 pythonOlder,
13 xdg,
14 zeroconf,
15}:
16
17buildPythonPackage rec {
18 pname = "pylutron-caseta";
19 version = "0.21.0";
20 pyproject = true;
21
22 disabled = pythonOlder "3.8";
23
24 src = fetchFromGitHub {
25 owner = "gurumitts";
26 repo = "pylutron-caseta";
27 rev = "refs/tags/v${version}";
28 hash = "sha256-rmf1ydPfA6rCpWB4TZXAK9MDpsPpahsT7xm/dUrMW+0=";
29 };
30
31 nativeBuildInputs = [ hatchling ];
32
33 propagatedBuildInputs = [ cryptography ] ++ lib.optionals (pythonOlder "3.11") [ async-timeout ];
34
35 passthru.optional-dependencies = {
36 cli = [
37 click
38 xdg
39 zeroconf
40 ];
41 };
42
43 nativeCheckInputs = [
44 pytest-asyncio
45 pytest-timeout
46 pytestCheckHook
47 ] ++ lib.optionals (pythonOlder "3.11") [ async-timeout ];
48
49 pytestFlagsArray = [ "--asyncio-mode=auto" ];
50
51 pythonImportsCheck = [ "pylutron_caseta" ];
52
53 meta = with lib; {
54 description = "Python module o control Lutron Caseta devices";
55 homepage = "https://github.com/gurumitts/pylutron-caseta";
56 changelog = "https://github.com/gurumitts/pylutron-caseta/blob/v${version}/CHANGELOG.md";
57 license = with licenses; [ asl20 ];
58 maintainers = with maintainers; [ fab ];
59 };
60}