1{ lib
2, async-timeout
3, bleak
4, bleak-retry-connector
5, buildPythonPackage
6, fetchFromGitHub
7, flux-led
8, poetry-core
9, pytestCheckHook
10, pythonOlder
11}:
12
13buildPythonPackage rec {
14 pname = "led-ble";
15 version = "1.0.1";
16 format = "pyproject";
17
18 disabled = pythonOlder "3.9";
19
20 src = fetchFromGitHub {
21 owner = "Bluetooth-Devices";
22 repo = pname;
23 rev = "refs/tags/v${version}";
24 hash = "sha256-8DBA01QjW99OVYI9zC1Q+utnwzc10idUG7y+lmUbO4A=";
25 };
26
27 postPatch = ''
28 substituteInPlace pyproject.toml \
29 --replace " --cov=led_ble --cov-report=term-missing:skip-covered" ""
30 '';
31
32 nativeBuildInputs = [
33 poetry-core
34 ];
35
36 propagatedBuildInputs = [
37 bleak
38 bleak-retry-connector
39 flux-led
40 ] ++ lib.optionals (pythonOlder "3.11") [
41 async-timeout
42 ];
43
44 nativeCheckInputs = [
45 pytestCheckHook
46 ];
47
48 pythonImportsCheck = [
49 "led_ble"
50 ];
51
52 meta = with lib; {
53 description = "Library for LED BLE devices";
54 homepage = "https://github.com/Bluetooth-Devices/led-ble";
55 changelog = "https://github.com/Bluetooth-Devices/led-ble/blob/v${version}/CHANGELOG.md";
56 license = with licenses; [ mit ];
57 maintainers = with maintainers; [ fab ];
58 };
59}