diff --git a/dvc/commands/experiments/run.py b/dvc/commands/experiments/run.py index 8cc1121ab..482995434 100644 --- a/dvc/commands/experiments/run.py +++ b/dvc/commands/experiments/run.py @@ -13,8 +13,6 @@ logger = logging.getLogger(__name__) class CmdExperimentsRun(CmdRepro): def run(self): - from dvc.compare import show_metrics - if self.args.checkpoint_resume: if self.args.reset: raise InvalidArgumentError("--reset and --rev are mutually exclusive.") @@ -26,7 +24,7 @@ class CmdExperimentsRun(CmdRepro): if self.args.reset: ui.write("Any existing checkpoints will be reset and re-run.") - results = self.repo.experiments.run( + self.repo.experiments.run( name=self.args.name, queue=self.args.queue, run_all=self.args.run_all, @@ -41,11 +39,6 @@ class CmdExperimentsRun(CmdRepro): **self._common_kwargs, ) - if self.args.metrics and results: - metrics = self.repo.metrics.show(revs=list(results)) - metrics.pop("workspace", None) - show_metrics(metrics) - return 0 @@ -149,7 +142,7 @@ def _add_run_common(parser): ), ) parser.add_argument( - "-M", + "-m", "--message", type=str, default=None, diff --git a/dvc/commands/repro.py b/dvc/commands/repro.py index e432ffe8f..f5fb50fff 100644 --- a/dvc/commands/repro.py +++ b/dvc/commands/repro.py @@ -16,12 +16,6 @@ class CmdRepro(CmdBase): else: ui.write("Use `dvc push` to send your updates to remote storage.") - if self.args.metrics: - from dvc.compare import show_metrics - - metrics = self.repo.metrics.show() - show_metrics(metrics) - return 0 @property @@ -105,13 +99,6 @@ and then the stage name name. default=False, help="Reproduce all stages in the specified directory.", ) - repro_parser.add_argument( - "-m", - "--metrics", - action="store_true", - default=False, - help="Show metrics after reproduction.", - ) repro_parser.add_argument( "--downstream", action="store_true", diff --git a/tests/func/test_repro.py b/tests/func/test_repro.py index df93a5496..2aa3edf97 100644 --- a/tests/func/test_repro.py +++ b/tests/func/test_repro.py @@ -889,33 +889,6 @@ class TestReproAlreadyCached: assert spy_checkout.call_count == 0 -def test_should_display_metrics_on_repro_with_metrics_option(caplog, capsys, dvc): - metrics_file = "metrics_file" - metrics_value = 0.123489015 - ret = main( - [ - "run", - "--single-stage", - "-m", - metrics_file, - f"echo {metrics_value} >> {metrics_file}", - ] - ) - assert ret == 0 - - caplog.clear() - capsys.readouterr() # clearing the buffer - - from dvc.dvcfile import DVC_FILE_SUFFIX - - ret = main(["repro", "--force", "--metrics", metrics_file + DVC_FILE_SUFFIX]) - assert ret == 0 - - expected_metrics_display = f"Path\n{metrics_file} {metrics_value}\n" - actual, _ = capsys.readouterr() - assert expected_metrics_display in actual - - @pytest.fixture def repro_dir(tmp_dir, dvc, run_copy): # Creates repo with following structure: