1{
2 lib,
3 aiohttp,
4 buildPythonPackage,
5 cryptography,
6 fetchFromGitHub,
7 pytest-asyncio,
8 pytestCheckHook,
9 pythonOlder,
10 stdiomask,
11}:
12
13buildPythonPackage rec {
14 pname = "subarulink";
15 version = "0.7.11";
16 format = "setuptools";
17
18 disabled = pythonOlder "3.7";
19
20 src = fetchFromGitHub {
21 owner = "G-Two";
22 repo = pname;
23 rev = "refs/tags/v${version}";
24 hash = "sha256-HKtToMh4dAUpA654tFkUEM9DLPGr9XRQK0ezYzNPzqk=";
25 };
26
27 propagatedBuildInputs = [
28 aiohttp
29 stdiomask
30 ];
31
32 nativeCheckInputs = [
33 cryptography
34 pytest-asyncio
35 pytestCheckHook
36 ];
37
38 postPatch = ''
39 substituteInPlace setup.cfg \
40 --replace "--cov=subarulink" ""
41 '';
42
43 __darwinAllowLocalNetworking = true;
44
45 preCheck = ''
46 export HOME=$(mktemp -d)
47 '';
48
49 pythonImportsCheck = [ "subarulink" ];
50
51 meta = with lib; {
52 description = "Python module for interacting with STARLINK-enabled vehicle";
53 mainProgram = "subarulink";
54 homepage = "https://github.com/G-Two/subarulink";
55 changelog = "https://github.com/G-Two/subarulink/releases/tag/v${version}";
56 license = with licenses; [ asl20 ];
57 maintainers = with maintainers; [ fab ];
58 };
59}