Commit 6bf6e021 authored by Fabian Affolter's avatar Fabian Affolter
Browse files

python312Packages.cyclonedx-python-lib: refactor

parent 52ec9ac3
Loading
Loading
Loading
Loading
+16 −12
Original line number Diff line number Diff line
@@ -35,8 +35,9 @@ buildPythonPackage rec {
    hash = "sha256-yBBtE9DfHzUNXHMCo3KoUAAsvkBshczmVtMCUTtQ9zg=";
  };

  build-system = [ poetry-core ];
  pythonRelaxDeps = [ "py-serializable" ];

  build-system = [ poetry-core ];

  dependencies = [
    importlib-metadata
@@ -51,18 +52,27 @@ buildPythonPackage rec {
    types-toml
  ];

  nativeCheckInputs = [
    ddt
  passthru.optional-dependencies = {
    validation = [
      jsonschema
      lxml
    ];
    json-validation = [
      jsonschema
    ];
    xml-validation = [
      lxml
    ];
  };

  nativeCheckInputs = [
    ddt
    pytestCheckHook
    xmldiff
  ];
  ] ++ lib.flatten (builtins.attrValues passthru.optional-dependencies);

  pythonImportsCheck = [ "cyclonedx" ];

  pythonRelaxDeps = [ "py-serializable" ];

  preCheck = ''
    export PYTHONPATH=tests''${PYTHONPATH+:$PYTHONPATH}
  '';
@@ -82,12 +92,6 @@ buildPythonPackage rec {
    "tests/test_output_xml.py"
  ];

  passthru.optional-dependencies = {
    validation = [
      jsonschema
    ];
  };

  meta = with lib; {
    description = "Python library for generating CycloneDX SBOMs";
    homepage = "https://github.com/CycloneDX/cyclonedx-python-lib";