From dc56c8faf903126a0566506379bc867e71124ffb Mon Sep 17 00:00:00 2001 From: Chris Ostrouchov Date: Tue, 16 Oct 2018 16:37:02 -0400 Subject: [PATCH] pythonPackages.github3_py: refactor move to python-modules --- .../python-modules/github3_py/default.nix | 45 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 30 +------------ 2 files changed, 46 insertions(+), 29 deletions(-) create mode 100644 pkgs/development/python-modules/github3_py/default.nix diff --git a/pkgs/development/python-modules/github3_py/default.nix b/pkgs/development/python-modules/github3_py/default.nix new file mode 100644 index 00000000000..8968585d9cd --- /dev/null +++ b/pkgs/development/python-modules/github3_py/default.nix @@ -0,0 +1,45 @@ +{ stdenv +, buildPythonPackage +, fetchPypi +, unittest2 +, pytest +, mock +, betamax +, betamax-matchers +, dateutil +, requests +, pyopenssl +, uritemplate_py +, ndg-httpsclient +, requests_toolbelt +, pyasn1 +}: + +buildPythonPackage rec { + pname = "github3.py"; + version = "1.1.0"; + + src = fetchPypi { + inherit pname version; + sha256 = "1cxaqdqmz9w2afc0cw2jyv783fp0grydbik0frzj79azzkhyg4gf"; + }; + + buildInputs = [ unittest2 pytest mock betamax betamax-matchers dateutil ]; + propagatedBuildInputs = [ requests pyopenssl uritemplate_py ndg-httpsclient requests_toolbelt pyasn1 ]; + + postPatch = '' + sed -i -e 's/mock ==1.0.1/mock>=1.0.1/' setup.py + sed -i -e 's/unittest2 ==0.5.1/unittest2>=0.5.1/' setup.py + ''; + + # TODO: only disable the tests that require network + doCheck = false; + + meta = with stdenv.lib; { + homepage = http://github3py.readthedocs.org/en/master/; + description = "A wrapper for the GitHub API written in python"; + license = licenses.bsd3; + maintainers = with maintainers; [ pSub ]; + }; + +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 86ebe743895..9362aefe675 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -2386,35 +2386,7 @@ in { glances = callPackage ../development/python-modules/glances { }; - github3_py = buildPythonPackage rec { - name = "github3.py-${version}"; - version = "1.1.0"; - - src = pkgs.fetchurl { - url = "mirror://pypi/g/github3.py/${name}.tar.gz"; - sha256 = "1cxaqdqmz9w2afc0cw2jyv783fp0grydbik0frzj79azzkhyg4gf"; - }; - - buildInputs = with self; [ unittest2 pytest mock betamax betamax-matchers dateutil ]; - - propagatedBuildInputs = with self; [ requests pyopenssl uritemplate_py - ndg-httpsclient requests_toolbelt pyasn1 ]; - - postPatch = '' - sed -i -e 's/mock ==1.0.1/mock>=1.0.1/' setup.py - sed -i -e 's/unittest2 ==0.5.1/unittest2>=0.5.1/' setup.py - ''; - - # TODO: only disable the tests that require network - doCheck = false; - - meta = with stdenv.lib; { - homepage = http://github3py.readthedocs.org/en/master/; - description = "A wrapper for the GitHub API written in python"; - license = licenses.bsd3; - maintainers = with maintainers; [ pSub ]; - }; - }; + github3_py = callPackage ../development/python-modules/github3_py { }; github-webhook = buildPythonPackage rec { name = "github-webhook-${version}";