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