diff --git a/concore_cli/commands/build.py b/concore_cli/commands/build.py index 9856d33..68fd69a 100644 --- a/concore_cli/commands/build.py +++ b/concore_cli/commands/build.py @@ -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: diff --git a/concore_cli/commands/doctor.py b/concore_cli/commands/doctor.py index 4cb9fe2..5c3589f 100644 --- a/concore_cli/commands/doctor.py +++ b/concore_cli/commands/doctor.py @@ -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"], @@ -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}" ) diff --git a/concore_cli/commands/inspect.py b/concore_cli/commands/inspect.py index d3ae9be..477669e 100644 --- a/concore_cli/commands/inspect.py +++ b/concore_cli/commands/inspect.py @@ -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: @@ -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 @@ -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: @@ -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()): @@ -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: @@ -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): diff --git a/concore_cli/commands/validate.py b/concore_cli/commands/validate.py index 2cbefc7..6e16f9a 100644 --- a/concore_cli/commands/validate.py +++ b/concore_cli/commands/validate.py @@ -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") @@ -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") @@ -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 diff --git a/mkconcore.py b/mkconcore.py index 5804f77..ea484fb 100644 --- a/mkconcore.py +++ b/mkconcore.py @@ -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) @@ -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 @@ -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 @@ -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: diff --git a/tests/test_doctor.py b/tests/test_doctor.py index 346c095..a9bcef2 100644 --- a/tests/test_doctor.py +++ b/tests/test_doctor.py @@ -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() diff --git a/tests/test_setup.py b/tests/test_setup.py index 42a05fe..36265c6 100644 --- a/tests/test_setup.py +++ b/tests/test_setup.py @@ -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()