nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 appdirs,
4 apsw,
5 buildPythonPackage,
6 cvss,
7 fetchFromGitHub,
8 httpx,
9 msgpack,
10 oras,
11 orjson,
12 packageurl-python,
13 pydantic,
14 pytest-cov-stub,
15 pytestCheckHook,
16 pyyaml,
17 rich,
18 semver,
19 setuptools,
20 tabulate,
21 writableTmpDirAsHomeHook,
22}:
23
24buildPythonPackage (finalAttrs: {
25 pname = "appthreat-vulnerability-db";
26 version = "6.6.0";
27 pyproject = true;
28
29 src = fetchFromGitHub {
30 owner = "AppThreat";
31 repo = "vulnerability-db";
32 tag = "v${finalAttrs.version}";
33 hash = "sha256-/tcfHEvTdk0B/vfcqqkTn9kGT3QIPLWW4l01fjnrhqE=";
34 };
35
36 pythonRelaxDeps = [
37 "msgpack"
38 "semver"
39 ];
40
41 build-system = [ setuptools ];
42
43 dependencies = [
44 appdirs
45 apsw
46 cvss
47 httpx
48 msgpack
49 orjson
50 packageurl-python
51 pydantic
52 rich
53 semver
54 tabulate
55 ]
56 ++ httpx.optional-dependencies.http2
57 ++ pydantic.optional-dependencies.email;
58
59 optional-dependencies = {
60 all = [
61 oras
62 pyyaml
63 ];
64 custom = [ pyyaml ];
65 oras = [ oras ];
66 };
67
68 nativeCheckInputs = [
69 pytest-cov-stub
70 pytestCheckHook
71 writableTmpDirAsHomeHook
72 ]
73 ++ lib.flatten (builtins.attrValues finalAttrs.passthru.optional-dependencies);
74
75 disabledTests = [
76 # Tests require network access
77 "test_bulk_search"
78 "test_download_recent"
79 "test_parse_purl"
80 ];
81
82 pythonImportsCheck = [ "vdb" ];
83
84 meta = {
85 description = "Vulnerability database and package search for sources such as OSV, NVD, GitHub and npm";
86 homepage = "https://github.com/appthreat/vulnerability-db";
87 changelog = "https://github.com/AppThreat/vulnerability-db/releases/tag/${finalAttrs.src.tag}";
88 license = lib.licenses.mit;
89 maintainers = with lib.maintainers; [ fab ];
90 mainProgram = "vdb";
91 };
92})