summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/directv/default.nix
blob: 3baaef43be4ed2b961e53b6067e6b625270cb8d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  fetchpatch,
  setuptools,
  aiohttp,
  yarl,
  aresponses,
  pytest-asyncio,
  pytestCheckHook,
}:

buildPythonPackage rec {
  pname = "directv";
  version = "0.4.0";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "ctalkington";
    repo = "python-directv";
    tag = version;
    hash = "sha256-s4bE8ACFCfpNq+HGEO8fv3VCGPI4OOdR5A7RjY2bTKY=";
  };

  patches = [
    # https://github.com/ctalkington/python-directv/pull/365
    (fetchpatch {
      name = "replace-async-timeout-with-asyncio.timeout.patch";
      url = "https://github.com/ctalkington/python-directv/commit/a161454b09e144de15883d25378fbb13069e241b.patch";
      hash = "sha256-jI+ALoQ0EDUQCSQp90SE+e3sGMWLwojNtLevAbgoScc=";
    })
  ];

  build-system = [ setuptools ];

  dependencies = [
    aiohttp
    yarl
  ];

  nativeCheckInputs = [
    aresponses
    pytest-asyncio
    pytestCheckHook
  ];

  __darwinAllowLocalNetworking = true;

  disabledTests = [
    #  ValueError: Host '#' cannot contain '#' (at position 0)
    "test_client_error"
  ];

  pythonImportsCheck = [ "directv" ];

  meta = {
    changelog = "https://github.com/ctalkington/python-directv/releases/tag/${src.tag}";
    description = "Asynchronous Python client for DirecTV (SHEF)";
    homepage = "https://github.com/ctalkington/python-directv";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ dotlambda ];
  };
}