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