1{ 2 lib, 3 appdirs, 4 buildPythonPackage, 5 cvss, 6 fetchFromGitHub, 7 httpx, 8 msgpack, 9 orjson, 10 packageurl-python, 11 pytestCheckHook, 12 pythonOlder, 13 pythonRelaxDepsHook, 14 semver, 15 setuptools, 16 tabulate, 17}: 18 19buildPythonPackage rec { 20 pname = "appthreat-vulnerability-db"; 21 version = "5.6.7"; 22 pyproject = true; 23 24 disabled = pythonOlder "3.10"; 25 26 src = fetchFromGitHub { 27 owner = "AppThreat"; 28 repo = "vulnerability-db"; 29 rev = "refs/tags/v${version}"; 30 hash = "sha256-/QzK+su+g2ESZ81C0coxKf13WOUVz1GyfJbOrO7fS98="; 31 }; 32 33 postPatch = '' 34 substituteInPlace pyproject.toml \ 35 --replace-fail " --cov-report=term-missing --no-cov-on-fail --cov vdb" "" 36 ''; 37 38 pythonRelaxDeps = [ 39 "msgpack" 40 "semver" 41 ]; 42 43 build-system = [ setuptools ]; 44 45 nativeBuildInputs = [ pythonRelaxDepsHook ]; 46 47 dependencies = [ 48 appdirs 49 cvss 50 httpx 51 msgpack 52 orjson 53 packageurl-python 54 semver 55 tabulate 56 ] ++ httpx.optional-dependencies.http2; 57 58 nativeCheckInputs = [ pytestCheckHook ]; 59 60 preCheck = '' 61 export HOME=$(mktemp -d); 62 ''; 63 64 disabledTests = [ 65 # Tests require network access 66 "test_bulk_search" 67 "test_download_recent" 68 ]; 69 70 pythonImportsCheck = [ "vdb" ]; 71 72 meta = with lib; { 73 description = "Vulnerability database and package search for sources such as OSV, NVD, GitHub and npm"; 74 homepage = "https://github.com/appthreat/vulnerability-db"; 75 changelog = "https://github.com/AppThreat/vulnerability-db/releases/tag/v${version}"; 76 license = with licenses; [ mit ]; 77 maintainers = with maintainers; [ fab ]; 78 mainProgram = "vdb"; 79 }; 80}