From 3018f9e3d79c1ac88e3d828ce5ffcf3d6f2175e1 Mon Sep 17 00:00:00 2001 From: xuanzhi33 Date: Sun, 25 Feb 2024 15:21:20 +0800 Subject: [PATCH] fix: handle case when 'dependencies' key is missing in info_dict --- src/spkg/__about__.py | 2 +- src/spkg/hatch/__init__.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/spkg/__about__.py b/src/spkg/__about__.py index e7e59c3..d2446db 100644 --- a/src/spkg/__about__.py +++ b/src/spkg/__about__.py @@ -1,4 +1,4 @@ # SPDX-FileCopyrightText: 2024-present xuanzhi33 # # SPDX-License-Identifier: GPL-3.0-only -__version__ = "1.1.0" +__version__ = "1.1.1" diff --git a/src/spkg/hatch/__init__.py b/src/spkg/hatch/__init__.py index 72feb4d..201d822 100644 --- a/src/spkg/hatch/__init__.py +++ b/src/spkg/hatch/__init__.py @@ -41,7 +41,10 @@ def new_cli(self, name): def info(self): result = self.hatch_output(["project", "metadata"]) info_dict = json.loads(result) - deps = info_dict['dependencies'] + if 'dependencies' in info_dict: + deps = info_dict['dependencies'] + else: + deps = ["None"] output = f"""{info_dict['name']} Description: {info_dict['description']}