1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 setuptools,
6 aiohttp,
7 yarl,
8 aresponses,
9 pytest-asyncio,
10 pytestCheckHook,
11}:
12
13buildPythonPackage rec {
14 pname = "directv";
15 version = "0.4.0";
16 pyproject = true;
17
18 src = fetchFromGitHub {
19 owner = "ctalkington";
20 repo = "python-directv";
21 tag = version;
22 hash = "sha256-s4bE8ACFCfpNq+HGEO8fv3VCGPI4OOdR5A7RjY2bTKY=";
23 };
24
25 postPatch = ''
26 # TypeError: 'Timeout' object does not support the context manager protocol
27 substituteInPlace directv/directv.py \
28 --replace-fail "with async_timeout.timeout" "async with async_timeout.timeout"
29 '';
30
31 build-system = [ setuptools ];
32
33 dependencies = [
34 aiohttp
35 yarl
36 ];
37
38 nativeCheckInputs = [
39 aresponses
40 pytest-asyncio
41 pytestCheckHook
42 ];
43
44 __darwinAllowLocalNetworking = true;
45
46 disabledTests = [
47 # ValueError: Host '#' cannot contain '#' (at position 0)
48 "test_client_error"
49 ];
50
51 pythonImportsCheck = [ "directv" ];
52
53 meta = {
54 changelog = "https://github.com/ctalkington/python-directv/releases/tag/${src.tag}";
55 description = "Asynchronous Python client for DirecTV (SHEF)";
56 homepage = "https://github.com/ctalkington/python-directv";
57 license = lib.licenses.mit;
58 maintainers = with lib.maintainers; [ dotlambda ];
59 };
60}