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