1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 jsonschema,
6 unittestCheckHook,
7 pythonOlder,
8 setuptools,
9}:
10
11buildPythonPackage rec {
12 pname = "cvss";
13 version = "3.6";
14 pyproject = true;
15
16 disabled = pythonOlder "3.7";
17
18 src = fetchFromGitHub {
19 owner = "RedHatProductSecurity";
20 repo = "cvss";
21 tag = "v${version}";
22 hash = "sha256-udUs76wfvC9LfjlKyWmuPV0RT2P/COTwYw3hgDt3tPs=";
23 };
24
25 build-system = [ setuptools ];
26
27 nativeCheckInputs = [
28 jsonschema
29 unittestCheckHook
30 ];
31
32 pythonImportsCheck = [ "cvss" ];
33
34 preCheck = ''
35 cd tests
36 '';
37
38 meta = with lib; {
39 description = "Library for CVSS2/3/4";
40 homepage = "https://github.com/RedHatProductSecurity/cvss";
41 changelog = "https://github.com/RedHatProductSecurity/cvss/releases/tag/${src.tag}";
42 license = licenses.lgpl3Plus;
43 maintainers = with maintainers; [ fab ];
44 mainProgram = "cvss_calculator";
45 };
46}