From 667782f8f13b7f3e3c29a7e8cab84cfcc8c5e6f6 Mon Sep 17 00:00:00 2001 From: Chris Ostrouchov Date: Wed, 17 Oct 2018 00:52:48 -0400 Subject: [PATCH] pythonPackages.netaddr: refactor move to python-modules --- .../python-modules/netaddr/default.nix | 37 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 30 +-------------- 2 files changed, 38 insertions(+), 29 deletions(-) create mode 100644 pkgs/development/python-modules/netaddr/default.nix diff --git a/pkgs/development/python-modules/netaddr/default.nix b/pkgs/development/python-modules/netaddr/default.nix new file mode 100644 index 000000000000..eed3d758054b --- /dev/null +++ b/pkgs/development/python-modules/netaddr/default.nix @@ -0,0 +1,37 @@ +{ stdenv +, buildPythonPackage +, fetchPypi +, pytest +, pkgs +}: + +buildPythonPackage rec { + pname = "netaddr"; + version = "0.7.19"; + + src = fetchPypi { + inherit pname version; + sha256 = "38aeec7cdd035081d3a4c306394b19d677623bf76fa0913f6695127c7753aefd"; + }; + + LC_ALL = "en_US.UTF-8"; + buildInputs = [ pkgs.glibcLocales pytest ]; + + checkPhase = '' + py.test netaddr/tests + ''; + + patches = [ + (pkgs.fetchpatch { + url = https://github.com/drkjam/netaddr/commit/2ab73f10be7069c9412e853d2d0caf29bd624012.patch; + sha256 = "0s1cdn9v5alpviabhcjmzc0m2pnpq9dh2fnnk2x96dnry1pshg39"; + }) + ]; + + meta = with stdenv.lib; { + homepage = https://github.com/drkjam/netaddr/; + description = "A network address manipulation library for Python"; + license = licenses.mit; + }; + +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 9cba5f5a9d22..a315b01c4190 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -2953,35 +2953,7 @@ in { slixmpp = callPackage ../development/python-modules/slixmpp { }; - netaddr = buildPythonPackage rec { - pname = "netaddr"; - version = "0.7.19"; - name = "${pname}-${version}"; - - src = fetchPypi { - inherit pname version; - sha256 = "38aeec7cdd035081d3a4c306394b19d677623bf76fa0913f6695127c7753aefd"; - }; - - LC_ALL = "en_US.UTF-8"; - buildInputs = with self; [ pkgs.glibcLocales pytest ]; - - checkPhase = '' - py.test netaddr/tests - ''; - - patches = [ - (pkgs.fetchpatch { - url = https://github.com/drkjam/netaddr/commit/2ab73f10be7069c9412e853d2d0caf29bd624012.patch; - sha256 = "0s1cdn9v5alpviabhcjmzc0m2pnpq9dh2fnnk2x96dnry1pshg39"; - }) - ]; - - meta = { - homepage = https://github.com/drkjam/netaddr/; - description = "A network address manipulation library for Python"; - }; - }; + netaddr = callPackage ../development/python-modules/netaddr { }; netifaces = buildPythonPackage rec { version = "0.10.6";