Files
nixpkgs/pkgs/development/python-modules/netmap/default.nix
Ihar Hrachyshka 567e8dfd8e treewide: clean up 'meta = with' pattern
This commit was created by a combination of scripts and tools:
- an ast-grep script to prefix things in meta with `lib.`,
- a modified nixf-diagnose / nixf combination to remove unused `with
lib;`, and
- regular nixfmt.

Co-authored-by: Wolfgang Walther <walther@technowledgy.de>
2025-12-10 18:09:49 +01:00

45 lines
967 B
Nix

{
lib,
buildPythonPackage,
fetchFromGitHub,
replaceVars,
nmap,
python,
}:
buildPythonPackage rec {
pname = "netmap";
version = "0.7.0.2";
format = "setuptools";
src = fetchFromGitHub {
owner = "home-assistant-libs";
repo = "python-nmap";
rev = version;
sha256 = "1a44zz9zsxy48ahlpjjrddpyfi7cnfknicfcp35hi588qm430mag";
};
patches = [
(replaceVars ./nmap-path.patch {
nmap = "${lib.getBin nmap}/bin/nmap";
})
];
# upstream tests require sudo
# make sure nmap is found instead
checkPhase = ''
runHook preCheck
${python.interpreter} -c 'import nmap; nmap.PortScanner()'
runHook postCheck
'';
pythonImportsCheck = [ "nmap" ];
meta = {
description = "Python class to use nmap and access scan results from python3";
homepage = "https://github.com/home-assistant-libs/python-nmap";
license = lib.licenses.gpl3Plus;
maintainers = with lib.maintainers; [ dotlambda ];
};
}