nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib
2, buildPythonPackage
3, aiohttp
4, bitarray
5, cryptography
6, deepdiff
7, fetchFromGitHub
8, mediafile
9, miniaudio
10, netifaces
11, protobuf
12, pytest-aiohttp
13, pytest-asyncio
14, pytest-timeout
15, pytestCheckHook
16, pythonOlder
17, requests
18, srptools
19, zeroconf
20}:
21
22buildPythonPackage rec {
23 pname = "pyatv";
24 version = "0.10.0";
25 format = "setuptools";
26
27 disabled = pythonOlder "3.6";
28
29 src = fetchFromGitHub {
30 owner = "postlund";
31 repo = pname;
32 rev = "v${version}";
33 sha256 = "sha256-aYNBFtsnSg3PORq72U0PXPFCTVj2+8D2TS3nMau55t4=";
34 };
35
36 postPatch = ''
37 substituteInPlace setup.py \
38 --replace "pytest-runner" ""
39 # Remove all version pinning
40
41 substituteInPlace base_versions.txt \
42 --replace "protobuf==3.19.1,<4" "protobuf>=3.19.0,<4"
43 '';
44
45 propagatedBuildInputs = [
46 aiohttp
47 bitarray
48 cryptography
49 mediafile
50 miniaudio
51 netifaces
52 protobuf
53 requests
54 srptools
55 zeroconf
56 ];
57
58 checkInputs = [
59 deepdiff
60 pytest-aiohttp
61 pytest-asyncio
62 pytest-timeout
63 pytestCheckHook
64 ];
65
66 disabledTestPaths = [
67 # Test doesn't work in the sandbox
68 "tests/protocols/companion/test_companion_auth.py"
69 ];
70
71 __darwinAllowLocalNetworking = true;
72
73 pythonImportsCheck = [
74 "pyatv"
75 ];
76
77 meta = with lib; {
78 description = "Python client library for the Apple TV";
79 homepage = "https://github.com/postlund/pyatv";
80 license = licenses.mit;
81 maintainers = with maintainers; [ elseym ];
82 };
83}