Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 20 additions & 2 deletions api/py/ai/chronon/repo/zipline.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import os
import click

from ai.chronon.repo.compile import extract_and_convert
from ai.chronon.cli.compile.compile_context import CompileContext
from ai.chronon.cli.compile.compiler import Compiler
from ai.chronon.repo.run import main as run_main


Expand All @@ -9,5 +11,21 @@ def zipline():
pass


zipline.add_command(extract_and_convert)
@click.command(name="compile")
def compile():
# check that a "teams.py" file exists in the current directory
if not os.path.exists("teams.py") or not os.path.exists("team.json"):
raise click.ClickException(
(
"teams.py or teams.json file not found in current directory."
" Please run from the top level of conf directory."
)
)

compile_context = CompileContext()
compiler = Compiler(compile_context)
compiler.compile(compile_context)


zipline.add_command(compile)
zipline.add_command(run_main)