1{
2 lib,
3 buildPythonPackage,
4 click,
5 cve,
6 fetchFromGitHub,
7 jsonschema,
8 pytestCheckHook,
9 pythonOlder,
10 requests,
11 setuptools,
12 testers,
13}:
14
15buildPythonPackage rec {
16 pname = "cvelib";
17 version = "1.7.1";
18 pyproject = true;
19
20 disabled = pythonOlder "3.7";
21
22 src = fetchFromGitHub {
23 owner = "RedHatProductSecurity";
24 repo = "cvelib";
25 tag = version;
26 hash = "sha256-AhA+2lEI/hsbIVCfSWO0vI6eWkObjsq5xYOSqVvUPkU=";
27 };
28
29 postPatch = ''
30 # collective.checkdocs is unmaintained for over 10 years
31 substituteInPlace pyproject.toml \
32 --replace-fail '"collective.checkdocs",' ""
33 '';
34
35 build-system = [ setuptools ];
36
37 dependencies = [
38 click
39 jsonschema
40 requests
41 ];
42
43 nativeCheckInputs = [ pytestCheckHook ];
44
45 pythonImportsCheck = [ "cvelib" ];
46
47 passthru.tests.version = testers.testVersion { package = cve; };
48
49 meta = with lib; {
50 description = "Library and a command line interface for the CVE Services API";
51 homepage = "https://github.com/RedHatProductSecurity/cvelib";
52 changelog = "https://github.com/RedHatProductSecurity/cvelib/blob/${version}/CHANGELOG.md";
53 license = licenses.mit;
54 maintainers = with maintainers; [ raboof ];
55 mainProgram = "cve";
56 };
57}