Skip to content

Commit 3eda236

Browse files
fixed drafts in ls-remote
1 parent dfa6daa commit 3eda236

4 files changed

Lines changed: 38 additions & 11 deletions

File tree

ipm/common.py

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,21 @@ def get_verified_ip_info(Self, ip_name=None, include_drafts=False, local_file=No
221221
logger.print_err(f"IP {ip_name} not found in the release list.")
222222
exit(1)
223223
else:
224-
return data
224+
# When listing all IPs, filter out IPs with only draft releases if include_drafts is False
225+
result = {}
226+
for ip_name, ip_info in data.items():
227+
releases = ip_info.get("release", {})
228+
if not include_drafts:
229+
filtered_releases = {
230+
version: info
231+
for version, info in releases.items()
232+
if not info.get("draft", False)
233+
}
234+
if filtered_releases:
235+
result[ip_name] = {**ip_info, "release": filtered_releases}
236+
else:
237+
result[ip_name] = ip_info
238+
return result
225239

226240
@staticmethod
227241
def get_installed_ips(ip_root):
@@ -1245,14 +1259,16 @@ def check_ip_root_dir(ip_root) -> bool:
12451259
return True
12461260

12471261

1248-
def list_verified_ips(category=None, technology=None):
1249-
"""creates a table of all verified remote ips
1262+
def list_verified_ips(category=None, technology=None, include_drafts=False, local_file=None):
1263+
"""creates a table of all verified remote ips or from a local file
12501264
12511265
Args:
12521266
category (str, optional): filter the ips by category. Defaults to None.
12531267
technology (str, optional): filter the ips by technology. Defaults to None.
1268+
include_drafts (bool, optional): include draft IPs. Defaults to False.
1269+
local_file (str, optional): path to local verified_IPs.json. Defaults to None.
12541270
"""
1255-
verified_ips = IPInfo.get_verified_ip_info()
1271+
verified_ips = IPInfo.get_verified_ip_info(include_drafts=include_drafts, local_file=local_file)
12561272
ip_list = []
12571273
logger = Logger()
12581274
check_for_updates(logger)

ipm/manage.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,14 +111,24 @@ def uninstall(
111111
required=False,
112112
help="Optionally provide the technology (sky130A, gf180mcuC)",
113113
)
114-
def ls_remote_cmd(category, technology):
114+
@click.option(
115+
"--include-drafts",
116+
is_flag=True,
117+
help="Include draft IPs in the listing",
118+
)
119+
@click.option(
120+
"--local-file",
121+
required=False,
122+
help="Path to local verified_IPs.json file",
123+
)
124+
def ls_remote_cmd(category, technology, include_drafts, local_file):
115125
"""Lists all verified IPs in ipm's database"""
116-
ls_remote(category, technology)
126+
ls_remote(category, technology, include_drafts, local_file)
117127

118128

119-
def ls_remote(category, technology):
129+
def ls_remote(category, technology, include_drafts=False, local_file=None):
120130
"""Lists all verified IPs in ipm's database"""
121-
list_verified_ips(category, technology)
131+
list_verified_ips(category, technology, include_drafts=include_drafts, local_file=local_file)
122132

123133

124134
@click.command("info")

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "cf-ipm"
3-
version = "1.2.1"
3+
version = "1.2.2"
44
description = "Package manager for Open Source ASIC IPs"
55
authors = ["ChipFoundry <marwan.abbas@chipfoundry.io>"]
66
readme = "README.md"

verified_IPs.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
"bus": [
5454
"WB"
5555
],
56-
"type": "soft",
56+
"type": "hard",
5757
"width": "387.87",
5858
"height": "303.315",
5959
"cell_count": "0",
@@ -70,7 +70,7 @@
7070
"bus": [
7171
"WB"
7272
],
73-
"type": "soft",
73+
"type": "hard",
7474
"width": "387.87",
7575
"height": "303.315",
7676
"cell_count": "0",
@@ -3242,6 +3242,7 @@
32423242
"height": "0.0",
32433243
"cell_count": "0",
32443244
"clock_freq_mhz": "48",
3245+
"draft": true,
32453246
"supply_voltage": [
32463247
"n/a"
32473248
]

0 commit comments

Comments
 (0)