depot/third_party/nixpkgs/pkgs/development/python-modules/xiaomi-ble/default.nix
Default email a66bca1520 Project import generated by Copybara.
GitOrigin-RevId: 40f79f003b6377bd2f4ed4027dde1f8f922995dd
2022-12-17 11:02:37 +01:00

62 lines
1.3 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.12.2";
format = "pyproject";
disabled = pythonOlder "3.9";
src = fetchFromGitHub {
owner = "Bluetooth-Devices";
repo = pname;
rev = "refs/tags/v${version}";
hash = "sha256-MwKhoerfloFT5/x1darfMP/qF5sEy6LiKEogINIUq0c=";
};
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";
changelog = "https://github.com/Bluetooth-Devices/xiaomi-ble/releases/tag/v${version}";
license = with licenses; [ mit ];
maintainers = with maintainers; [ fab ];
};
}