Merge pull request #307098 from r-ryantm/auto-update/cilium-cli
[NixPkgs.git] / pkgs / development / python-modules / bimmer-connected / default.nix
blob48ddcc9e7d629acd26ade626000c0b4e64c3c235
1 { lib
2 , buildPythonPackage
3 , pythonOlder
4 , fetchFromGitHub
5 , pbr
6 , httpx
7 , pillow
8 , pycryptodome
9 , pyjwt
10 , pytest-asyncio
11 , pytestCheckHook
12 , python
13 , respx
14 , setuptools
15 , time-machine
16 , tzdata
19 buildPythonPackage rec {
20   pname = "bimmer-connected";
21   version = "0.14.6";
22   pyproject = true;
24   disabled = pythonOlder "3.6";
26   src = fetchFromGitHub {
27     owner = "bimmerconnected";
28     repo = "bimmer_connected";
29     rev = "refs/tags/${version}";
30     hash = "sha256-/FL9czp5x/BcKSXXzT19kgGiPFd61BpU7HLtgyyHlIs=";
31   };
33   nativeBuildInputs = [
34     pbr
35     setuptools
36   ];
38   PBR_VERSION = version;
40   propagatedBuildInputs = [
41     httpx
42     pycryptodome
43     pyjwt
44   ];
46   passthru.optional-dependencies = {
47     china = [
48       pillow
49     ];
50   };
52   postInstall = ''
53     cp -R bimmer_connected/tests/responses $out/${python.sitePackages}/bimmer_connected/tests/
54   '';
56   nativeCheckInputs = [
57     pytest-asyncio
58     pytestCheckHook
59     respx
60     time-machine
61   ] ++ lib.flatten (lib.attrValues passthru.optional-dependencies);
63   disabledTests = [
64     # presumably regressed in pytest-asyncio 0.23.0
65     "test_get_remote_position_too_old"
66   ];
68   preCheck = ''
69     export TZDIR=${tzdata}/${python.sitePackages}/tzdata/zoneinfo
70   '';
72   pythonImportsCheck = [
73     "bimmer_connected"
74   ];
76   meta = with lib; {
77     changelog = "https://github.com/bimmerconnected/bimmer_connected/releases/tag/${version}";
78     description = "Library to read data from the BMW Connected Drive portal";
79     mainProgram = "bimmerconnected";
80     homepage = "https://github.com/bimmerconnected/bimmer_connected";
81     license = licenses.asl20;
82     maintainers = with maintainers; [ dotlambda ];
83   };