If a Python package does not come with either `format` or `pyproject` we consider it a setuptools build, that calls `setup.py` directly, which is deprecated. This change, as a first step, migrates a large chunk of these packages to set setuptools as their explicit format This is so we can unify the problem space for the next step of the migration.
65 lines
1.2 KiB
Nix
65 lines
1.2 KiB
Nix
{
|
|
lib,
|
|
fetchFromGitHub,
|
|
python3,
|
|
}:
|
|
|
|
python3.pkgs.buildPythonApplication rec {
|
|
pname = "kube-hunter";
|
|
version = "0.6.8";
|
|
format = "setuptools";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "aquasecurity";
|
|
repo = "kube-hunter";
|
|
tag = "v${version}";
|
|
sha256 = "sha256-+M8P/VSF9SKPvq+yNPjokyhggY7hzQ9qLLhkiTNbJls=";
|
|
};
|
|
|
|
nativeBuildInputs = with python3.pkgs; [
|
|
setuptools-scm
|
|
];
|
|
|
|
propagatedBuildInputs = with python3.pkgs; [
|
|
netaddr
|
|
netifaces
|
|
requests
|
|
prettytable
|
|
urllib3
|
|
ruamel-yaml
|
|
future
|
|
packaging
|
|
pluggy
|
|
kubernetes
|
|
];
|
|
|
|
nativeCheckInputs = with python3.pkgs; [
|
|
pytest-cov-stub
|
|
pytestCheckHook
|
|
requests-mock
|
|
];
|
|
|
|
postPatch = ''
|
|
substituteInPlace setup.cfg \
|
|
--replace "dataclasses" "" \
|
|
--replace "kubernetes==12.0.1" "kubernetes"
|
|
'';
|
|
|
|
pythonImportsCheck = [
|
|
"kube_hunter"
|
|
];
|
|
|
|
disabledTests = [
|
|
# Test is out-dated
|
|
"test_K8sCveHunter"
|
|
];
|
|
|
|
meta = with lib; {
|
|
description = "Tool to search issues in Kubernetes clusters";
|
|
homepage = "https://github.com/aquasecurity/kube-hunter";
|
|
license = with licenses; [ asl20 ];
|
|
maintainers = with maintainers; [ fab ];
|
|
mainProgram = "kube-hunter";
|
|
};
|
|
}
|