2022-02-10 20:34:41 +00:00
|
|
|
{ lib
|
2022-11-27 09:42:12 +00:00
|
|
|
, appdirs
|
2022-02-10 20:34:41 +00:00
|
|
|
, buildPythonPackage
|
2022-11-27 09:42:12 +00:00
|
|
|
, cvss
|
2022-02-10 20:34:41 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, msgpack
|
|
|
|
, orjson
|
|
|
|
, packageurl-python
|
|
|
|
, pytestCheckHook
|
2022-11-27 09:42:12 +00:00
|
|
|
, pythonOlder
|
|
|
|
, requests
|
|
|
|
, semver
|
|
|
|
, tabulate
|
2022-02-10 20:34:41 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "appthreat-vulnerability-db";
|
2022-12-17 10:02:37 +00:00
|
|
|
version = "4.1.12";
|
2022-02-10 20:34:41 +00:00
|
|
|
format = "setuptools";
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "AppThreat";
|
|
|
|
repo = "vulnerability-db";
|
2022-04-15 01:41:22 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2022-12-17 10:02:37 +00:00
|
|
|
hash = "sha256-DHjB8hT9rP1yyeo9I5D8JGIXq+17RYX+e6H7BBuWTw4=";
|
2022-02-10 20:34:41 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
appdirs
|
2022-11-27 09:42:12 +00:00
|
|
|
cvss
|
2022-02-10 20:34:41 +00:00
|
|
|
msgpack
|
|
|
|
orjson
|
|
|
|
packageurl-python
|
2022-11-27 09:42:12 +00:00
|
|
|
requests
|
|
|
|
semver
|
|
|
|
tabulate
|
2022-02-10 20:34:41 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
checkInputs = [
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace pytest.ini \
|
|
|
|
--replace " --cov-append --cov-report term --cov vdb" ""
|
|
|
|
'';
|
|
|
|
|
|
|
|
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";
|
2022-11-27 09:42:12 +00:00
|
|
|
changelog = "https://github.com/AppThreat/vulnerability-db/releases/tag/v${version}";
|
2022-02-10 20:34:41 +00:00
|
|
|
license = with licenses; [ mit ];
|
|
|
|
maintainers = with maintainers; [ fab ];
|
|
|
|
};
|
|
|
|
}
|