about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/sensirion-ble/default.nix
blob: 86f81f67814b9128fd05ef8f9dd4127881e4d772 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
{ lib
, buildPythonPackage
, fetchFromGitHub
, hatchling
, bluetooth-data-tools
, bluetooth-sensor-state-data
, home-assistant-bluetooth
, sensor-state-data
, pythonOlder
}:

buildPythonPackage rec {
  pname = "sensirion-ble";
  version = "0.1.1";
  format = "pyproject";

  disabled = pythonOlder "3.8";

  src = fetchFromGitHub {
    owner = "akx";
    repo = "sensirion-ble";
    rev = "refs/tags/v${version}";
    hash = "sha256-VeUfrQ/1Hqs9yueUKcv/ZpCDEEy84VDcZpuTT4fXSGw=";
  };

  postPatch = ''
    substituteInPlace pyproject.toml \
      --replace " --cov=sensirion_ble --cov-report=term-missing:skip-covered" ""
  '';

  nativeBuildInputs = [
    hatchling
  ];

  propagatedBuildInputs = [
    bluetooth-data-tools
    bluetooth-sensor-state-data
    home-assistant-bluetooth
    sensor-state-data
  ];

  pythonImportsCheck = [
    "sensirion_ble"
  ];

  meta = with lib; {
    description = "Parser for Sensirion BLE devices";
    homepage = "https://github.com/akx/sensirion-ble";
    license = licenses.mit;
    maintainers = with maintainers; [ fab ];
  };
}