1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, pythonOlder
5, cython
6, poetry-core
7, setuptools
8, bleak
9, pytestCheckHook
10}:
11
12buildPythonPackage rec {
13 pname = "home-assistant-bluetooth";
14 version = "1.10.3";
15 format = "pyproject";
16
17 disabled = pythonOlder "3.9";
18
19 src = fetchFromGitHub {
20 owner = "home-assistant-libs";
21 repo = pname;
22 rev = "refs/tags/v${version}";
23 hash = "sha256-77RrqmoCftPc48fFtuuFo0KqGX3n+6aDx2RFkwGCNzQ=";
24 };
25
26 postPatch = ''
27 # drop pytest parametrization (coverage, etc.)
28 sed -i '/addopts/d' pyproject.toml
29 '';
30
31 nativeBuildInputs = [
32 cython
33 poetry-core
34 setuptools
35 ];
36
37 propagatedBuildInputs = [
38 bleak
39 ];
40
41 pythonImportsCheck = [
42 "home_assistant_bluetooth"
43 ];
44
45 nativeCheckInputs = [
46 pytestCheckHook
47 ];
48
49 meta = with lib; {
50 description = "Basic bluetooth models used by Home Assistant";
51 changelog = "https://github.com/home-assistant-libs/home-assistant-bluetooth/blob/v${version}/CHANGELOG.md";
52 homepage = "https://github.com/home-assistant-libs/home-assistant-bluetooth";
53 license = licenses.asl20;
54 maintainers = teams.home-assistant.members;
55 };
56}