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