evcc: 0.131.4 -> 0.131.5
[NixPkgs.git] / pkgs / development / python-modules / netmap / default.nix
blobc863ae189dcb8d7ad33a0d1ffc3f035efcf5aabc
2   lib,
3   buildPythonPackage,
4   fetchFromGitHub,
5   substituteAll,
6   nmap,
7   python,
8 }:
10 buildPythonPackage rec {
11   pname = "netmap";
12   version = "0.7.0.2";
13   format = "setuptools";
15   src = fetchFromGitHub {
16     owner = "home-assistant-libs";
17     repo = "python-nmap";
18     rev = version;
19     sha256 = "1a44zz9zsxy48ahlpjjrddpyfi7cnfknicfcp35hi588qm430mag";
20   };
22   patches = [
23     (substituteAll {
24       src = ./nmap-path.patch;
25       nmap = "${lib.getBin nmap}/bin/nmap";
26     })
27   ];
29   # upstream tests require sudo
30   # make sure nmap is found instead
31   checkPhase = ''
32     runHook preCheck
33     ${python.interpreter} -c 'import nmap; nmap.PortScanner()'
34     runHook postCheck
35   '';
37   pythonImportsCheck = [ "nmap" ];
39   meta = with lib; {
40     description = "Python class to use nmap and access scan results from python3";
41     homepage = "https://github.com/home-assistant-libs/python-nmap";
42     license = licenses.gpl3Plus;
43     maintainers = with maintainers; [ dotlambda ];
44   };