1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 httpx,
6 orjson,
7 poetry-core,
8 pytest-asyncio,
9 pytestCheckHook,
10 pythonOlder,
11 respx,
12 rich,
13 syrupy,
14 tenacity,
15 typer,
16}:
17
18buildPythonPackage rec {
19 pname = "pytrydan";
20 version = "0.7.0";
21 pyproject = true;
22
23 disabled = pythonOlder "3.10";
24
25 src = fetchFromGitHub {
26 owner = "dgomes";
27 repo = "pytrydan";
28 rev = "refs/tags/v${version}";
29 hash = "sha256-9TZZ4J3fIUGaeWYd5kP9eFABvL/95muD7sDevUaGprQ=";
30 };
31
32 postPatch = ''
33 substituteInPlace pyproject.toml \
34 --replace-fail " --cov=pytrydan --cov-report=term-missing:skip-covered" ""
35 '';
36
37 build-system = [ poetry-core ];
38
39 dependencies = [
40 httpx
41 orjson
42 rich
43 tenacity
44 typer
45 ];
46
47 nativeCheckInputs = [
48 pytest-asyncio
49 pytestCheckHook
50 respx
51 syrupy
52 ];
53
54 pythonImportsCheck = [ "pytrydan" ];
55
56 meta = with lib; {
57 description = "Library to interface with V2C EVSE Trydan";
58 homepage = "https://github.com/dgomes/pytrydan";
59 changelog = "https://github.com/dgomes/pytrydan/blob/${version}/CHANGELOG.md";
60 license = licenses.mit;
61 maintainers = with maintainers; [ fab ];
62 mainProgram = "pytrydan";
63 };
64}