From 456a49aff2e6d47a9e241ffa2cc62cce89a5fb0f Mon Sep 17 00:00:00 2001 From: Douglas Coburn Date: Wed, 25 Jun 2025 16:31:22 -0700 Subject: [PATCH 1/2] Fix for package error when no change --- pyproject.toml | 2 +- socketsecurity/__init__.py | 2 +- socketsecurity/socketcli.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index c09b93a..a5e9b84 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ build-backend = "hatchling.build" [project] name = "socketsecurity" -version = "2.1.12" +version = "2.1.13" requires-python = ">= 3.10" license = {"file" = "LICENSE"} dependencies = [ diff --git a/socketsecurity/__init__.py b/socketsecurity/__init__.py index ffbea13..ff477d1 100644 --- a/socketsecurity/__init__.py +++ b/socketsecurity/__init__.py @@ -1,2 +1,2 @@ __author__ = 'socket.dev' -__version__ = '2.1.12' +__version__ = '2.1.13' diff --git a/socketsecurity/socketcli.py b/socketsecurity/socketcli.py index a7afd18..c228e4e 100644 --- a/socketsecurity/socketcli.py +++ b/socketsecurity/socketcli.py @@ -260,7 +260,7 @@ def main_code(): output_handler.handle_output(diff) # Handle license generation - if diff is not None and config.generate_license: + if diff is not None and diff.id != "no_diff_id" and config.generate_license: all_packages = {} for purl in diff.packages: package = diff.packages[purl] From aa0cff55db53cc5ec6c6cadf79d515fa28491ccc Mon Sep 17 00:00:00 2001 From: Douglas Coburn Date: Wed, 25 Jun 2025 16:42:47 -0700 Subject: [PATCH 2/2] Fixed ref check for unchanged packages --- pyproject.toml | 2 +- socketsecurity/__init__.py | 2 +- socketsecurity/core/classes.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index a5e9b84..6d9b541 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ build-backend = "hatchling.build" [project] name = "socketsecurity" -version = "2.1.13" +version = "2.1.14" requires-python = ">= 3.10" license = {"file" = "LICENSE"} dependencies = [ diff --git a/socketsecurity/__init__.py b/socketsecurity/__init__.py index ff477d1..12f3c86 100644 --- a/socketsecurity/__init__.py +++ b/socketsecurity/__init__.py @@ -1,2 +1,2 @@ __author__ = 'socket.dev' -__version__ = '2.1.13' +__version__ = '2.1.14' diff --git a/socketsecurity/core/classes.py b/socketsecurity/core/classes.py index 972ec51..e81312c 100644 --- a/socketsecurity/core/classes.py +++ b/socketsecurity/core/classes.py @@ -188,7 +188,7 @@ def from_diff_artifact(cls, data: dict) -> "Package": ValueError: If reference data cannot be found in DiffArtifact """ ref = None - if data["diffType"] in ["added", "updated"] and data.get("head"): + if data["diffType"] in ["added", "updated", "unchanged"] and data.get("head"): ref = data["head"][0] elif data["diffType"] in ["removed", "replaced"] and data.get("base"): ref = data["base"][0]