1{
2 lib,
3 aiohttp,
4 aresponses,
5 buildPythonPackage,
6 fetchFromGitHub,
7 mashumaro,
8 orjson,
9 poetry-core,
10 pytest-asyncio,
11 pytestCheckHook,
12 pythonOlder,
13 yarl,
14}:
15
16buildPythonPackage rec {
17 pname = "tailscale";
18 version = "0.6.0";
19 format = "pyproject";
20
21 disabled = pythonOlder "3.11";
22
23 src = fetchFromGitHub {
24 owner = "frenck";
25 repo = "python-tailscale";
26 rev = "refs/tags/v${version}";
27 hash = "sha256-wO6yMMU5fxk8GQ0e4ZCse2atlR4wrzulZOFXkVKAsmU=";
28 };
29
30 postPatch = ''
31 # Upstream doesn't set a version for the pyproject.toml
32 substituteInPlace pyproject.toml \
33 --replace 'version = "0.0.0"' 'version = "${version}"' \
34 --replace "--cov" ""
35 '';
36
37 nativeBuildInputs = [ poetry-core ];
38
39 propagatedBuildInputs = [
40 aiohttp
41 mashumaro
42 orjson
43 yarl
44 ];
45
46 nativeCheckInputs = [
47 aresponses
48 pytest-asyncio
49 pytestCheckHook
50 ];
51
52 pythonImportsCheck = [ "tailscale" ];
53
54 meta = with lib; {
55 description = "Python client for the Tailscale API";
56 homepage = "https://github.com/frenck/python-tailscale";
57 changelog = "https://github.com/frenck/python-tailscale/releases/tag/v${version}";
58 license = licenses.mit;
59 maintainers = with maintainers; [ fab ];
60 };
61}