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