Skip to content

Commit 8442424

Browse files
authored
Rename pipeline generate command to compile, fix per-character alias bug (#1028)
1 parent fd36387 commit 8442424

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

clarifai/cli/pipeline.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,20 +120,20 @@ def upload(path, no_lockfile):
120120
upload_pipeline(path, no_lockfile=no_lockfile)
121121

122122

123-
@pipeline.command('generate')
123+
@pipeline.command()
124124
@click.argument('path', type=click.Path(exists=True), required=True)
125125
@click.option(
126126
'--output-dir',
127127
type=click.Path(),
128128
required=True,
129-
help='Directory to write the generated pipeline config and step folders.',
129+
help='Directory to write the compiled pipeline config and step folders.',
130130
)
131-
def generate(path, output_dir):
132-
"""Generate YAML/config-based pipeline assets from a Python pipeline definition."""
131+
def compile(path, output_dir):
132+
"""Compile YAML/config-based pipeline assets from a Python pipeline definition."""
133133
from clarifai.runners.pipelines import load_pipeline_from_file
134134

135135
if not os.path.isfile(path) or not path.endswith('.py'):
136-
raise click.UsageError('clarifai pipeline generate expects a Python file path.')
136+
raise click.UsageError('clarifai pipeline compile expects a Python file path.')
137137

138138
pipeline_obj = load_pipeline_from_file(path)
139139
config_path = pipeline_obj.generate(output_dir)

tests/cli/test_pipeline_dsl_cli.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import yaml
55
from click.testing import CliRunner
66

7-
from clarifai.cli.pipeline import generate, upload
7+
from clarifai.cli.pipeline import compile, upload
88

99

1010
def test_upload_python_pipeline_file_generates_and_uploads_directory(tmp_path: Path):
@@ -40,7 +40,7 @@ def test_generate_python_pipeline_file_writes_output(tmp_path: Path):
4040
mock_pipeline.generate.return_value = str(output_dir / 'config.yaml')
4141
mock_loader.return_value = mock_pipeline
4242

43-
result = runner.invoke(generate, [str(pipeline_file), '--output-dir', str(output_dir)])
43+
result = runner.invoke(compile, [str(pipeline_file), '--output-dir', str(output_dir)])
4444

4545
assert result.exit_code == 0
4646
mock_loader.assert_called_once_with(str(pipeline_file))
@@ -53,7 +53,7 @@ def test_generate_real_example_pipeline_writes_mixed_step_config(tmp_path: Path)
5353
output_dir = tmp_path / 'generated'
5454
runner = CliRunner()
5555

56-
result = runner.invoke(generate, [str(pipeline_file), '--output-dir', str(output_dir)])
56+
result = runner.invoke(compile, [str(pipeline_file), '--output-dir', str(output_dir)])
5757

5858
assert result.exit_code == 0, result.output
5959

0 commit comments

Comments
 (0)