2022-09-09 14:08:57 +00:00
|
|
|
{ lib
|
2024-01-25 14:12:00 +00:00
|
|
|
, async-interrupt
|
2024-04-21 15:54:59 +00:00
|
|
|
, async-timeout
|
2022-09-09 14:08:57 +00:00
|
|
|
, bleak
|
|
|
|
, bleak-retry-connector
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, poetry-core
|
2024-01-25 14:12:00 +00:00
|
|
|
, pytestCheckHook
|
2022-09-09 14:08:57 +00:00
|
|
|
, pythonOlder
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "airthings-ble";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "0.7.1";
|
2024-01-25 14:12:00 +00:00
|
|
|
pyproject = true;
|
2022-09-09 14:08:57 +00:00
|
|
|
|
|
|
|
disabled = pythonOlder "3.9";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "vincegio";
|
2024-04-21 15:54:59 +00:00
|
|
|
repo = "airthings-ble";
|
|
|
|
rev = "refs/tags/${version}";
|
|
|
|
hash = "sha256-BeOrGRVxvfQR1xqIpOp4tOTvlqTKCZHUjVKDqVjVnYM=";
|
2022-09-09 14:08:57 +00:00
|
|
|
};
|
|
|
|
|
2022-09-11 15:47:08 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace pyproject.toml \
|
2024-04-21 15:54:59 +00:00
|
|
|
--replace-fail "-v -Wdefault --cov=airthings_ble --cov-report=term-missing:skip-covered" ""
|
2022-09-11 15:47:08 +00:00
|
|
|
'';
|
|
|
|
|
2022-09-09 14:08:57 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
poetry-core
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
2024-01-25 14:12:00 +00:00
|
|
|
async-interrupt
|
2022-09-09 14:08:57 +00:00
|
|
|
bleak
|
|
|
|
bleak-retry-connector
|
2024-04-21 15:54:59 +00:00
|
|
|
] ++ lib.optionals (pythonOlder "3.11") [
|
|
|
|
async-timeout
|
2022-09-09 14:08:57 +00:00
|
|
|
];
|
|
|
|
|
2024-01-25 14:12:00 +00:00
|
|
|
nativeCheckInputs = [
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
2022-09-09 14:08:57 +00:00
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"airthings_ble"
|
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Library for Airthings BLE devices";
|
|
|
|
homepage = "https://github.com/vincegio/airthings-ble";
|
2023-02-16 17:41:37 +00:00
|
|
|
changelog = "https://github.com/vincegio/airthings-ble/releases/tag/v${version}";
|
2022-09-09 14:08:57 +00:00
|
|
|
license = with licenses; [ mit ];
|
|
|
|
maintainers = with maintainers; [ fab ];
|
|
|
|
};
|
|
|
|
}
|