Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion concore_cli/commands/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def _missing_sources(workflow_path, source_path):
return []
missing = set()
for node in soup.find_all("node"):
tag = node.find("y:NodeLabel")
tag = node.find("NodeLabel")
if tag is None:
tag = node.find("NodeLabel")
if tag is None or not tag.text:
Expand Down
23 changes: 21 additions & 2 deletions concore_cli/commands/doctor.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,19 @@
"Windows": "winget install -e --id EclipseAdoptium.Temurin.17.JDK",
},
},
"Julia": {
"names": {
"posix": ["julia"],
"windows": ["julia"],
},
"version_flag": "--version",
"config_keys": ["JULIAEXE", "JULIAWIN"],
"install_hints": {
"Linux": "curl -fsSL https://install.julialang.org | sh",
"Darwin": "brew install julia",
"Windows": "winget install -e --id 9NJNWW8PVKMN -s msstore",
},
},
"Verilog (iverilog)": {
"names": {
"posix": ["iverilog"],
Expand Down Expand Up @@ -321,8 +334,14 @@ def doctor_check(console):
else:
hint = tool_def["install_hints"].get(plat_name, "")
hint_str = f" (install: {hint})" if hint else ""
# Docker, MATLAB, Verilog, and Java are optional - show as warning
if tool_label in ("MATLAB", "Verilog (iverilog)", "Docker", "Java (javac)"):
# Docker, MATLAB, Verilog, Java and Julia are optional - show as warning
if tool_label in (
"MATLAB",
"Verilog (iverilog)",
"Docker",
"Java (javac)",
"Julia",
):
console.print(
f" [yellow]![/yellow] {tool_label} -> Not found{hint_str}"
)
Expand Down
12 changes: 6 additions & 6 deletions concore_cli/commands/inspect.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def _inspect_rich(workflow_path, source_dir, console):
missing_files = []

for node in nodes:
label_tag = node.find("y:NodeLabel")
label_tag = node.find("NodeLabel")
if label_tag and label_tag.text:
label = label_tag.text.strip()
if ":" in label:
Expand Down Expand Up @@ -81,7 +81,7 @@ def _inspect_rich(workflow_path, source_dir, console):
file_count = 0

for edge in edges:
label_tag = edge.find("y:EdgeLabel")
label_tag = edge.find("EdgeLabel")
label_text = label_tag.text.strip() if label_tag and label_tag.text else ""
if label_text and edge_label_regex.match(label_text):
zmq_count += 1
Expand Down Expand Up @@ -120,7 +120,7 @@ def _inspect_rich(workflow_path, source_dir, console):
table.add_column("Status", style="yellow")

for node in nodes[:10]:
label_tag = node.find("y:NodeLabel")
label_tag = node.find("NodeLabel")
if label_tag and label_tag.text:
label = label_tag.text.strip()
if ":" in label:
Expand Down Expand Up @@ -160,7 +160,7 @@ def _inspect_rich(workflow_path, source_dir, console):
source = edge.get("source", "unknown")
target = edge.get("target", "unknown")

label_tag = edge.find("y:EdgeLabel")
label_tag = edge.find("EdgeLabel")
edge_type = "File"
if label_tag and label_tag.text:
if edge_label_regex.match(label_tag.text.strip()):
Expand Down Expand Up @@ -206,7 +206,7 @@ def _inspect_json(workflow_path, source_dir):
missing_files = []

for node in nodes:
label_tag = node.find("y:NodeLabel")
label_tag = node.find("NodeLabel")
if label_tag and label_tag.text:
label = label_tag.text.strip()
if ":" in label:
Expand Down Expand Up @@ -246,7 +246,7 @@ def _inspect_json(workflow_path, source_dir):
source = edge.get("source")
target = edge.get("target")

label_tag = edge.find("y:EdgeLabel")
label_tag = edge.find("EdgeLabel")
label_text = label_tag.text.strip() if label_tag and label_tag.text else ""
edge_type = "file"
if label_text and edge_label_regex.match(label_text):
Expand Down
6 changes: 3 additions & 3 deletions concore_cli/commands/validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ def finalize():

try:
# robust find: try with namespace prefix first, then without
label_tag = node.find("y:NodeLabel")
label_tag = node.find("NodeLabel")
if not label_tag:
label_tag = node.find("NodeLabel")

Expand Down Expand Up @@ -333,7 +333,7 @@ def finalize():

for edge in edges:
try:
label_tag = edge.find("y:EdgeLabel")
label_tag = edge.find("EdgeLabel")
if not label_tag:
label_tag = edge.find("EdgeLabel")

Expand Down Expand Up @@ -449,7 +449,7 @@ def _check_zmq_ports(soup, errors, warnings):
ports_used = {}

for edge in edges:
label_tag = edge.find("y:EdgeLabel") or edge.find("EdgeLabel")
label_tag = edge.find("EdgeLabel")
if not label_tag or not label_tag.text:
continue

Expand Down
8 changes: 4 additions & 4 deletions mkconcore.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ def cleanup_script_files():
try:
data = node.find('data', recursive=False)
if data:
node_label_tag = data.find('y:NodeLabel')
node_label_tag = data.find('NodeLabel')
if node_label_tag:
node_label = prefixedgenode + node_label_tag.text
node_label = re.sub(r'(\s+|\n)', ' ', node_label)
Expand Down Expand Up @@ -393,7 +393,7 @@ def cleanup_script_files():
try:
data = edge.find('data', recursive=False)
if data:
edge_label_tag = data.find('y:EdgeLabel')
edge_label_tag = data.find('EdgeLabel')
if edge_label_tag:
raw_label = edge_label_tag.text
edge_label = prefixedgenode + raw_label
Expand Down Expand Up @@ -464,7 +464,7 @@ def cleanup_script_files():
if copy_script_py_path:
for edge_element in soup.find_all('edge'):
try:
edge_label_tag = edge_element.find('y:EdgeLabel')
edge_label_tag = edge_element.find('EdgeLabel')
if not edge_label_tag or not edge_label_tag.text:
continue

Expand Down Expand Up @@ -805,7 +805,7 @@ def cleanup_script_files():
logging.info("Augmenting port maps with ZMQ connections...")
for edge_element in soup.find_all('edge'):
try:
edge_label_tag = edge_element.find('y:EdgeLabel')
edge_label_tag = edge_element.find('EdgeLabel')
if not edge_label_tag or not edge_label_tag.text: continue
match = edge_label_regex.match(edge_label_tag.text)
if match:
Expand Down
30 changes: 30 additions & 0 deletions tests/test_doctor.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,5 +319,35 @@ def test_doctor_passes_when_javac_runs(self, mock_detect, _mock_runs, _mock_ver)
self.assertIn("javac 21.0.2", line)


class TestJuliaDoctor(unittest.TestCase):
def test_tool_definitions_include_julia(self):
julia_def = TOOL_DEFINITIONS["Julia"]
self.assertEqual(julia_def["config_keys"], ["JULIAEXE", "JULIAWIN"])
self.assertIn("julia", julia_def["names"]["posix"])
self.assertIn("julia", julia_def["names"]["windows"])

@patch("concore_cli.commands.doctor._get_version", return_value="julia 1.10.4")
@patch("concore_cli.commands.doctor._detect_tool")
def test_doctor_shows_julia_when_found(self, mock_detect, _mock_ver):
mock_detect.side_effect = lambda names: (
("/usr/bin/julia", "julia") if "julia" in names else (None, None)
)
console = _RecordingConsole()
doctor_check(console)

line = next(line for line in console.lines if "Julia" in line)
self.assertIn("[green]+[/green]", line)
self.assertIn("julia 1.10.4", line)

@patch("concore_cli.commands.doctor._detect_tool", return_value=(None, None))
def test_doctor_warns_when_julia_missing(self, _mock_detect):
console = _RecordingConsole()
doctor_check(console)

line = next(line for line in console.lines if "Julia" in line)
self.assertIn("[yellow]![/yellow]", line)
self.assertIn("Not found", line)


if __name__ == "__main__":
unittest.main()
17 changes: 17 additions & 0 deletions tests/test_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,23 @@ def detect_side_effect(names):
self.assertIn("CPPEXE=/usr/bin/g++", content)
self.assertIn("PYTHONEXE=/usr/bin/python3", content)

@patch("concore_cli.commands.setup._resolve_concore_path")
@patch("concore_cli.commands.setup._detect_tool")
@patch("concore_cli.commands.setup._get_platform_key")
def test_setup_writes_julia_path(self, mock_plat, mock_detect, mock_path):
for plat, key in (("posix", "JULIAEXE"), ("windows", "JULIAWIN")):
mock_plat.return_value = plat
mock_path.return_value = Path(self.temp_dir)
mock_detect.side_effect = lambda names: (
("/usr/bin/julia", "julia") if "julia" in names else (None, None)
)

result = self.runner.invoke(cli, ["setup", "--force"])
self.assertEqual(result.exit_code, 0)

tools_file = Path(self.temp_dir) / "concore.tools"
self.assertEqual(tools_file.read_text(), f"{key}=/usr/bin/julia\n")


if __name__ == "__main__":
unittest.main()
Loading