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 pytestCheckHook,
14 pythonOlder,
15 syrupy,
16 typer,
17 yarl,
18 zeroconf,
19}:
20
21buildPythonPackage rec {
22 pname = "gotailwind";
23 version = "0.2.3";
24 pyproject = true;
25
26 disabled = pythonOlder "3.11";
27
28 src = fetchFromGitHub {
29 owner = "frenck";
30 repo = "python-gotailwind";
31 rev = "refs/tags/v${version}";
32 hash = "sha256-FRFcFn5aRg+H9M6ZwEfLO1Dwcybvs0ODQv2ruCG+4v0=";
33 };
34
35 postPatch = ''
36 # Upstream doesn't set a version for the pyproject.toml
37 substituteInPlace pyproject.toml \
38 --replace-fail "0.0.0" "${version}" \
39 --replace-fail "--cov" ""
40 '';
41
42 build-system = [ poetry-core ];
43
44 dependencies = [
45 aiohttp
46 awesomeversion
47 backoff
48 mashumaro
49 orjson
50 yarl
51 zeroconf
52 ];
53
54 passthru.optional-dependencies = {
55 cli = [ typer ];
56 };
57
58 nativeCheckInputs = [
59 aresponses
60 pytest-asyncio
61 pytestCheckHook
62 syrupy
63 ];
64
65 pythonImportsCheck = [ "gotailwind" ];
66
67 meta = with lib; {
68 description = "Modul to communicate with Tailwind garage door openers";
69 homepage = "https://github.com/frenck/python-gotailwind";
70 changelog = "https://github.com/frenck/python-gotailwind/releases/tag/v$version";
71 license = licenses.mit;
72 maintainers = with maintainers; [ fab ];
73 mainProgram = "tailwind";
74 };
75}