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, pythonOlder
18, requests
19, srptools
20, zeroconf
21}:
22
23buildPythonPackage rec {
24 pname = "pyatv";
25 version = "0.10.3";
26 format = "setuptools";
27
28 disabled = pythonOlder "3.6";
29
30 src = fetchFromGitHub {
31 owner = "postlund";
32 repo = pname;
33 rev = "v${version}";
34 sha256 = "sha256-ng5KfW93p2/N2a6lnGbRJC6aWOQgTl0imBLdUIUlDic=";
35 };
36
37 postPatch = ''
38 substituteInPlace setup.py \
39 --replace "pytest-runner" ""
40 # Remove all version pinning
41
42 substituteInPlace base_versions.txt \
43 --replace "protobuf==3.19.1,<4" "protobuf>=3.19.0,<4"
44 '';
45
46 propagatedBuildInputs = [
47 aiohttp
48 bitarray
49 chacha20poly1305-reuseable
50 cryptography
51 mediafile
52 miniaudio
53 netifaces
54 protobuf
55 requests
56 srptools
57 zeroconf
58 ];
59
60 checkInputs = [
61 deepdiff
62 pytest-aiohttp
63 pytest-asyncio
64 pytest-timeout
65 pytestCheckHook
66 ];
67
68 pytestFlagsArray = [
69 "--asyncio-mode=legacy"
70 ];
71
72 disabledTestPaths = [
73 # Test doesn't work in the sandbox
74 "tests/protocols/companion/test_companion_auth.py"
75 ];
76
77 __darwinAllowLocalNetworking = true;
78
79 pythonImportsCheck = [
80 "pyatv"
81 ];
82
83 meta = with lib; {
84 description = "Python client library for the Apple TV";
85 homepage = "https://github.com/postlund/pyatv";
86 license = licenses.mit;
87 maintainers = with maintainers; [ ];
88 };
89}