1{
2 lib,
3 aiohttp,
4 async-lru,
5 buildPythonPackage,
6 fetchFromGitHub,
7 oauthlib,
8 pytestCheckHook,
9 pythonOlder,
10 requests,
11 requests-oauthlib,
12 setuptools,
13 vcrpy,
14}:
15
16buildPythonPackage rec {
17 pname = "tweepy";
18 version = "4.15.0";
19 pyproject = true;
20
21 disabled = pythonOlder "3.9";
22
23 src = fetchFromGitHub {
24 owner = "tweepy";
25 repo = "tweepy";
26 tag = "v${version}";
27 hash = "sha256-vbiMwaJh4cN7OY7eYu2s8azs3A0KXvW/kRPVCx50ZVA=";
28 };
29
30 build-system = [ setuptools ];
31
32 dependencies = [
33 oauthlib
34 requests
35 requests-oauthlib
36 ];
37
38 optional-dependencies = {
39 async = [
40 aiohttp
41 async-lru
42 ];
43 };
44
45 nativeCheckInputs = [
46 pytestCheckHook
47 vcrpy
48 ] ++ lib.flatten (builtins.attrValues optional-dependencies);
49
50 pythonImportsCheck = [ "tweepy" ];
51
52 # The checks with streaming fail due to (seemingly) not decoding (or unexpectedly sending response in) GZIP
53 # Same issue impacted mastodon-py, see https://github.com/halcy/Mastodon.py/commit/cd86887d88bbc07de462d1e00a8fbc3d956c0151 (who just disabled these)
54 disabledTestPaths = [ "tests/test_client.py" ];
55
56 disabledTests = [
57 "test_indicate_direct_message_typing"
58 "testcachedifferentqueryparameters"
59 "testcachedresult"
60 "testcreatedestroyblock"
61 "testcreatedestroyfriendship"
62 "testcreateupdatedestroylist"
63 "testgetfollowerids"
64 "testgetfollowers"
65 "testgetfriendids"
66 "testgetfriends"
67 "testgetuser"
68 "testcursorcursoritems"
69 "testcursorcursorpages"
70 "testcursornext"
71 ];
72
73 meta = with lib; {
74 description = "Twitter library for Python";
75 homepage = "https://github.com/tweepy/tweepy";
76 changelog = "https://github.com/tweepy/tweepy/releases/tag/v${version}";
77 license = licenses.mit;
78 maintainers = with maintainers; [ marius851000 ];
79 };
80}