2021-06-28 23:13:55 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, pythonOlder
|
|
|
|
, fetchFromGitHub
|
|
|
|
, pbr
|
2022-06-16 17:23:12 +00:00
|
|
|
, httpx
|
2023-10-09 19:29:22 +00:00
|
|
|
, pillow
|
2021-12-06 16:07:01 +00:00
|
|
|
, pycryptodome
|
|
|
|
, pyjwt
|
2023-10-09 19:29:22 +00:00
|
|
|
, pytest-asyncio
|
2021-06-28 23:13:55 +00:00
|
|
|
, pytestCheckHook
|
2023-10-09 19:29:22 +00:00
|
|
|
, python
|
2022-06-16 17:23:12 +00:00
|
|
|
, respx
|
2024-01-02 11:29:13 +00:00
|
|
|
, setuptools
|
2021-12-25 05:07:40 +00:00
|
|
|
, time-machine
|
2023-10-09 19:29:22 +00:00
|
|
|
, tzdata
|
2021-06-28 23:13:55 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "bimmer-connected";
|
2024-01-02 11:29:13 +00:00
|
|
|
version = "0.14.6";
|
|
|
|
pyproject = true;
|
2021-06-28 23:13:55 +00:00
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
disabled = pythonOlder "3.6";
|
2021-06-28 23:13:55 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "bimmerconnected";
|
|
|
|
repo = "bimmer_connected";
|
2022-06-16 17:23:12 +00:00
|
|
|
rev = "refs/tags/${version}";
|
2024-01-02 11:29:13 +00:00
|
|
|
hash = "sha256-/FL9czp5x/BcKSXXzT19kgGiPFd61BpU7HLtgyyHlIs=";
|
2021-06-28 23:13:55 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
pbr
|
2024-01-02 11:29:13 +00:00
|
|
|
setuptools
|
2021-06-28 23:13:55 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
PBR_VERSION = version;
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
2022-06-16 17:23:12 +00:00
|
|
|
httpx
|
2021-12-06 16:07:01 +00:00
|
|
|
pycryptodome
|
|
|
|
pyjwt
|
2021-06-28 23:13:55 +00:00
|
|
|
];
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
passthru.optional-dependencies = {
|
|
|
|
china = [
|
|
|
|
pillow
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
postInstall = ''
|
|
|
|
cp -R bimmer_connected/tests/responses $out/${python.sitePackages}/bimmer_connected/tests/
|
|
|
|
'';
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2023-10-09 19:29:22 +00:00
|
|
|
pytest-asyncio
|
2021-06-28 23:13:55 +00:00
|
|
|
pytestCheckHook
|
2022-06-16 17:23:12 +00:00
|
|
|
respx
|
2021-12-25 05:07:40 +00:00
|
|
|
time-machine
|
2024-01-02 11:29:13 +00:00
|
|
|
] ++ lib.flatten (lib.attrValues passthru.optional-dependencies);
|
2021-06-28 23:13:55 +00:00
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
disabledTests = [
|
|
|
|
# presumably regressed in pytest-asyncio 0.23.0
|
|
|
|
"test_get_remote_position_too_old"
|
|
|
|
];
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
preCheck = ''
|
|
|
|
export TZDIR=${tzdata}/${python.sitePackages}/tzdata/zoneinfo
|
|
|
|
'';
|
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"bimmer_connected"
|
|
|
|
];
|
|
|
|
|
2021-06-28 23:13:55 +00:00
|
|
|
meta = with lib; {
|
2023-04-12 12:48:02 +00:00
|
|
|
changelog = "https://github.com/bimmerconnected/bimmer_connected/releases/tag/${version}";
|
2021-06-28 23:13:55 +00:00
|
|
|
description = "Library to read data from the BMW Connected Drive portal";
|
|
|
|
homepage = "https://github.com/bimmerconnected/bimmer_connected";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ dotlambda ];
|
|
|
|
};
|
|
|
|
}
|