depot/third_party/nixpkgs/pkgs/development/python-modules/xiaomi-ble/default.nix
Default email e7ec2969af Project import generated by Copybara.
GitOrigin-RevId: 9b19f5e77dd906cb52dade0b7bd280339d2a1f3d
2024-01-13 09:15:51 +01:00

67 lines
1.4 KiB
Nix

{ lib
, bleak
, bleak-retry-connector
, bluetooth-data-tools
, bluetooth-sensor-state-data
, buildPythonPackage
, cryptography
, fetchFromGitHub
, home-assistant-bluetooth
, poetry-core
, pycryptodomex
, pytestCheckHook
, pythonOlder
, sensor-state-data
}:
buildPythonPackage rec {
pname = "xiaomi-ble";
version = "0.21.2";
format = "pyproject";
disabled = pythonOlder "3.9";
src = fetchFromGitHub {
owner = "Bluetooth-Devices";
repo = pname;
rev = "refs/tags/v${version}";
hash = "sha256-x9FQk3oGSxFrFj/F+QU9n7UMRTn0N4HsGonuNEEe9ug=";
};
postPatch = ''
substituteInPlace pyproject.toml \
--replace " --cov=xiaomi_ble --cov-report=term-missing:skip-covered" "" \
--replace 'pycryptodomex = ">=3.18.0"' 'pycryptodomex = ">=3.17.0"'
'';
nativeBuildInputs = [
poetry-core
];
propagatedBuildInputs = [
bleak
bleak-retry-connector
bluetooth-data-tools
bluetooth-sensor-state-data
cryptography
home-assistant-bluetooth
pycryptodomex
sensor-state-data
];
nativeCheckInputs = [
pytestCheckHook
];
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 ];
};
}