1{
2 lib,
3 bleak,
4 click,
5 buildPythonPackage,
6 fetchFromGitHub,
7 pytest-asyncio,
8 pytest-mock,
9 pythonAtLeast,
10 pytest-cov-stub,
11 pytestCheckHook,
12 pythonOlder,
13}:
14
15buildPythonPackage rec {
16 pname = "pyzerproc";
17 version = "0.4.12";
18 format = "setuptools";
19
20 disabled = pythonOlder "3.9";
21
22 src = fetchFromGitHub {
23 owner = "emlove";
24 repo = "pyzerproc";
25 tag = version;
26 hash = "sha256-vS0sk/KjDhWispZvCuGlmVLLfeFymHqxwNzNqNRhg6k=";
27 };
28
29 propagatedBuildInputs = [
30 bleak
31 click
32 ];
33
34 nativeCheckInputs = [
35 pytest-asyncio
36 pytest-mock
37 pytest-cov-stub
38 pytestCheckHook
39 ];
40
41 disabledTestPaths = lib.optionals (pythonAtLeast "3.11") [
42 # unittest.mock.InvalidSpecError: Cannot spec a Mock object.
43 "tests/test_light.py"
44 ];
45
46 pythonImportsCheck = [ "pyzerproc" ];
47
48 meta = with lib; {
49 description = "Python library to control Zerproc Bluetooth LED smart string lights";
50 mainProgram = "pyzerproc";
51 homepage = "https://github.com/emlove/pyzerproc";
52 license = with licenses; [ asl20 ];
53 maintainers = with maintainers; [ fab ];
54 platforms = platforms.linux;
55 };
56}