summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/twitchapi/default.nix
blob: 08055ba4f18d47f84ebcc12f21e805c6fce91f82 (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
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  setuptools,
  aiohttp,
  python-dateutil,
  typing-extensions,
}:

buildPythonPackage rec {
  pname = "twitchapi";
  version = "4.5.0";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "Teekeks";
    repo = "pyTwitchAPI";
    tag = "v${version}";
    hash = "sha256-3kAR/9OS58sDRUiCcQAI7KCCPpnclBNR4SkwDNJs9mo=";
  };

  postPatch = ''
    sed -i "/document_enum/d" twitchAPI/type.py
  '';

  pythonRemoveDeps = [
    "enum-tools"
  ];

  build-system = [ setuptools ];

  dependencies = [
    aiohttp
    python-dateutil
    typing-extensions
  ];

  # upstream has no tests
  doCheck = false;

  pythonImportsCheck = [
    "twitchAPI.chat"
    "twitchAPI.eventsub"
    "twitchAPI.helper"
    "twitchAPI.oauth"
    "twitchAPI.twitch"
    "twitchAPI.type"
  ];

  meta = {
    changelog = "https://github.com/Teekeks/pyTwitchAPI/blob/${src.tag}/docs/changelog.rst";
    description = "Python implementation of the Twitch Helix API, EventSub and Chat";
    homepage = "https://github.com/Teekeks/pyTwitchAPI";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [
      dotlambda
    ];
  };
}