2022-08-12 12:06:08 +00:00
|
|
|
{ lib
|
|
|
|
, async-timeout
|
|
|
|
, bleak
|
2022-12-17 10:02:37 +00:00
|
|
|
, bluetooth-adapters
|
2022-09-30 11:47:45 +00:00
|
|
|
, dbus-fast
|
2022-08-12 12:06:08 +00:00
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, poetry-core
|
|
|
|
, pytestCheckHook
|
|
|
|
, pythonOlder
|
|
|
|
, pytest-asyncio
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "bleak-retry-connector";
|
2022-12-17 10:02:37 +00:00
|
|
|
version = "2.10.2";
|
2022-08-12 12:06:08 +00:00
|
|
|
format = "pyproject";
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Bluetooth-Devices";
|
|
|
|
repo = pname;
|
2022-09-30 11:47:45 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2022-12-17 10:02:37 +00:00
|
|
|
hash = "sha256-9s7Ff7lH7a/zoV0blrp5tOZoZkBDAoSZx5aL9VQyzFo=";
|
2022-08-12 12:06:08 +00:00
|
|
|
};
|
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace pyproject.toml \
|
|
|
|
--replace " --cov=bleak_retry_connector --cov-report=term-missing:skip-covered" ""
|
|
|
|
'';
|
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
poetry-core
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
async-timeout
|
|
|
|
bleak
|
2022-12-17 10:02:37 +00:00
|
|
|
bluetooth-adapters
|
2022-09-30 11:47:45 +00:00
|
|
|
dbus-fast
|
2022-08-12 12:06:08 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
checkInputs = [
|
|
|
|
pytest-asyncio
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
disabledTests = [
|
|
|
|
# broken mocking
|
|
|
|
"test_establish_connection_can_cache_services_services_missing"
|
|
|
|
"test_establish_connection_with_dangerous_use_cached_services"
|
|
|
|
"test_establish_connection_without_dangerous_use_cached_services"
|
|
|
|
];
|
2022-08-12 12:06:08 +00:00
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"bleak_retry_connector"
|
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Connector for Bleak Clients that handles transient connection failures";
|
|
|
|
homepage = "https://github.com/bluetooth-devices/bleak-retry-connector";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ fab ];
|
|
|
|
};
|
|
|
|
}
|