1{
2 buildPythonPackage,
3 fetchFromGitHub,
4 fetchpatch,
5 filetype,
6 future,
7 hypothesis,
8 lib,
9 pytestCheckHook,
10 pythonOlder,
11 requests,
12 requests-oauthlib,
13 responses,
14 setuptools,
15}:
16
17buildPythonPackage rec {
18 pname = "python-twitter";
19 version = "3.5";
20
21 pyproject = true;
22 build-system = [ setuptools ];
23
24 disabled = pythonOlder "3.7";
25
26 src = fetchFromGitHub {
27 owner = "bear";
28 repo = "python-twitter";
29 rev = "v${version}";
30 sha256 = "08ydmf6dcd416cvw6xq1wxsz6b9s21f2mf9fh3y4qz9swj6n9h8z";
31 };
32
33 patches = [
34 # Fix tests. Remove with the next release
35 (fetchpatch {
36 url = "https://github.com/bear/python-twitter/commit/f7eb83d9dca3ba0ee93e629ba5322732f99a3a30.patch";
37 sha256 = "008b1bd03wwngs554qb136lsasihql3yi7vlcacmk4s5fmr6klqw";
38 })
39 ];
40
41 dependencies = [
42 filetype
43 future
44 requests
45 requests-oauthlib
46 ];
47
48 nativeCheckInputs = [
49 pytestCheckHook
50 responses
51 hypothesis
52 ];
53
54 postPatch = ''
55 substituteInPlace setup.py \
56 --replace-fail "'pytest-runner'" ""
57 '';
58
59 disabledTests = [
60 # AttributeError: 'FileCacheTest' object has no attribute 'assert_'
61 "test_filecache"
62 ];
63
64 pythonImportsCheck = [ "twitter" ];
65
66 meta = with lib; {
67 description = "Python wrapper around the Twitter API";
68 homepage = "https://github.com/bear/python-twitter";
69 license = licenses.asl20;
70 maintainers = [ ];
71 };
72}