1{ lib
2, buildPythonPackage
3, aiohttp
4, bitarray
5, chacha20poly1305-reuseable
6, cryptography
7, deepdiff
8, fetchFromGitHub
9, mediafile
10, miniaudio
11, netifaces
12, protobuf
13, pytest-aiohttp
14, pytest-asyncio
15, pytest-timeout
16, pytestCheckHook
17, pythonRelaxDepsHook
18, pythonOlder
19, requests
20, srptools
21, zeroconf
22}:
23
24buildPythonPackage rec {
25 pname = "pyatv";
26 version = "0.12.1";
27 format = "setuptools";
28
29 disabled = pythonOlder "3.7";
30
31 src = fetchFromGitHub {
32 owner = "postlund";
33 repo = pname;
34 rev = "refs/tags/v${version}";
35 hash = "sha256-HugvgJAD5R6n8XK802QR7FAaZscyzFRayg48kf3crFQ=";
36 };
37
38 postPatch = ''
39 substituteInPlace setup.py \
40 --replace "pytest-runner" ""
41 '';
42
43 pythonRelaxDeps = [
44 "aiohttp"
45 "async_timeout"
46 "bitarray"
47 "chacha20poly1305-reuseable"
48 "cryptography"
49 "ifaddr"
50 "mediafile"
51 "miniaudio"
52 "protobuf"
53 "requests"
54 "srptools"
55 "zeroconf"
56 ];
57
58 nativeBuildInputs = [
59 pythonRelaxDepsHook
60 ];
61
62 propagatedBuildInputs = [
63 aiohttp
64 bitarray
65 chacha20poly1305-reuseable
66 cryptography
67 mediafile
68 miniaudio
69 netifaces
70 protobuf
71 requests
72 srptools
73 zeroconf
74 ];
75
76 nativeCheckInputs = [
77 deepdiff
78 pytest-aiohttp
79 pytest-asyncio
80 pytest-timeout
81 pytestCheckHook
82 ];
83
84 pytestFlagsArray = [
85 "--asyncio-mode=legacy"
86 ];
87
88 disabledTestPaths = [
89 # Test doesn't work in the sandbox
90 "tests/protocols/companion/test_companion_auth.py"
91 "tests/protocols/mrp/test_mrp_auth.py"
92 ];
93
94 __darwinAllowLocalNetworking = true;
95
96 pythonImportsCheck = [
97 "pyatv"
98 ];
99
100 meta = with lib; {
101 description = "Python client library for the Apple TV";
102 homepage = "https://github.com/postlund/pyatv";
103 changelog = "https://github.com/postlund/pyatv/blob/v${version}/CHANGES.md";
104 license = licenses.mit;
105 maintainers = with maintainers; [ fab ];
106 };
107}