1{ lib
2, bluetooth-data-tools
3, bluetooth-sensor-state-data
4, buildPythonPackage
5, fetchFromGitHub
6, home-assistant-bluetooth
7, poetry-core
8, pytestCheckHook
9, pythonOlder
10, sensor-state-data
11}:
12
13buildPythonPackage rec {
14 pname = "rapt-ble";
15 version = "0.1.1";
16 format = "pyproject";
17
18 disabled = pythonOlder "3.9";
19
20 src = fetchFromGitHub {
21 owner = "sairon";
22 repo = pname;
23 rev = "refs/tags/v${version}";
24 hash = "sha256-BLpe4AxxvFeOfcBSPtLwPIJZnNIBEdd6JpuQb9upO34=";
25 };
26
27 postPatch = ''
28 substituteInPlace pyproject.toml \
29 --replace " --cov=rapt_ble --cov-report=term-missing:skip-covered" ""
30 '';
31
32 nativeBuildInputs = [
33 poetry-core
34 ];
35
36 propagatedBuildInputs = [
37 bluetooth-data-tools
38 bluetooth-sensor-state-data
39 home-assistant-bluetooth
40 sensor-state-data
41 ];
42
43 nativeCheckInputs = [
44 pytestCheckHook
45 ];
46
47 pythonImportsCheck = [
48 "rapt_ble"
49 ];
50
51 meta = with lib; {
52 description = "Library for RAPT Pill hydrometer BLE devices";
53 homepage = "https://github.com/sairon/rapt-ble";
54 changelog = "https://github.com/sairon/rapt-ble/blob/v${version}/CHANGELOG.md";
55 license = with licenses; [ mit ];
56 maintainers = with maintainers; [ fab ];
57 };
58}