diff --git a/dvc/output.py b/dvc/output.py index 10f818fa9..3e86a4804 100644 --- a/dvc/output.py +++ b/dvc/output.py @@ -298,15 +298,6 @@ class Output: PARAM_PUSH = "push" PARAM_CLOUD = "cloud" - METRIC_SCHEMA = Any( - None, - bool, - { - PARAM_METRIC_TYPE: Any(str, None), - PARAM_METRIC_XPATH: Any(str, None), - }, - ) - DoesNotExistError: Type[DvcException] = OutputDoesNotExistError IsNotFileOrDirError: Type[DvcException] = OutputIsNotFileOrDirError IsStageFileError: Type[DvcException] = OutputIsStageFileError @@ -1417,7 +1408,6 @@ ARTIFACT_SCHEMA = { **CHECKSUMS_SCHEMA, **META_SCHEMA, Required(Output.PARAM_PATH): str, - Output.PARAM_PLOT: bool, Output.PARAM_PERSIST: bool, Output.PARAM_CLOUD: CLOUD_SCHEMA, } @@ -1433,7 +1423,6 @@ SCHEMA = { **ARTIFACT_SCHEMA, **ANNOTATION_SCHEMA, Output.PARAM_CACHE: bool, - Output.PARAM_METRIC: Output.METRIC_SCHEMA, Output.PARAM_REMOTE: str, Output.PARAM_PUSH: bool, Output.PARAM_FILES: [DIR_FILES_SCHEMA], diff --git a/tests/func/test_repro.py b/tests/func/test_repro.py index a3953a2a5..08ced290c 100644 --- a/tests/func/test_repro.py +++ b/tests/func/test_repro.py @@ -639,31 +639,36 @@ def test_repro_metrics_add_unchanged(tmp_dir, dvc, copy_script): assert len(stages) == 1 assert stages[0] is not None - file1 = "file1" - file1_stage = file1 + ".dvc" dvc.run( - fname=file1_stage, - outs_no_cache=[file1], + outs_no_cache=["file1"], deps=["foo", "copy.py"], - cmd=f"python copy.py foo {file1}", - single_stage=True, + cmd="python copy.py foo file1", + name="copy", ) - stages = dvc.reproduce(file1_stage) + stages = dvc.reproduce("copy") assert len(stages) == 0 - d = load_yaml(file1_stage) - d["outs"][0]["metric"] = True - dump_yaml(file1_stage, d) + dvc.stage.add( + metrics_no_cache=["file1"], + deps=["foo", "copy.py"], + cmd="python copy.py foo file1", + name="copy", + force=True, + ) - stages = dvc.reproduce(file1_stage) + stages = dvc.reproduce("copy") assert len(stages) == 0 - d = load_yaml(file1_stage) - d["outs"][0]["metric"] = False - dump_yaml(file1_stage, d) + dvc.stage.add( + outs_no_cache=["file1"], + deps=["foo", "copy.py"], + cmd="python copy.py foo file1", + name="copy", + force=True, + ) - stages = dvc.reproduce(file1_stage) + stages = dvc.reproduce("copy") assert len(stages) == 0