2022-05-18 14:49:53 +00:00
|
|
|
{ lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, python3
|
|
|
|
}:
|
|
|
|
let
|
|
|
|
py = python3.override {
|
|
|
|
packageOverrides = self: super: {
|
|
|
|
|
2023-04-12 12:48:02 +00:00
|
|
|
cyclonedx-python-lib = super.cyclonedx-python-lib.overridePythonAttrs (oldAttrs: rec {
|
|
|
|
version = "2.7.1";
|
2022-05-18 14:49:53 +00:00
|
|
|
src = fetchFromGitHub {
|
2023-04-12 12:48:02 +00:00
|
|
|
owner = "CycloneDX";
|
|
|
|
repo = "cyclonedx-python-lib";
|
|
|
|
rev = "v${version}";
|
|
|
|
hash = "sha256-c/KhoJOa121/h0n0GUazjUFChnUo05ThD+fuZXc5/Pk=";
|
2022-05-18 14:49:53 +00:00
|
|
|
};
|
|
|
|
});
|
|
|
|
};
|
|
|
|
};
|
|
|
|
in
|
|
|
|
with py.pkgs;
|
|
|
|
|
|
|
|
buildPythonApplication rec {
|
|
|
|
pname = "pip-audit";
|
2023-04-12 12:48:02 +00:00
|
|
|
version = "2.5.4";
|
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}";
|
2023-04-12 12:48:02 +00:00
|
|
|
hash = "sha256-aByzVPQADTNz5rVzmkNH/zk4u+RkWPcfk0sQhR3K2cQ=";
|
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
|
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-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
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 ];
|
|
|
|
};
|
|
|
|
}
|