From d37488d449533e62830f7e9d9f647e38811fbfe7 Mon Sep 17 00:00:00 2001 From: Alexander Sieg Date: Thu, 25 Jul 2024 12:57:31 +0200 Subject: [PATCH] cyclonedx-python: 3.11.7 -> 4.5.0 --- .../cyclonedx-python-lib/default.nix | 6 ++ pkgs/tools/misc/cyclonedx-python/default.nix | 57 ++++++------------- 2 files changed, 22 insertions(+), 41 deletions(-) diff --git a/pkgs/development/python-modules/cyclonedx-python-lib/default.nix b/pkgs/development/python-modules/cyclonedx-python-lib/default.nix index 1dec71571003..2b60de8fd4e5 100644 --- a/pkgs/development/python-modules/cyclonedx-python-lib/default.nix +++ b/pkgs/development/python-modules/cyclonedx-python-lib/default.nix @@ -82,6 +82,12 @@ 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"; diff --git a/pkgs/tools/misc/cyclonedx-python/default.nix b/pkgs/tools/misc/cyclonedx-python/default.nix index ba6d137fa5b7..b3439723aaff 100644 --- a/pkgs/tools/misc/cyclonedx-python/default.nix +++ b/pkgs/tools/misc/cyclonedx-python/default.nix @@ -1,65 +1,40 @@ -{ lib -, fetchFromGitHub -, python3 +{ + lib, + fetchFromGitHub, + python3Packages, }: -let - py = python3.override { - packageOverrides = self: super: { - - # Requires 'cyclonedx-python-lib = ">= 2.0.0, < 4.0.0"' - cyclonedx-python-lib = super.cyclonedx-python-lib.overridePythonAttrs (oldAttrs: rec { - version = "3.1.5"; - src = fetchFromGitHub { - owner = "CycloneDX"; - repo = "cyclonedx-python-lib"; - rev = "refs/tags/v${version}"; - hash = "sha256-4lA8OdmvQD94jTeDf+Iz7ZyEQ9fZzCxnXQG9Ir8FKhk="; - }; - }); - }; - }; -in -with py.pkgs; - -python3.pkgs.buildPythonApplication rec { +python3Packages.buildPythonApplication rec { pname = "cyclonedx-python"; - version = "3.11.7"; + version = "4.5.0"; pyproject = true; src = fetchFromGitHub { owner = "CycloneDX"; repo = "cyclonedx-python"; rev = "refs/tags/v${version}"; - sha256 = "sha256-jU/0FkQCyph59TnEE+lckJXsU9whfvWp7dkdfzprYw8="; + hash = "sha256-+XeMRREDX1+v+qOeYiHh7uhadfueYYOxspLY3q1NL6s="; }; - nativeBuildInputs = with py.pkgs; [ - poetry-core - ]; + build-system = with python3Packages; [ poetry-core ]; - propagatedBuildInputs = with py.pkgs; [ + dependencies = with python3Packages; [ chardet cyclonedx-python-lib packageurl-python pip-requirements-parser - setuptools - toml - ]; + packaging + tomli + ] ++ cyclonedx-python-lib.optional-dependencies.validation; - # The tests want access to the cyclonedx binary - doCheck = false; + pythonImportsCheck = [ "cyclonedx" ]; - pythonImportsCheck = [ - "cyclonedx" - ]; - - meta = with lib; { + meta = { description = "Creates CycloneDX Software Bill of Materials (SBOM) from Python projects"; homepage = "https://github.com/CycloneDX/cyclonedx-python"; changelog = "https://github.com/CycloneDX/cyclonedx-python/releases/tag/v${version}"; - license = licenses.asl20; - maintainers = with maintainers; [ ]; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ xanderio ]; mainProgram = "cyclonedx-py"; }; }