diff --git a/src/dspy_cli/commands/serve.py b/src/dspy_cli/commands/serve.py index 0a5ff8f..9c45798 100644 --- a/src/dspy_cli/commands/serve.py +++ b/src/dspy_cli/commands/serve.py @@ -9,7 +9,6 @@ import click -from dspy_cli.server.runner import main as runner_main from dspy_cli.utils.venv import ( detect_venv_python, has_package, @@ -118,6 +117,7 @@ def serve(port, host, logs_dir, reload, save_openapi, openapi_format, python, sy dspy-cli serve --python /path/to/venv/bin/python """ if system: + from dspy_cli.server.runner import main as runner_main runner_main( port=port, host=host, @@ -195,6 +195,7 @@ def serve(port, host, logs_dir, reload, save_openapi, openapi_format, python, sy _exec_clean(target_python, args) else: + from dspy_cli.server.runner import main as runner_main runner_main( port=port, host=host, diff --git a/tests/test_commands_smoke.py b/tests/test_commands_smoke.py index 636774f..d508541 100644 --- a/tests/test_commands_smoke.py +++ b/tests/test_commands_smoke.py @@ -96,7 +96,7 @@ def test_cli_e2e_smoke(runner, tmp_cwd, monkeypatch): def fake_runner_main(**kwargs): calls.update(kwargs) - monkeypatch.setattr("dspy_cli.commands.serve.runner_main", fake_runner_main) + monkeypatch.setattr("dspy_cli.server.runner.main", fake_runner_main) res = runner.invoke( main,