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