From 79afa19cf5d5b55206c8d83e91f5b7942a82a53d Mon Sep 17 00:00:00 2001 From: bhuvan-somisetty Date: Wed, 4 Nov 2026 10:27:47 +0530 Subject: [PATCH 1/3] fix: single quote the .m file name in windows run and debug scripts --- mkconcore.py | 10 +++++----- tests/test_cli.py | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 5 deletions(-) diff --git a/mkconcore.py b/mkconcore.py index a1f44ef..c645eeb 100644 --- a/mkconcore.py +++ b/mkconcore.py @@ -1279,13 +1279,13 @@ def cleanup_script_files(): fdebug.write('cd ..\n') fdebug.write('start /D '+q_container+' cmd /K '+JAVAWIN+' -cp .;..\\src\\jeromq.jar '+javaclass+'\n') elif langext=="m": #3/23/21 - # Use q_source in Windows commands to ensure quoting consistency + # single quotes around the file name, q_source would nest double quotes in "run(...)" if M_IS_OCTAVE: - frun.write('start /B /D '+q_container+" "+OCTAVEWIN+' -qf --eval "run('+q_source+')"'+" >"+q_container+"\\concoreout.txt\n") - fdebug.write('start /D '+q_container+" cmd /K " +OCTAVEWIN+' -qf --eval "run('+q_source+')"'+"\n") + frun.write('start /B /D '+q_container+" "+OCTAVEWIN+' -qf --eval "run('+"'"+sourcecode+"'"+')"'+" >"+q_container+"\\concoreout.txt\n") + fdebug.write('start /D '+q_container+" cmd /K " +OCTAVEWIN+' -qf --eval "run('+"'"+sourcecode+"'"+')"'+"\n") else: # 4/2/21 - frun.write('start /B /D '+q_container+" "+MATLABWIN+' -batch "run('+q_source+')"'+" >"+q_container+"\\concoreout.txt\n") - fdebug.write('start /D '+q_container+" cmd /K " +MATLABWIN+' -batch "run('+q_source+')"'+"\n") + frun.write('start /B /D '+q_container+" "+MATLABWIN+' -batch "run('+"'"+sourcecode+"'"+')"'+" >"+q_container+"\\concoreout.txt\n") + fdebug.write('start /D '+q_container+" cmd /K " +MATLABWIN+' -batch "run('+"'"+sourcecode+"'"+')"'+"\n") else: #use shlex.quote for POSIX systems safe_container = shlex.quote(containername) diff --git a/tests/test_cli.py b/tests/test_cli.py index b95c60d..0d41bad 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -708,6 +708,45 @@ def test_build_command_windows_java_node(self): run_script, ) + def test_build_command_windows_matlab_node(self): + with self.runner.isolated_filesystem(temp_dir=self.temp_dir): + result = self.runner.invoke(cli, ["init", "test-project"]) + self.assertEqual(result.exit_code, 0) + + Path("test-project/src/script.py").rename("test-project/src/script.m") + workflow_path = Path("test-project/workflow.graphml") + content = workflow_path.read_text() + workflow_path.write_text(content.replace("N1:script.py", "N1:script.m")) + + result = self.runner.invoke( + cli, + [ + "build", + "test-project/workflow.graphml", + "--source", + "test-project/src", + "--output", + "out", + "--type", + "windows", + ], + ) + self.assertEqual(result.exit_code, 0) + + # the file name has to be single quoted, nested double quotes + # turn it into run(script.m) + run_script = Path("out/run.bat").read_text() + debug_script = Path("out/debug.bat").read_text() + repo_root = Path(__file__).resolve().parents[1] + if (repo_root / "concore.octave").exists(): + expected = "-qf --eval \"run('script.m')\"" + else: + expected = "-batch \"run('script.m')\"" + self.assertIn(expected, run_script) + self.assertIn(expected, debug_script) + self.assertNotIn('run("script.m")', run_script) + self.assertNotIn('run("script.m")', debug_script) + def test_build_command_docker_java_node(self): with self.runner.isolated_filesystem(temp_dir=self.temp_dir): result = self.runner.invoke(cli, ["init", "test-project"]) From 38607c4aa15cd7f49807d84fd0dda2c47cbdc3c8 Mon Sep 17 00:00:00 2001 From: bhuvan-somisetty Date: Mon, 2 Nov 2026 21:38:27 +0530 Subject: [PATCH 2/3] test: write the comma params test file to in1 in TestConcoreHpp.cpp --- TestConcoreHpp.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TestConcoreHpp.cpp b/TestConcoreHpp.cpp index 6b6ad2c..f7311af 100644 --- a/TestConcoreHpp.cpp +++ b/TestConcoreHpp.cpp @@ -333,7 +333,7 @@ static void test_load_params_semicolon_format() { static void test_tryparam_comma_in_value() { setup_dirs(); - write_file("in/1/concore.params", "{'channels': [1, 2], 'gain': '0.5'}"); + write_file("in1/concore.params", "{'channels': [1, 2], 'gain': '0.5'}"); Concore c; c.delay = 0; @@ -342,7 +342,7 @@ static void test_tryparam_comma_in_value() { check("tryparam preserves list with comma", c.tryparam("channels", "") == "[1, 2]"); check("tryparam preserves subsequent key", c.tryparam("gain", "") == "0.5"); - rm("in/1/concore.params"); + rm("in1/concore.params"); } // ------------- main ------------------------------------------------------- From f1e4e61a210eff1136bee40a418b48347badd90e Mon Sep 17 00:00:00 2001 From: bhuvan-somisetty Date: Wed, 4 Nov 2026 10:32:53 +0530 Subject: [PATCH 3/3] ci: run the python test matrix on ubuntu-24.04 so 3.9 is still available --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bb47fa0..1f01f61 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,7 +27,7 @@ jobs: run: ruff check . --output-format=github test: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 strategy: matrix: python-version: ['3.9', '3.10', '3.11', '3.12']