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