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