1{
2 lib,
3 async-interrupt,
4 async-timeout,
5 bleak,
6 bleak-retry-connector,
7 buildPythonPackage,
8 fetchFromGitHub,
9 poetry-core,
10 pytestCheckHook,
11 pythonOlder,
12}:
13
14buildPythonPackage rec {
15 pname = "airthings-ble";
16 version = "0.9.0";
17 pyproject = true;
18
19 disabled = pythonOlder "3.9";
20
21 src = fetchFromGitHub {
22 owner = "vincegio";
23 repo = "airthings-ble";
24 rev = "refs/tags/${version}";
25 hash = "sha256-920Vgk8kY5NsjYrOGYoRtcdHl4KKO7ytieH8cJ0S3RE=";
26 };
27
28 postPatch = ''
29 substituteInPlace pyproject.toml \
30 --replace-fail "-v -Wdefault --cov=airthings_ble --cov-report=term-missing:skip-covered" ""
31 '';
32
33 build-system = [ poetry-core ];
34
35 dependencies = [
36 async-interrupt
37 bleak
38 bleak-retry-connector
39 ] ++ lib.optionals (pythonOlder "3.11") [ async-timeout ];
40
41 nativeCheckInputs = [ pytestCheckHook ];
42
43 pythonImportsCheck = [ "airthings_ble" ];
44
45 meta = with lib; {
46 description = "Library for Airthings BLE devices";
47 homepage = "https://github.com/vincegio/airthings-ble";
48 changelog = "https://github.com/vincegio/airthings-ble/releases/tag/${version}";
49 license = with licenses; [ mit ];
50 maintainers = with maintainers; [ fab ];
51 };
52}