Repository: iterative/dvc

Issue:
Remove repro/exp run `--metrics` flag



Discussion:

Resolving patch:
diff --git a/dvc/commands/experiments/run.py b/dvc/commands/experiments/run.py
--- a/dvc/commands/experiments/run.py
+++ b/dvc/commands/experiments/run.py
@@ -13,8 +13,6 @@
 
 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 @@ def run(self):
         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 @@ def run(self):
             **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
--- a/dvc/commands/repro.py
+++ b/dvc/commands/repro.py
@@ -16,12 +16,6 @@ def run(self):
         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
@@ -104,13 +98,6 @@ def add_arguments(repro_parser):
         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",


Test patch:
diff --git a/tests/func/test_repro.py b/tests/func/test_repro.py
--- a/tests/func/test_repro.py
+++ b/tests/func/test_repro.py
@@ -889,33 +889,6 @@ def test_force_import(self, mocker, tmp_dir, dvc):
         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: