about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/txgithub/default.nix
blob: 402e5011ede631d141023d39b0151bd8ce94724f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
{ lib, stdenv
, buildPythonPackage
, fetchPypi
, pyopenssl
, twisted
, service-identity
}:

buildPythonPackage rec {
  pname = "txgithub";
  version = "15.0.0";

  src = fetchPypi {
    inherit pname version;
    sha256 = "16gbizy8vkxasxylwzj4p66yw8979nvzxdj6csidgmng7gi2k8nx";
  };

  propagatedBuildInputs = [ pyopenssl twisted service-identity ];

  # fix python3 issues
  patchPhase = ''
    sed -i 's/except usage.UsageError, errortext/except usage.UsageError as errortext/' txgithub/scripts/create_token.py
    sed -i 's/except usage.UsageError, errortext/except usage.UsageError as errortext/' txgithub/scripts/gist.py
    sed -i 's/print response\[\x27html_url\x27\]/print(response\[\x27html_url\x27\])/' txgithub/scripts/gist.py
    sed -i '41d' txgithub/scripts/gist.py
    sed -i '41d' txgithub/scripts/gist.py
  '';

  # No tests distributed
  doCheck = false;

  meta = with lib; {
    description = "GitHub API client implemented using Twisted.";
    homepage    = "https://github.com/tomprince/txgithub";
    license     = licenses.mit;
    maintainers = with maintainers; [ nand0p ];
  };

}