1{
2 lib,
3 aiohttp,
4 aioresponses,
5 buildPythonPackage,
6 click,
7 cryptography,
8 dateparser,
9 fetchFromGitHub,
10 marshmallow-dataclass,
11 poetry-core,
12 pyjwt,
13 pythonOlder,
14 pytest-asyncio,
15 pytestCheckHook,
16 syrupy,
17 tabulate,
18 typeguard,
19}:
20
21buildPythonPackage rec {
22 pname = "renault-api";
23 version = "0.4.1";
24 pyproject = true;
25
26 disabled = pythonOlder "3.8";
27
28 src = fetchFromGitHub {
29 owner = "hacf-fr";
30 repo = "renault-api";
31 tag = "v${version}";
32 hash = "sha256-jnmfCYFtlfnFRMrNHfoiXgL8bael7IKmhuZCj+AOuz8=";
33 };
34
35 build-system = [ poetry-core ];
36
37 dependencies = [
38 aiohttp
39 cryptography
40 marshmallow-dataclass
41 pyjwt
42 ];
43
44 optional-dependencies = {
45 cli = [
46 click
47 dateparser
48 tabulate
49 ];
50 };
51
52 nativeCheckInputs = [
53 aioresponses
54 pytest-asyncio
55 pytestCheckHook
56 syrupy
57 typeguard
58 ]
59 ++ lib.flatten (lib.attrValues optional-dependencies);
60
61 pythonImportsCheck = [ "renault_api" ];
62
63 meta = with lib; {
64 description = "Python library to interact with the Renault API";
65 homepage = "https://github.com/hacf-fr/renault-api";
66 changelog = "https://github.com/hacf-fr/renault-api/releases/tag/v${version}";
67 license = licenses.mit;
68 maintainers = with maintainers; [ fab ];
69 mainProgram = "renault-api";
70 };
71}