504525a148
GitOrigin-RevId: bd645e8668ec6612439a9ee7e71f7eac4099d4f6
82 lines
1.5 KiB
Nix
82 lines
1.5 KiB
Nix
{ lib
|
|
, appdirs
|
|
, buildPythonPackage
|
|
, cvss
|
|
, fetchFromGitHub
|
|
, httpx
|
|
, msgpack
|
|
, orjson
|
|
, packageurl-python
|
|
, pytestCheckHook
|
|
, pythonOlder
|
|
, pythonRelaxDepsHook
|
|
, semver
|
|
, setuptools
|
|
, tabulate
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "appthreat-vulnerability-db";
|
|
version = "5.5.7";
|
|
pyproject = true;
|
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "AppThreat";
|
|
repo = "vulnerability-db";
|
|
rev = "refs/tags/v${version}";
|
|
hash = "sha256-qDloyoc6FpfWVo0+rbnvSQ0nxAKjKXcC+ZNZr2vkMEE=";
|
|
};
|
|
|
|
postPatch = ''
|
|
substituteInPlace pytest.ini \
|
|
--replace " --cov-append --cov-report term --cov vdb" ""
|
|
'';
|
|
|
|
pythonRelaxDeps = [
|
|
"semver"
|
|
];
|
|
|
|
nativeBuildInputs = [
|
|
pythonRelaxDepsHook
|
|
setuptools
|
|
];
|
|
|
|
propagatedBuildInputs = [
|
|
appdirs
|
|
cvss
|
|
httpx
|
|
msgpack
|
|
orjson
|
|
packageurl-python
|
|
semver
|
|
tabulate
|
|
] ++ httpx.optional-dependencies.http2;
|
|
|
|
nativeCheckInputs = [
|
|
pytestCheckHook
|
|
];
|
|
|
|
preCheck = ''
|
|
export HOME=$(mktemp -d);
|
|
'';
|
|
|
|
disabledTests = [
|
|
# Tests require network access
|
|
"test_bulk_search"
|
|
"test_download_recent"
|
|
];
|
|
|
|
pythonImportsCheck = [
|
|
"vdb"
|
|
];
|
|
|
|
meta = with lib; {
|
|
description = "Vulnerability database and package search for sources such as OSV, NVD, GitHub and npm";
|
|
homepage = "https://github.com/appthreat/vulnerability-db";
|
|
changelog = "https://github.com/AppThreat/vulnerability-db/releases/tag/v${version}";
|
|
license = with licenses; [ mit ];
|
|
maintainers = with maintainers; [ fab ];
|
|
};
|
|
}
|