pythonPackages.txgithub: refactor move to python-modules

This commit is contained in:
Chris Ostrouchov 2018-10-29 11:41:18 -04:00
parent 2d7d2fa0e2
commit cf540a7e08
No known key found for this signature in database
GPG Key ID: 9ED59B0AB1EAF573
2 changed files with 40 additions and 28 deletions

View File

@ -0,0 +1,39 @@
{ 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 stdenv.lib; {
description = "GitHub API client implemented using Twisted.";
homepage = "https://github.com/tomprince/txgithub";
license = licenses.mit;
maintainers = with maintainers; [ nand0p ];
};
}

View File

@ -4288,34 +4288,7 @@ in {
usbtmc = callPackage ../development/python-modules/usbtmc {};
txgithub = buildPythonPackage rec {
name = "${pname}-${version}";
pname = "txgithub";
version = "15.0.0";
src = pkgs.fetchurl {
url = "mirror://pypi/t/${pname}/${name}.tar.gz";
sha256 = "16gbizy8vkxasxylwzj4p66yw8979nvzxdj6csidgmng7gi2k8nx";
};
propagatedBuildInputs = with self; [ 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 = {
description = "GitHub API client implemented using Twisted.";
homepage = "https://github.com/tomprince/txgithub";
license = licenses.mit;
maintainers = with maintainers; [ nand0p ];
platforms = platforms.all;
};
};
txgithub = callPackage ../development/python-modules/txgithub { };
txrequests = buildPythonPackage rec {
name = "${pname}-${version}";