summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/tweepy/default.nix
blob: 9ed0abb9221b5ceee7812fb267ad462a51e4b544 (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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
{
  lib,
  aiohttp,
  async-lru,
  buildPythonPackage,
  fetchFromGitHub,
  flit-core,
  oauthlib,
  pytestCheckHook,
  requests-oauthlib,
  requests,
  vcrpy,
}:

buildPythonPackage rec {
  pname = "tweepy";
  version = "4.16.0";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "tweepy";
    repo = "tweepy";
    tag = "v${version}";
    hash = "sha256-9rJrZb9X3twVtfnQTFjWLH/TttfUNm4KA3/6AIHDKc0=";
  };

  build-system = [ flit-core ];

  dependencies = [
    oauthlib
    requests
    requests-oauthlib
  ];

  optional-dependencies = {
    async = [
      aiohttp
      async-lru
    ];
  };

  nativeCheckInputs = [
    pytestCheckHook
    vcrpy
  ]
  ++ lib.concatAttrValues optional-dependencies;

  pythonImportsCheck = [ "tweepy" ];

  # The checks with streaming fail due to (seemingly) not decoding (or unexpectedly sending response in) GZIP
  # Same issue impacted mastodon-py, see https://github.com/halcy/Mastodon.py/commit/cd86887d88bbc07de462d1e00a8fbc3d956c0151 (who just disabled these)
  disabledTestPaths = [ "tests/test_client.py" ];

  disabledTests = [
    "test_indicate_direct_message_typing"
    "testcachedifferentqueryparameters"
    "testcachedresult"
    "testcreatedestroyblock"
    "testcreatedestroyfriendship"
    "testcreateupdatedestroylist"
    "testgetfollowerids"
    "testgetfollowers"
    "testgetfriendids"
    "testgetfriends"
    "testgetuser"
    "testcursorcursoritems"
    "testcursorcursorpages"
    "testcursornext"
  ];

  meta = {
    description = "Twitter library for Python";
    homepage = "https://github.com/tweepy/tweepy";
    changelog = "https://github.com/tweepy/tweepy/releases/tag/v${version}";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ marius851000 ];
  };
}