depot/third_party/nixpkgs/pkgs/development/python-modules/xiaomi-ble/default.nix
Default email 01ed8ef136 Project import generated by Copybara.
GitOrigin-RevId: 20fc948445a6c22d4e8d5178e9a6bc6e1f5417c8
2022-11-21 19:40:18 +02:00

61 lines
1.2 KiB
Nix

{ lib
, bleak-retry-connector
, bluetooth-data-tools
, bluetooth-sensor-state-data
, buildPythonPackage
, fetchFromGitHub
, home-assistant-bluetooth
, poetry-core
, pycryptodomex
, pytestCheckHook
, pythonOlder
, sensor-state-data
}:
buildPythonPackage rec {
pname = "xiaomi-ble";
version = "0.11.0";
format = "pyproject";
disabled = pythonOlder "3.9";
src = fetchFromGitHub {
owner = "Bluetooth-Devices";
repo = pname;
rev = "v${version}";
hash = "sha256-qAqXg+skA7FfAjRXljt1UpyOcC3KYghc+5wjiRzlyyg=";
};
nativeBuildInputs = [
poetry-core
];
propagatedBuildInputs = [
bleak-retry-connector
bluetooth-data-tools
bluetooth-sensor-state-data
home-assistant-bluetooth
pycryptodomex
sensor-state-data
];
checkInputs = [
pytestCheckHook
];
postPatch = ''
substituteInPlace pyproject.toml \
--replace " --cov=xiaomi_ble --cov-report=term-missing:skip-covered" ""
'';
pythonImportsCheck = [
"xiaomi_ble"
];
meta = with lib; {
description = "Library for Xiaomi BLE devices";
homepage = "https://github.com/Bluetooth-Devices/xiaomi-ble";
license = with licenses; [ mit ];
maintainers = with maintainers; [ fab ];
};
}