2022-05-18 14:49:53 +00:00
|
|
|
{ lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, python3
|
|
|
|
}:
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
python3.pkgs.buildPythonApplication rec {
|
2022-05-18 14:49:53 +00:00
|
|
|
pname = "pip-audit";
|
2024-01-13 08:15:51 +00:00
|
|
|
version = "2.6.3";
|
2022-06-16 17:23:12 +00:00
|
|
|
format = "pyproject";
|
2022-05-18 14:49:53 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "trailofbits";
|
|
|
|
repo = pname;
|
2022-11-27 09:42:12 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2024-01-13 08:15:51 +00:00
|
|
|
hash = "sha256-Vr65sKEb/ykrLcB8MLyr9qCUDWCccoWMkWZWeM54saw=";
|
2022-05-18 14:49:53 +00:00
|
|
|
};
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
nativeBuildInputs = with python3.pkgs; [
|
2022-06-16 17:23:12 +00:00
|
|
|
flit-core
|
|
|
|
];
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
propagatedBuildInputs = with python3.pkgs; [
|
2022-05-18 14:49:53 +00:00
|
|
|
cachecontrol
|
|
|
|
cyclonedx-python-lib
|
|
|
|
html5lib
|
|
|
|
packaging
|
|
|
|
pip-api
|
2022-08-12 12:06:08 +00:00
|
|
|
pip-requirements-parser
|
2022-06-16 17:23:12 +00:00
|
|
|
rich
|
2023-04-12 12:48:02 +00:00
|
|
|
toml
|
|
|
|
] ++ cachecontrol.optional-dependencies.filecache;
|
2022-05-18 14:49:53 +00:00
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
nativeCheckInputs = with python3.pkgs; [
|
2022-05-18 14:49:53 +00:00
|
|
|
pretend
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"pip_audit"
|
|
|
|
];
|
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
export HOME=$(mktemp -d);
|
|
|
|
'';
|
|
|
|
|
|
|
|
disabledTestPaths = [
|
|
|
|
# Tests require network access
|
|
|
|
"test/dependency_source/test_requirement.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";
|
2022-11-27 09:42:12 +00:00
|
|
|
changelog = "https://github.com/pypa/pip-audit/releases/tag/v${version}";
|
2022-05-18 14:49:53 +00:00
|
|
|
license = with licenses; [ asl20 ];
|
|
|
|
maintainers = with maintainers; [ fab ];
|
|
|
|
};
|
|
|
|
}
|