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