Skip to content

Commit 393eabc

Browse files
authored
Merge pull request #519 from GREENRAT-K405/fix/replace-run-build
Rename CLI command run → build to reflect actual behaviour
2 parents c628826 + 0117838 commit 393eabc

File tree

7 files changed

+46
-45
lines changed

7 files changed

+46
-45
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ concore init my-project
5555
# Validate your workflow
5656
concore validate workflow.graphml
5757

58-
# Run your workflow
59-
concore run workflow.graphml --auto-build
58+
# Compile your workflow
59+
concore build workflow.graphml --auto-build
6060

6161
# Monitor running processes
6262
concore status

concore_cli/README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ cd my-project
2020
# Validate your workflow
2121
concore validate workflow.graphml
2222

23-
# Run your workflow
24-
concore run workflow.graphml
23+
# Build your workflow
24+
concore build workflow.graphml
2525

2626
# Check running processes
2727
concore status
@@ -53,9 +53,9 @@ my-workflow/
5353
└── README.md # Project documentation
5454
```
5555

56-
### `concore run <workflow_file>`
56+
### `concore build <workflow_file>`
5757

58-
Generates and optionally builds a workflow from a GraphML file.
58+
Compiles a concore workflow GraphML file into executable scripts (POSIX, Windows, or Docker).
5959

6060
**Options:**
6161
- `-s, --source <dir>` - Source directory (default: src)
@@ -66,13 +66,13 @@ Generates and optionally builds a workflow from a GraphML file.
6666

6767
**Example:**
6868
```bash
69-
concore run workflow.graphml --source ./src --output ./build --auto-build
69+
concore build workflow.graphml --source ./src --output ./build --auto-build
7070
```
7171

7272
Docker compose example:
7373

7474
```bash
75-
concore run workflow.graphml --source ./src --output ./out --type docker --compose
75+
concore build workflow.graphml --source ./src --output ./out --type docker --compose
7676
cd out
7777
docker compose up
7878
```
@@ -150,7 +150,7 @@ concore stop
150150

151151
5. **Generate and run**
152152
```bash
153-
concore run workflow.graphml --auto-build
153+
concore build workflow.graphml --auto-build
154154
cd out
155155
./run.bat # or ./run on Linux/Mac
156156
```

concore_cli/cli.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import sys
55

66
from .commands.init import init_project, init_project_interactive, run_wizard
7-
from .commands.run import run_workflow
7+
from .commands.build import build_workflow
88
from .commands.validate import validate_workflow
99
from .commands.status import show_status
1010
from .commands.stop import stop_all
@@ -68,17 +68,17 @@ def init(name, template, interactive):
6868
help="Execution type",
6969
)
7070
@click.option(
71-
"--auto-build", is_flag=True, help="Automatically run build after generation"
71+
"--auto-build", is_flag=True, help="Automatically run build script after generation"
7272
)
7373
@click.option(
7474
"--compose",
7575
is_flag=True,
7676
help="Generate docker-compose.yml in output directory (docker type only)",
7777
)
78-
def run(workflow_file, source, output, type, auto_build, compose):
79-
"""Run a concore workflow"""
78+
def build(workflow_file, source, output, type, auto_build, compose):
79+
"""Compile a concore workflow into executable scripts"""
8080
try:
81-
run_workflow(
81+
build_workflow(
8282
workflow_file,
8383
source,
8484
output,

concore_cli/commands/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from .init import init_project
2-
from .run import run_workflow
2+
from .build import build_workflow
33
from .validate import validate_workflow
44
from .status import show_status
55
from .stop import stop_all
@@ -8,7 +8,7 @@
88

99
__all__ = [
1010
"init_project",
11-
"run_workflow",
11+
"build_workflow",
1212
"validate_workflow",
1313
"show_status",
1414
"stop_all",
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def _write_docker_compose(output_path):
115115
return compose_path
116116

117117

118-
def run_workflow(
118+
def build_workflow(
119119
workflow_file,
120120
source,
121121
output,
@@ -201,7 +201,7 @@ def run_workflow(
201201
try:
202202
metadata_path = write_study_metadata(
203203
output_path,
204-
generated_by="concore run",
204+
generated_by="concore build",
205205
workflow_file=workflow_path,
206206
)
207207
console.print(

concore_cli/commands/init.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -183,9 +183,9 @@
183183
184184
1. Edit your workflow in `workflow.graphml` using yEd or similar GraphML editor
185185
2. Add your processing scripts to the `src/` directory
186-
3. Run your workflow:
186+
3. Build your workflow:
187187
```
188-
concore run workflow.graphml
188+
concore build workflow.graphml
189189
```
190190
191191
## Project Structure
@@ -318,7 +318,7 @@ def init_project_interactive(name, selected_langs, console):
318318
f"Next steps:\n"
319319
f" cd {name}\n"
320320
f" concore validate workflow.graphml\n"
321-
f" concore run workflow.graphml",
321+
f" concore build workflow.graphml",
322322
title="Success",
323323
border_style="green",
324324
)
@@ -371,7 +371,7 @@ def init_project(name, template, console):
371371
f"Next steps:\n"
372372
f" cd {name}\n"
373373
f" concore validate workflow.graphml\n"
374-
f" concore run workflow.graphml",
374+
f" concore build workflow.graphml",
375375
title="Success",
376376
border_style="green",
377377
)

tests/test_cli.py

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -88,23 +88,24 @@ def test_status_command(self):
8888
result = self.runner.invoke(cli, ["status"])
8989
self.assertEqual(result.exit_code, 0)
9090

91-
def test_run_command_missing_source(self):
91+
def test_build_command_missing_source(self):
9292
with self.runner.isolated_filesystem(temp_dir=self.temp_dir):
9393
result = self.runner.invoke(cli, ["init", "test-project"])
9494
result = self.runner.invoke(
95-
cli, ["run", "test-project/workflow.graphml", "--source", "nonexistent"]
95+
cli,
96+
["build", "test-project/workflow.graphml", "--source", "nonexistent"],
9697
)
9798
self.assertNotEqual(result.exit_code, 0)
9899

99-
def test_run_command_from_project_dir(self):
100+
def test_build_command_from_project_dir(self):
100101
with self.runner.isolated_filesystem(temp_dir=self.temp_dir):
101102
result = self.runner.invoke(cli, ["init", "test-project"])
102103
self.assertEqual(result.exit_code, 0)
103104

104105
result = self.runner.invoke(
105106
cli,
106107
[
107-
"run",
108+
"build",
108109
"test-project/workflow.graphml",
109110
"--source",
110111
"test-project/src",
@@ -119,20 +120,20 @@ def test_run_command_from_project_dir(self):
119120
self.assertTrue(Path("out/STUDY.json").exists())
120121

121122
metadata = json.loads(Path("out/STUDY.json").read_text())
122-
self.assertEqual(metadata["generated_by"], "concore run")
123+
self.assertEqual(metadata["generated_by"], "concore build")
123124
self.assertEqual(metadata["study_name"], "out")
124125
self.assertEqual(metadata["schema_version"], 1)
125126
self.assertIn("workflow.graphml", metadata["checksums"])
126127

127-
def test_run_command_default_type(self):
128+
def test_build_command_default_type(self):
128129
with self.runner.isolated_filesystem(temp_dir=self.temp_dir):
129130
result = self.runner.invoke(cli, ["init", "test-project"])
130131
self.assertEqual(result.exit_code, 0)
131132

132133
result = self.runner.invoke(
133134
cli,
134135
[
135-
"run",
136+
"build",
136137
"test-project/workflow.graphml",
137138
"--source",
138139
"test-project/src",
@@ -146,15 +147,15 @@ def test_run_command_default_type(self):
146147
else:
147148
self.assertTrue(Path("out/build").exists())
148149

149-
def test_run_command_nested_output_path(self):
150+
def test_build_command_nested_output_path(self):
150151
with self.runner.isolated_filesystem(temp_dir=self.temp_dir):
151152
result = self.runner.invoke(cli, ["init", "test-project"])
152153
self.assertEqual(result.exit_code, 0)
153154

154155
result = self.runner.invoke(
155156
cli,
156157
[
157-
"run",
158+
"build",
158159
"test-project/workflow.graphml",
159160
"--source",
160161
"test-project/src",
@@ -167,7 +168,7 @@ def test_run_command_nested_output_path(self):
167168
self.assertEqual(result.exit_code, 0)
168169
self.assertTrue(Path("build/out/src/concore.py").exists())
169170

170-
def test_run_command_subdir_source(self):
171+
def test_build_command_subdir_source(self):
171172
with self.runner.isolated_filesystem(temp_dir=self.temp_dir):
172173
result = self.runner.invoke(cli, ["init", "test-project"])
173174
self.assertEqual(result.exit_code, 0)
@@ -184,7 +185,7 @@ def test_run_command_subdir_source(self):
184185
result = self.runner.invoke(
185186
cli,
186187
[
187-
"run",
188+
"build",
188189
"test-project/workflow.graphml",
189190
"--source",
190191
"test-project/src",
@@ -197,7 +198,7 @@ def test_run_command_subdir_source(self):
197198
self.assertEqual(result.exit_code, 0)
198199
self.assertTrue(Path("out/src/subdir/script.py").exists())
199200

200-
def test_run_command_docker_subdir_source_build_paths(self):
201+
def test_build_command_docker_subdir_source_build_paths(self):
201202
with self.runner.isolated_filesystem(temp_dir=self.temp_dir):
202203
result = self.runner.invoke(cli, ["init", "test-project"])
203204
self.assertEqual(result.exit_code, 0)
@@ -214,7 +215,7 @@ def test_run_command_docker_subdir_source_build_paths(self):
214215
result = self.runner.invoke(
215216
cli,
216217
[
217-
"run",
218+
"build",
218219
"test-project/workflow.graphml",
219220
"--source",
220221
"test-project/src",
@@ -233,15 +234,15 @@ def test_run_command_docker_subdir_source_build_paths(self):
233234
self.assertIn("cp ../src/subdir/script.iport concore.iport", build_script)
234235
self.assertIn("cd ..", build_script)
235236

236-
def test_run_command_compose_requires_docker_type(self):
237+
def test_build_command_compose_requires_docker_type(self):
237238
with self.runner.isolated_filesystem(temp_dir=self.temp_dir):
238239
result = self.runner.invoke(cli, ["init", "test-project"])
239240
self.assertEqual(result.exit_code, 0)
240241

241242
result = self.runner.invoke(
242243
cli,
243244
[
244-
"run",
245+
"build",
245246
"test-project/workflow.graphml",
246247
"--source",
247248
"test-project/src",
@@ -257,15 +258,15 @@ def test_run_command_compose_requires_docker_type(self):
257258
"--compose can only be used with --type docker", result.output
258259
)
259260

260-
def test_run_command_docker_compose_single_node(self):
261+
def test_build_command_docker_compose_single_node(self):
261262
with self.runner.isolated_filesystem(temp_dir=self.temp_dir):
262263
result = self.runner.invoke(cli, ["init", "test-project"])
263264
self.assertEqual(result.exit_code, 0)
264265

265266
result = self.runner.invoke(
266267
cli,
267268
[
268-
"run",
269+
"build",
269270
"test-project/workflow.graphml",
270271
"--source",
271272
"test-project/src",
@@ -288,7 +289,7 @@ def test_run_command_docker_compose_single_node(self):
288289
metadata = json.loads(Path("out/STUDY.json").read_text())
289290
self.assertIn("docker-compose.yml", metadata["checksums"])
290291

291-
def test_run_command_docker_compose_multi_node(self):
292+
def test_build_command_docker_compose_multi_node(self):
292293
with self.runner.isolated_filesystem(temp_dir=self.temp_dir):
293294
Path("src").mkdir()
294295
Path("src/common.py").write_text(
@@ -313,7 +314,7 @@ def test_run_command_docker_compose_multi_node(self):
313314
result = self.runner.invoke(
314315
cli,
315316
[
316-
"run",
317+
"build",
317318
"workflow.graphml",
318319
"--source",
319320
"src",
@@ -332,7 +333,7 @@ def test_run_command_docker_compose_multi_node(self):
332333
self.assertIn("container_name: 'C'", compose_content)
333334
self.assertIn("image: 'docker-common'", compose_content)
334335

335-
def test_run_command_shared_source_specialization_merges_edge_params(self):
336+
def test_build_command_shared_source_specialization_merges_edge_params(self):
336337
with self.runner.isolated_filesystem(temp_dir=self.temp_dir):
337338
Path("src").mkdir()
338339
Path("src/common.py").write_text(
@@ -357,7 +358,7 @@ def test_run_command_shared_source_specialization_merges_edge_params(self):
357358
result = self.runner.invoke(
358359
cli,
359360
[
360-
"run",
361+
"build",
361362
"workflow.graphml",
362363
"--source",
363364
"src",
@@ -377,15 +378,15 @@ def test_run_command_shared_source_specialization_merges_edge_params(self):
377378
self.assertIn("PORT_NAME_B_C", content)
378379
self.assertIn("PORT_B_C", content)
379380

380-
def test_run_command_existing_output(self):
381+
def test_build_command_existing_output(self):
381382
with self.runner.isolated_filesystem(temp_dir=self.temp_dir):
382383
result = self.runner.invoke(cli, ["init", "test-project"])
383384
Path("output").mkdir()
384385

385386
result = self.runner.invoke(
386387
cli,
387388
[
388-
"run",
389+
"build",
389390
"test-project/workflow.graphml",
390391
"--source",
391392
"test-project/src",

0 commit comments

Comments
 (0)