From 2854322cb8891a9d9844f464c9d48b9ac8c8683d Mon Sep 17 00:00:00 2001 From: Chris Ostrouchov Date: Thu, 25 Oct 2018 10:48:10 -0400 Subject: [PATCH] pythonPackages.ifaddr: init at 0.1.4 --- .../python-modules/ifaddr/default.nix | 36 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 ++ 2 files changed, 38 insertions(+) create mode 100644 pkgs/development/python-modules/ifaddr/default.nix diff --git a/pkgs/development/python-modules/ifaddr/default.nix b/pkgs/development/python-modules/ifaddr/default.nix new file mode 100644 index 00000000000..db0b8301f00 --- /dev/null +++ b/pkgs/development/python-modules/ifaddr/default.nix @@ -0,0 +1,36 @@ +{ stdenv +, buildPythonPackage +, fetchPypi +, ipaddress +, python +, pythonOlder +}: + +buildPythonPackage rec { + version = "0.1.4"; + pname = "ifaddr"; + + src = fetchPypi { + inherit pname version; + extension = "zip"; + sha256 = "cf2a8fbb578da2844d999a0a453825f660ed2d3fc47dcffc5f673dd8de4f0f8b"; + }; + + # ipaddress is provided in python stdlib > 3.3 + postPatch = if pythonOlder "3.4" then "" else '' + sed -i "s/'ipaddress'//" setup.py + ''; + + propagatedBuildInputs = [ ipaddress ]; + + checkPhase = '' + ${python.interpreter} ifaddr/test_ifaddr.py + ''; + + meta = with stdenv.lib; { + homepage = https://github.com/pydron/ifaddr; + description = "Enumerates all IP addresses on all network adapters of the system"; + license = licenses.mit; + maintainers = [ maintainers.costrouc ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 6c5870b529c..dbabd011aa3 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -2462,6 +2462,8 @@ in { icalendar = callPackage ../development/python-modules/icalendar { }; + ifaddr = callPackage ../development/python-modules/ifaddr { }; + imageio = callPackage ../development/python-modules/imageio { }; imgaug = callPackage ../development/python-modules/imgaug { };