Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
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.1";
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-DajXu8aZAZyr7o0fGH9do9i/z+UqMMkcMXjbETtWa1g=";
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 = [
68 "tests/"
69 ];
70
71 disabledTests = [
72 # These tests require network access.
73 "test_bom_v1_3_with_metadata_component"
74 "test_bom_v1_4_with_metadata_component"
75 ];
76
77 meta = with lib; {
78 description = "Python library for generating CycloneDX SBOMs";
79 homepage = "https://github.com/CycloneDX/cyclonedx-python-lib";
80 changelog = "https://github.com/CycloneDX/cyclonedx-python-lib/releases/tag/v${version}";
81 license = with licenses; [ asl20 ];
82 maintainers = with maintainers; [ fab ];
83 };
84}