1{
2 lib,
3 aiohttp,
4 aresponses,
5 awesomeversion,
6 backoff,
7 buildPythonPackage,
8 fetchFromGitHub,
9 hatchling,
10 mashumaro,
11 orjson,
12 pytest-asyncio,
13 pytest-cov-stub,
14 pytestCheckHook,
15 pythonOlder,
16 syrupy,
17 typer,
18 yarl,
19 zeroconf,
20}:
21
22buildPythonPackage rec {
23 pname = "peblar";
24 version = "0.4.0";
25 pyproject = true;
26
27 disabled = pythonOlder "3.7";
28
29 src = fetchFromGitHub {
30 owner = "frenck";
31 repo = "python-peblar";
32 tag = "v${version}";
33 hash = "sha256-cHb/VTaa7tkePqV7eLpDSxrnY8hAnjshwtwyWmJnt/4=";
34 };
35
36 postPatch = ''
37 # Upstream doesn't set a version for GitHub releases
38 substituteInPlace pyproject.toml \
39 --replace-fail 'version = "0.0.0"' 'version = "${version}"'
40 '';
41
42 build-system = [ hatchling ];
43
44 dependencies = [
45 aiohttp
46 awesomeversion
47 backoff
48 mashumaro
49 orjson
50 yarl
51 ];
52
53 optional-dependencies = {
54 cli = [
55 typer
56 zeroconf
57 ];
58 };
59
60 nativeCheckInputs = [
61 aresponses
62 pytest-asyncio
63 pytest-cov-stub
64 pytestCheckHook
65 syrupy
66 ];
67
68 pythonImportsCheck = [ "peblar" ];
69
70 meta = {
71 description = "Python client for Peblar EV chargers";
72 homepage = "https://github.com/frenck/python-peblar";
73 changelog = "https://github.com/frenck/python-peblar/releases/tag/v${version}";
74 license = lib.licenses.mit;
75 maintainers = with lib.maintainers; [ fab ];
76 };
77}