Skip to content
This repository has been archived by the owner on Sep 13, 2023. It is now read-only.

Release 0.3.0 #397

Merged
merged 21 commits into from
Oct 27, 2022
Merged
Show file tree
Hide file tree
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
Prev Previous commit
Next Next commit
Merge branch 'main' into release/0.3.0
# Conflicts:
#	mlem/cli/main.py
#	tests/cli/test_deployment.py
#	tests/cli/test_serve.py
  • Loading branch information
mike0sv committed Sep 19, 2022
commit f3340135a253d39776bc059a08a3ab4c782a2115
6 changes: 3 additions & 3 deletions mlem/cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -429,22 +429,22 @@ def inner(*iargs, **ikwargs):
error = f"{e.__class__.__module__}.{e.__class__.__name__}"
if ctx.obj["traceback"]:
raise
with cli_echo():
with stderr_echo():
echo(EMOJI_FAIL + color(str(e), col=typer.colors.RED))
raise typer.Exit(1)
except ValidationError as e:
error = f"{e.__class__.__module__}.{e.__class__.__name__}"
if ctx.obj["traceback"]:
raise
msgs = "\n".join(_format_validation_error(e))
with cli_echo():
with stderr_echo():
echo(EMOJI_FAIL + color("Error:\n", "red") + msgs)
raise typer.Exit(1)
except Exception as e: # pylint: disable=broad-except
error = f"{e.__class__.__module__}.{e.__class__.__name__}"
if ctx.obj["traceback"]:
raise
with cli_echo():
with stderr_echo():
echo(
EMOJI_FAIL
+ color(
Expand Down
12 changes: 10 additions & 2 deletions tests/cli/test_deployment.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,11 @@ def test_deploy_create_existing(runner: Runner, mock_deploy_path):
result = runner.invoke(
f"deploy run {mock_deploy_path}".split(), raise_on_error=True
)
assert result.exit_code == 0, result.output
assert result.exit_code == 0, (
result.stdout,
result.stderr,
result.exception,
)
meta = load_meta(mock_deploy_path)
assert isinstance(meta, MlemDeploymentMock)
assert meta.param == "bbb"
Expand Down Expand Up @@ -271,7 +275,11 @@ def test_deploy_apply(
result = runner.invoke(
f"deploy apply {mock_deploy_path} {data_path} -o {path}".split()
)
assert result.exit_code == 0, (result.output, result.exception)
assert result.exit_code == 0, (
result.stdout,
result.stderr,
result.exception,
)
meta = load_meta(mock_deploy_path)
assert isinstance(meta, MlemDeploymentMock)
assert meta.status == DeployStatus.NOT_DEPLOYED
Expand Down
8 changes: 6 additions & 2 deletions tests/cli/test_serve.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,9 @@ def serve(self, interface: Interface):

def test_serve(runner: Runner, model_single_path):
result = runner.invoke(f"serve mock -m {model_single_path} --param aaa")
assert result.exit_code == 0, result.exception
assert result.output.splitlines()[-1] == "aaa"
assert result.exit_code == 0, (
result.stdout,
result.stderr,
result.exception,
)
assert result.stdout.splitlines()[-1] == "aaa"
You are viewing a condensed version of this merge commit. You can view the full changes here.