2024-04-21 15:54:59 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
async-timeout,
|
|
|
|
bleak,
|
|
|
|
bluetooth-adapters,
|
|
|
|
dbus-fast,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
poetry-core,
|
|
|
|
pytestCheckHook,
|
|
|
|
pythonOlder,
|
|
|
|
pytest-asyncio,
|
2022-08-12 12:06:08 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "bleak-retry-connector";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "3.5.0";
|
|
|
|
pyproject = true;
|
2022-08-12 12:06:08 +00:00
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Bluetooth-Devices";
|
2024-04-21 15:54:59 +00:00
|
|
|
repo = "bleak-retry-connector";
|
2022-09-30 11:47:45 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2024-04-21 15:54:59 +00:00
|
|
|
hash = "sha256-oqc997siTg43Ulrc539G3utfQvHjcBZJgQ8/CfcSduc=";
|
2022-08-12 12:06:08 +00:00
|
|
|
};
|
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace pyproject.toml \
|
2024-04-21 15:54:59 +00:00
|
|
|
--replace-fail " --cov=bleak_retry_connector --cov-report=term-missing:skip-covered" ""
|
2022-09-30 11:47:45 +00:00
|
|
|
'';
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
build-system = [ poetry-core ];
|
2022-08-12 12:06:08 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
dependencies = [
|
2022-08-12 12:06:08 +00:00
|
|
|
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
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2022-08-12 12:06:08 +00:00
|
|
|
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
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
pythonImportsCheck = [ "bleak_retry_connector" ];
|
2022-08-12 12:06:08 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Connector for Bleak Clients that handles transient connection failures";
|
|
|
|
homepage = "https://github.com/bluetooth-devices/bleak-retry-connector";
|
2022-12-28 21:21:41 +00:00
|
|
|
changelog = "https://github.com/bluetooth-devices/bleak-retry-connector/blob/v${version}/CHANGELOG.md";
|
2022-08-12 12:06:08 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ fab ];
|
|
|
|
};
|
|
|
|
}
|