depot/third_party/nixpkgs/pkgs/development/python-modules/xiaomi-ble/default.nix
Default email c7cb07f092 Project import generated by Copybara.
GitOrigin-RevId: 1536926ef5621b09bba54035ae2bb6d806d72ac8
2024-02-29 21:09:43 +01:00

72 lines
1.5 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
, pythonRelaxDepsHook
, sensor-state-data
}:
buildPythonPackage rec {
pname = "xiaomi-ble";
version = "0.26.1";
pyproject = true;
disabled = pythonOlder "3.9";
src = fetchFromGitHub {
owner = "Bluetooth-Devices";
repo = "xiaomi-ble";
rev = "refs/tags/v${version}";
hash = "sha256-ENs+n8YgOSQpN+UpYU6CI1McWPyh8hKKMUjPDUYRWjI=";
};
postPatch = ''
substituteInPlace pyproject.toml \
--replace-fail " --cov=xiaomi_ble --cov-report=term-missing:skip-covered" ""
'';
nativeBuildInputs = [
poetry-core
pythonRelaxDepsHook
];
pythonRelaxDeps = [
"pycryptodomex"
];
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 ];
};
}