1{
2 lib,
3 bluetooth-sensor-state-data,
4 buildPythonPackage,
5 fetchFromGitHub,
6 poetry-core,
7 pycryptodomex,
8 pytestCheckHook,
9 pythonOlder,
10 sensor-state-data,
11}:
12
13buildPythonPackage rec {
14 pname = "atc-ble";
15 version = "0.1.0";
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-rwOFKxUlbbNIDJRdCmZpHstXwxcTnvlExgcVDdGbIVY=";
25 };
26
27 postPatch = ''
28 substituteInPlace pyproject.toml \
29 --replace " --cov=atc_ble --cov-report=term-missing:skip-covered" ""
30 '';
31
32 nativeBuildInputs = [ poetry-core ];
33
34 propagatedBuildInputs = [
35 bluetooth-sensor-state-data
36 pycryptodomex
37 sensor-state-data
38 ];
39
40 nativeCheckInputs = [ pytestCheckHook ];
41
42 pythonImportsCheck = [ "atc_ble" ];
43
44 meta = with lib; {
45 description = "Library for ATC devices with custom firmware";
46 homepage = "https://github.com/Bluetooth-Devices/atc-ble";
47 changelog = "https://github.com/Bluetooth-Devices/atc-ble/releases/tag/v${version}";
48 license = with licenses; [ mit ];
49 maintainers = with maintainers; [ fab ];
50 };
51}