-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(cli): fix cli failing on optional deps and get rid of unnecesssar…
…y module loading (#111)
- Loading branch information
1 parent
d61725f
commit 17d7b3d
Showing
6 changed files
with
36 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,21 @@ | ||
# pylint: disable=import-outside-toplevel | ||
import typer | ||
|
||
from .prompt.lab.app import lab_app | ||
from .prompt.promptfoo import generate_configs | ||
|
||
prompts_app = typer.Typer(no_args_is_help=True) | ||
|
||
|
||
def register(app: typer.Typer) -> None: | ||
def register(app: typer.Typer, help_only: bool) -> None: | ||
""" | ||
Register the CLI commands for the package. | ||
Args: | ||
app: The Typer object to register the commands with. | ||
help_only: A boolean indicating whether it is a help-only run. | ||
""" | ||
prompts_app.command(name="lab")(lab_app) | ||
prompts_app.command(name="generate-promptfoo-configs")(generate_configs) | ||
if not help_only: | ||
from .prompt.lab.app import lab_app | ||
from .prompt.promptfoo import generate_configs | ||
|
||
prompts_app.command(name="lab")(lab_app) | ||
prompts_app.command(name="generate-promptfoo-configs")(generate_configs) | ||
app.add_typer(prompts_app, name="prompts", help="Commands for managing prompts") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters