nixpkgs/pkgs/development/tools/pip-audit/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

69 lines
1.5 KiB
Nix
Raw Normal View History

2022-03-28 11:32:04 +00:00
{ lib
, fetchFromGitHub
, python3
}:
python3.pkgs.buildPythonApplication rec {
2022-03-28 11:32:04 +00:00
pname = "pip-audit";
version = "2.6.1";
2022-05-20 09:17:34 +00:00
format = "pyproject";
2022-03-28 11:32:04 +00:00
src = fetchFromGitHub {
owner = "trailofbits";
repo = pname;
2022-11-22 17:53:10 +00:00
rev = "refs/tags/v${version}";
hash = "sha256-bB3yaQweXyj4O2TMHBhyMz5tm2Th0cDqRZ1B9lv+ARk=";
2022-03-28 11:32:04 +00:00
};
nativeBuildInputs = with python3.pkgs; [
2022-05-20 09:17:34 +00:00
flit-core
];
propagatedBuildInputs = with python3.pkgs; [
2022-03-28 11:32:04 +00:00
cachecontrol
cyclonedx-python-lib
html5lib
packaging
pip-api
2022-07-23 16:22:50 +00:00
pip-requirements-parser
2022-06-15 14:20:49 +00:00
rich
toml
] ++ cachecontrol.optional-dependencies.filecache;
2022-03-28 11:32:04 +00:00
nativeCheckInputs = with python3.pkgs; [
2022-03-28 11:32:04 +00:00
pretend
pytestCheckHook
];
pythonImportsCheck = [
"pip_audit"
];
2022-05-03 06:04:50 +00:00
preCheck = ''
export HOME=$(mktemp -d);
'';
2022-03-28 11:32:04 +00:00
disabledTestPaths = [
2022-05-03 06:04:50 +00:00
# Tests require network access
2022-03-28 11:32:04 +00:00
"test/dependency_source/test_requirement.py"
"test/service/test_pypi.py"
"test/service/test_osv.py"
];
disabledTests = [
2022-05-03 06:04:50 +00:00
# Tests requrire network access
2022-03-28 11:32:04 +00:00
"test_get_pip_cache"
"test_virtual_env"
2022-05-03 06:04:50 +00:00
"test_pyproject_source"
"test_pyproject_source_duplicate_deps"
2022-03-28 11:32:04 +00:00
];
meta = with lib; {
description = "Tool for scanning Python environments for known vulnerabilities";
homepage = "https://github.com/trailofbits/pip-audit";
2022-11-22 17:53:10 +00:00
changelog = "https://github.com/pypa/pip-audit/releases/tag/v${version}";
2022-03-28 11:32:04 +00:00
license = with licenses; [ asl20 ];
maintainers = with maintainers; [ fab ];
};
}