Skip to content

Commit 6e249f1

Browse files
committed
Add fixes for pipx based installs for jiftools
Signed-off-by: Travis F. Collins <travis.collins@analog.com>
1 parent ba05b26 commit 6e249f1

2 files changed

Lines changed: 13 additions & 4 deletions

File tree

adijif/clocks/ad9545.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,9 @@ def draw(self, lo: Layout = None) -> str:
251251
for i in range(2):
252252
if self.PLL_used[i]:
253253
pll_rate = config[f"PLL{i}"].get("rate_hz", 0)
254-
pll_node = Node(f"PLL{i}", ntype="voltage-controlled-oscillator")
254+
pll_node = Node(
255+
f"PLL{i}", ntype="voltage-controlled-oscillator"
256+
)
255257
pll_node.shape = "circle"
256258
ic_node.add_child(pll_node)
257259

@@ -261,7 +263,11 @@ def draw(self, lo: Layout = None) -> str:
261263
r_node = ic_node.get_child(f"R{j}")
262264
pll_in_rate = self.input_refs[j] / config[f"r{j}"]
263265
ic_node.add_connection(
264-
{"from": r_node, "to": pll_node, "rate": pll_in_rate}
266+
{
267+
"from": r_node,
268+
"to": pll_node,
269+
"rate": pll_in_rate,
270+
}
265271
)
266272

267273
# Add output Q dividers

adijif/tools/explorer/cli.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,14 @@
44
import sys
55
from typing import Optional
66

7-
from streamlit.web import cli as stcli
8-
97

108
def run_streamlit(args: Optional[list[str]] = None) -> None:
119
"""Run the Streamlit tools explorer app."""
10+
# Lazy import: streamlit is an optional dependency (extras: [tools]).
11+
# Importing at module level causes pipx installation to fail when streamlit
12+
# is not yet installed, even if the [tools] extra is specified.
13+
from streamlit.web import cli as stcli # noqa: PLC0415
14+
1215
# Get the directory where this file is located
1316
current_dir = os.path.dirname(os.path.abspath(__file__))
1417
main_file = os.path.join(current_dir, "main.py")

0 commit comments

Comments
 (0)