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
|
2022-12-28 21:21:41 +00:00
|
|
|
, httpx
|
2022-02-10 20:34:41 +00:00
|
|
|
, msgpack
|
|
|
|
, orjson
|
|
|
|
, packageurl-python
|
|
|
|
, pytestCheckHook
|
2022-11-27 09:42:12 +00:00
|
|
|
, pythonOlder
|
|
|
|
, semver
|
|
|
|
, tabulate
|
2022-02-10 20:34:41 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "appthreat-vulnerability-db";
|
2022-12-28 21:21:41 +00:00
|
|
|
version = "4.3.0";
|
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-28 21:21:41 +00:00
|
|
|
hash = "sha256-1WBaNTARe0ULWHf0g/6Jljo1yCffnJAS9ycbhGqzOUk=";
|
2022-02-10 20:34:41 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
appdirs
|
2022-11-27 09:42:12 +00:00
|
|
|
cvss
|
2022-12-28 21:21:41 +00:00
|
|
|
httpx
|
2022-02-10 20:34:41 +00:00
|
|
|
msgpack
|
|
|
|
orjson
|
|
|
|
packageurl-python
|
2022-11-27 09:42:12 +00:00
|
|
|
semver
|
|
|
|
tabulate
|
2022-12-28 21:21:41 +00:00
|
|
|
] ++ httpx.optional-dependencies.http2;
|
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 ];
|
|
|
|
};
|
|
|
|
}
|