about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/aiodiscover/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/python-modules/aiodiscover/default.nix')
-rw-r--r--nixpkgs/pkgs/development/python-modules/aiodiscover/default.nix43
1 files changed, 43 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/python-modules/aiodiscover/default.nix b/nixpkgs/pkgs/development/python-modules/aiodiscover/default.nix
new file mode 100644
index 000000000000..e724d53bfe75
--- /dev/null
+++ b/nixpkgs/pkgs/development/python-modules/aiodiscover/default.nix
@@ -0,0 +1,43 @@
+{ lib
+, async-dns
+, buildPythonPackage
+, fetchFromGitHub
+, fetchpatch
+, ifaddr
+, pyroute2
+, pythonOlder
+}:
+
+buildPythonPackage rec {
+  pname = "aiodiscover";
+  version = "1.3.3";
+  disabled = pythonOlder "3.7";
+
+  src = fetchFromGitHub {
+    owner = "bdraco";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "186agrjx818vn00d3pqlka5ir48rgpbfyn1cifkn9ylsxg9cz3ph";
+  };
+
+  propagatedBuildInputs = [
+    async-dns
+    pyroute2
+    ifaddr
+  ];
+
+  postPatch = ''
+    substituteInPlace setup.py --replace '"pytest-runner>=5.2",' ""
+  '';
+
+  # Tests require access to /etc/resolv.conf
+  # pythonImportsCheck doesn't work as async-dns wants to create its CONFIG_DIR
+  doCheck = false;
+
+  meta = with lib; {
+    description = "Python module to discover hosts via ARP and PTR lookup";
+    homepage = "https://github.com/bdraco/aiodiscover";
+    license = with licenses; [ asl20 ];
+    maintainers = with maintainers; [ fab ];
+  };
+}