From 1a1723ed0e67492490a7c52e592707f41fda95be Mon Sep 17 00:00:00 2001 From: bhuvan-somisetty Date: Wed, 14 Oct 2026 21:06:52 +0530 Subject: [PATCH 1/2] fix: detect non-Python nodes in concore status and stop Only concore.py / concoredocker.py counted as runtime markers, so C++, Java, Verilog and MATLAB node folders never matched and stop left them running. Accept the runtime file mkconcore copies for each language. --- concore_cli/commands/_process_match.py | 20 ++++++++++++++++---- tests/test_process_match.py | 12 ++++++++++++ 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/concore_cli/commands/_process_match.py b/concore_cli/commands/_process_match.py index e803eb1..f1b143e 100644 --- a/concore_cli/commands/_process_match.py +++ b/concore_cli/commands/_process_match.py @@ -2,19 +2,31 @@ import os +# Runtime files mkconcore.py copies into a node folder, one set per language. +RUNTIME_FILES = ( + "concore.py", + "concoredocker.py", + "concore.hpp", + "concoredocker.hpp", + "concore.java", + "concoredocker.java", + "concore.v", + "concoredocker.v", + "concore_read.m", +) + + def has_concore_markers(cwd): """True only if `cwd` looks like an actual concore-generated node working directory, i.e. it contains the runtime files mkconcore.py copies into every generated study (concore.iport/oport plus the - runtime module itself).""" + runtime module for the node's language).""" if not cwd: return False try: if not os.path.isfile(os.path.join(cwd, "concore.iport")): return False - return os.path.isfile(os.path.join(cwd, "concore.py")) or os.path.isfile( - os.path.join(cwd, "concoredocker.py") - ) + return any(os.path.isfile(os.path.join(cwd, name)) for name in RUNTIME_FILES) except OSError: return False diff --git a/tests/test_process_match.py b/tests/test_process_match.py index 9f39649..61b3f0e 100644 --- a/tests/test_process_match.py +++ b/tests/test_process_match.py @@ -9,6 +9,8 @@ import os +import pytest + from concore_cli.commands._process_match import has_concore_markers, is_concore_process @@ -23,6 +25,16 @@ def test_true_with_docker_runtime_file(self, tmp_path): (tmp_path / "concoredocker.py").write_text("") assert has_concore_markers(str(tmp_path)) is True + @pytest.mark.parametrize( + "runtime_file", + ["concore.hpp", "concore.java", "concore.v", "concore_read.m"], + ) + def test_true_for_non_python_nodes(self, tmp_path, runtime_file): + # C++, Java, Verilog and MATLAB nodes never get concore.py (#615) + (tmp_path / "concore.iport").write_text("{}") + (tmp_path / runtime_file).write_text("") + assert has_concore_markers(str(tmp_path)) is True + def test_false_without_iport(self, tmp_path): (tmp_path / "concore.py").write_text("") assert has_concore_markers(str(tmp_path)) is False From 03f89e48815f7f5ceadb8069b58438dbd2166e79 Mon Sep 17 00:00:00 2001 From: bhuvan-somisetty Date: Thu, 15 Oct 2026 14:55:01 +0530 Subject: [PATCH 2/2] test: drop issue number from comment --- tests/test_process_match.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_process_match.py b/tests/test_process_match.py index 61b3f0e..b218d19 100644 --- a/tests/test_process_match.py +++ b/tests/test_process_match.py @@ -30,7 +30,7 @@ def test_true_with_docker_runtime_file(self, tmp_path): ["concore.hpp", "concore.java", "concore.v", "concore_read.m"], ) def test_true_for_non_python_nodes(self, tmp_path, runtime_file): - # C++, Java, Verilog and MATLAB nodes never get concore.py (#615) + # C++, Java, Verilog and MATLAB nodes never get concore.py (tmp_path / "concore.iport").write_text("{}") (tmp_path / runtime_file).write_text("") assert has_concore_markers(str(tmp_path)) is True