Skip to content

Commit

Permalink
args and envs
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshKarpel committed Jun 26, 2024
1 parent 24ef19f commit bf6b3d7
Show file tree
Hide file tree
Showing 7 changed files with 220 additions and 57 deletions.
2 changes: 1 addition & 1 deletion examples/dag.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ targets:
sleep-and-echo:
commands: |
sleep 2
echo "Hi!"
echo "Hi from {{ id }}!"
106 changes: 74 additions & 32 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ classifiers = [
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Software Development",
"Topic :: Utilities",
"Typing :: Typed",
Expand All @@ -39,6 +40,8 @@ pyyaml = ">=6.0"
networkx = ">=3.0"
watchfiles = ">=0.18"
identify = ">=2.5"
jinja2 = ">=3.1"
frozendict = ">=2.4"

[tool.poetry.group.dev.dependencies]
pre-commit = ">=3"
Expand Down
22 changes: 18 additions & 4 deletions synthesize/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def run(
help="The path to the configuration file to execute.",
),
dry: bool = Option(
False,
default=False,
help="If enabled, do not run actually run the flow.",
),
) -> None:
Expand Down Expand Up @@ -66,11 +66,25 @@ def run(
)
)

return

resolved = parsed_config.resolve()

controller = Orchestrator(flow=resolved[flow], console=console)
try:
selected_flow = resolved[flow]
except KeyError:
sep = "\n "
available_flows = sep + sep.join(resolved.keys())
console.print(

Check warning on line 76 in synthesize/cli.py

View check run for this annotation

Codecov / codecov/patch

synthesize/cli.py#L71-L76

Added lines #L71 - L76 were not covered by tests
Text(
f"No flow named '{flow}'. Available flows:{available_flows}",
style=Style(color="red"),
)
)
raise Exit(code=1)

Check warning on line 82 in synthesize/cli.py

View check run for this annotation

Codecov / codecov/patch

synthesize/cli.py#L82

Added line #L82 was not covered by tests

if dry:
return

Check warning on line 85 in synthesize/cli.py

View check run for this annotation

Codecov / codecov/patch

synthesize/cli.py#L85

Added line #L85 was not covered by tests

controller = Orchestrator(flow=selected_flow, console=console)

Check warning on line 87 in synthesize/cli.py

View check run for this annotation

Codecov / codecov/patch

synthesize/cli.py#L87

Added line #L87 was not covered by tests

try:
asyncio.run(controller.run())
Expand Down
Loading

0 comments on commit bf6b3d7

Please sign in to comment.