Skip to content

Commit

Permalink
fix: handle case when 'dependencies' key is missing in info_dict
Browse files Browse the repository at this point in the history
  • Loading branch information
xuanzhi33 committed Feb 25, 2024
1 parent f40cff7 commit 3018f9e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/spkg/__about__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: 2024-present xuanzhi33 <[email protected]>
#
# SPDX-License-Identifier: GPL-3.0-only
__version__ = "1.1.0"
__version__ = "1.1.1"
5 changes: 4 additions & 1 deletion src/spkg/hatch/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']}
Expand Down

0 comments on commit 3018f9e

Please sign in to comment.