2022-05-18 14:49:53 +00:00
|
|
|
{ lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, fetchpatch
|
|
|
|
, python3
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
py = python3.override {
|
|
|
|
packageOverrides = self: super: {
|
|
|
|
|
|
|
|
# ansible doesn't support resolvelib > 0.6.0 and can't have an override
|
|
|
|
resolvelib = super.resolvelib.overridePythonAttrs (oldAttrs: rec {
|
|
|
|
version = "0.8.1";
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "sarugaku";
|
|
|
|
repo = "resolvelib";
|
|
|
|
rev = version;
|
|
|
|
sha256 = "1qpd0gg9yl0kbamlgjs9pkxd39kx511kbc92civ77v0ka5sw8ca0";
|
|
|
|
};
|
|
|
|
});
|
|
|
|
};
|
|
|
|
};
|
|
|
|
in
|
|
|
|
with py.pkgs;
|
|
|
|
|
|
|
|
buildPythonApplication rec {
|
|
|
|
pname = "pip-audit";
|
2022-06-16 17:23:12 +00:00
|
|
|
version = "2.3.2";
|
|
|
|
format = "pyproject";
|
2022-05-18 14:49:53 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "trailofbits";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2022-06-16 17:23:12 +00:00
|
|
|
hash = "sha256-BcbTu4vDA7ry87gQXpFk3MvH0eFNNgOBf1SlxNUFDbw=";
|
2022-05-18 14:49:53 +00:00
|
|
|
};
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
flit-core
|
|
|
|
];
|
|
|
|
|
2022-05-18 14:49:53 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
cachecontrol
|
|
|
|
cyclonedx-python-lib
|
|
|
|
html5lib
|
|
|
|
packaging
|
|
|
|
pip-api
|
|
|
|
progress
|
|
|
|
resolvelib
|
2022-06-16 17:23:12 +00:00
|
|
|
rich
|
2022-05-18 14:49:53 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
checkInputs = [
|
|
|
|
pretend
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"pip_audit"
|
|
|
|
];
|
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
export HOME=$(mktemp -d);
|
|
|
|
'';
|
|
|
|
|
|
|
|
disabledTestPaths = [
|
|
|
|
# Tests require network access
|
|
|
|
"test/dependency_source/test_requirement.py"
|
|
|
|
"test/dependency_source/test_resolvelib.py"
|
|
|
|
"test/service/test_pypi.py"
|
|
|
|
"test/service/test_osv.py"
|
|
|
|
];
|
|
|
|
|
|
|
|
disabledTests = [
|
|
|
|
# Tests requrire network access
|
|
|
|
"test_get_pip_cache"
|
|
|
|
"test_virtual_env"
|
|
|
|
"test_pyproject_source"
|
|
|
|
"test_pyproject_source_duplicate_deps"
|
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Tool for scanning Python environments for known vulnerabilities";
|
|
|
|
homepage = "https://github.com/trailofbits/pip-audit";
|
|
|
|
license = with licenses; [ asl20 ];
|
|
|
|
maintainers = with maintainers; [ fab ];
|
|
|
|
};
|
|
|
|
}
|