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