biome: 1.9.2 -> 1.9.3 (#349335)
[NixPkgs.git] / pkgs / development / python-modules / cyclonedx-python-lib / default.nix
blobd6b6b5c6084316efdf1fa23cebf17544006657ae
2   lib,
3   buildPythonPackage,
4   ddt,
5   fetchFromGitHub,
6   importlib-metadata,
7   jsonschema,
8   license-expression,
9   lxml,
10   packageurl-python,
11   py-serializable,
12   poetry-core,
13   pytestCheckHook,
14   pythonOlder,
15   requirements-parser,
16   sortedcontainers,
17   setuptools,
18   toml,
19   types-setuptools,
20   types-toml,
21   xmldiff,
24 buildPythonPackage rec {
25   pname = "cyclonedx-python-lib";
26   version = "7.6.2";
27   pyproject = true;
29   disabled = pythonOlder "3.9";
31   src = fetchFromGitHub {
32     owner = "CycloneDX";
33     repo = "cyclonedx-python-lib";
34     rev = "refs/tags/v${version}";
35     hash = "sha256-nklizCiu7Nmynjd5WU5oX/v2TWy9xFVF4GkmCwFKZLI=";
36   };
38   pythonRelaxDeps = [ "py-serializable" ];
40   build-system = [ poetry-core ];
42   dependencies = [
43     importlib-metadata
44     license-expression
45     packageurl-python
46     requirements-parser
47     setuptools
48     sortedcontainers
49     toml
50     py-serializable
51     types-setuptools
52     types-toml
53   ];
55   optional-dependencies = {
56     validation = [
57       jsonschema
58       lxml
59     ];
60     json-validation = [
61       jsonschema
62     ];
63     xml-validation = [
64       lxml
65     ];
66   };
68   nativeCheckInputs = [
69     ddt
70     pytestCheckHook
71     xmldiff
72   ] ++ lib.flatten (builtins.attrValues optional-dependencies);
74   pythonImportsCheck = [ "cyclonedx" ];
76   preCheck = ''
77     export PYTHONPATH=tests''${PYTHONPATH+:$PYTHONPATH}
78   '';
80   pytestFlagsArray = [ "tests/" ];
82   disabledTests = [
83     # These tests require network access
84     "test_bom_v1_3_with_metadata_component"
85     "test_bom_v1_4_with_metadata_component"
86     # AssertionError: <ValidationError: "{'algorithm': 'ES256', ...
87     "TestJson"
88   ];
90   disabledTestPaths = [
91     # Test failures seem py-serializable related
92     "tests/test_output_xml.py"
93   ];
95   meta = with lib; {
96     description = "Python library for generating CycloneDX SBOMs";
97     homepage = "https://github.com/CycloneDX/cyclonedx-python-lib";
98     changelog = "https://github.com/CycloneDX/cyclonedx-python-lib/releases/tag/v${version}";
99     license = with licenses; [ asl20 ];
100     maintainers = with maintainers; [ fab ];
101   };