1{ lib
2, buildPythonPackage
3, ddt
4, fetchFromGitHub
5, importlib-metadata
6, jsonschema
7, lxml
8, packageurl-python
9, poetry-core
10, pytestCheckHook
11, python
12, pythonOlder
13, requirements-parser
14, sortedcontainers
15, setuptools
16, toml
17, types-setuptools
18, types-toml
19, xmldiff
20}:
21
22buildPythonPackage rec {
23 pname = "cyclonedx-python-lib";
24 version = "3.1.0";
25 format = "pyproject";
26
27 disabled = pythonOlder "3.9";
28
29 src = fetchFromGitHub {
30 owner = "CycloneDX";
31 repo = pname;
32 rev = "refs/tags/v${version}";
33 hash = "sha256-pbwhjxlEdne426CiUORSM8w6MXpgpjMWoH37TnXxA5s=";
34 };
35
36 nativeBuildInputs = [
37 poetry-core
38 ];
39
40 propagatedBuildInputs = [
41 importlib-metadata
42 packageurl-python
43 requirements-parser
44 setuptools
45 sortedcontainers
46 toml
47 types-setuptools
48 types-toml
49 ];
50
51 checkInputs = [
52 ddt
53 jsonschema
54 lxml
55 pytestCheckHook
56 xmldiff
57 ];
58
59 pythonImportsCheck = [
60 "cyclonedx"
61 ];
62
63 preCheck = ''
64 export PYTHONPATH=tests''${PYTHONPATH+:$PYTHONPATH}
65 '';
66
67 pytestFlagsArray = [ "tests/" ];
68
69 disabledTests = [
70 # These tests require network access.
71 "test_bom_v1_3_with_metadata_component"
72 "test_bom_v1_4_with_metadata_component"
73 ];
74
75 meta = with lib; {
76 description = "Python library for generating CycloneDX SBOMs";
77 homepage = "https://github.com/CycloneDX/cyclonedx-python-lib";
78 license = with licenses; [ asl20 ];
79 maintainers = with maintainers; [ fab ];
80 };
81}