From 91a7194e4f7ffea1fca8e684bb70de4cfb36a21b Mon Sep 17 00:00:00 2001 From: Ruslan Kuprieiev Date: Wed, 10 Jun 2020 05:04:55 +0300 Subject: [PATCH] add/run/import-url: don't use -f as --file (#4004) If anything, `-f` is closer to `--force` than to `--file`. So let's set this straight. --- dvc/command/add.py | 1 - dvc/command/imp_url.py | 1 - dvc/command/run.py | 1 - tests/func/test_add.py | 8 ++++---- tests/func/test_cli.py | 2 -- tests/func/test_import_url.py | 6 ------ tests/func/test_repro.py | 4 ++-- tests/func/test_run_single_stage.py | 8 ++++---- 8 files changed, 10 insertions(+), 21 deletions(-) diff --git a/dvc/command/add.py b/dvc/command/add.py index 18daa4573a..cb5199c23a 100644 --- a/dvc/command/add.py +++ b/dvc/command/add.py @@ -57,7 +57,6 @@ def add_parser(subparsers, parent_parser): help="Allow targets that are outside of the DVC repository.", ) parser.add_argument( - "-f", "--file", help="Specify name of the DVC-file this command will generate.", metavar="", diff --git a/dvc/command/imp_url.py b/dvc/command/imp_url.py index b7397560d8..d547fa0351 100644 --- a/dvc/command/imp_url.py +++ b/dvc/command/imp_url.py @@ -57,7 +57,6 @@ def add_parser(subparsers, parent_parser): "out", nargs="?", help="Destination path to put files to." ) import_parser.add_argument( - "-f", "--file", help="Specify name of the DVC-file this command will generate.", metavar="", diff --git a/dvc/command/run.py b/dvc/command/run.py index 8b3e856dc6..6c2be979ec 100644 --- a/dvc/command/run.py +++ b/dvc/command/run.py @@ -159,7 +159,6 @@ def add_parser(subparsers, parent_parser): metavar="", ) run_parser.add_argument( - "-f", "--file", help="Specify name of the DVC-file this command will generate.", metavar="", diff --git a/tests/func/test_add.py b/tests/func/test_add.py index 687a2c3065..f88564420f 100644 --- a/tests/func/test_add.py +++ b/tests/func/test_add.py @@ -449,20 +449,20 @@ def test(self): class TestAddFilename(TestDvc): def test(self): - ret = main(["add", self.FOO, self.BAR, "-f", "error.dvc"]) + ret = main(["add", self.FOO, self.BAR, "--file", "error.dvc"]) self.assertNotEqual(0, ret) - ret = main(["add", "-R", self.DATA_DIR, "-f", "error.dvc"]) + ret = main(["add", "-R", self.DATA_DIR, "--file", "error.dvc"]) self.assertNotEqual(0, ret) with self.assertRaises(RecursiveAddingWhileUsingFilename): self.dvc.add(self.DATA_DIR, recursive=True, fname="error.dvc") - ret = main(["add", self.DATA_DIR, "-f", "data_directory.dvc"]) + ret = main(["add", self.DATA_DIR, "--file", "data_directory.dvc"]) self.assertEqual(0, ret) self.assertTrue(os.path.exists("data_directory.dvc")) - ret = main(["add", self.FOO, "-f", "bar.dvc"]) + ret = main(["add", self.FOO, "--file", "bar.dvc"]) self.assertEqual(0, ret) self.assertTrue(os.path.exists("bar.dvc")) self.assertFalse(os.path.exists("foo.dvc")) diff --git a/tests/func/test_cli.py b/tests/func/test_cli.py index 970be53378..ef1c8db159 100644 --- a/tests/func/test_cli.py +++ b/tests/func/test_cli.py @@ -53,8 +53,6 @@ def test(self): out_no_cache1, "--outs-no-cache", out_no_cache2, - "-f", - fname, "--file", fname, cmd, diff --git a/tests/func/test_import_url.py b/tests/func/test_import_url.py index 0469be9bbe..4157df3b55 100644 --- a/tests/func/test_import_url.py +++ b/tests/func/test_import_url.py @@ -58,12 +58,6 @@ def setUp(self): fobj.write("content") def test(self): - ret = main(["import-url", "-f", "bar.dvc", self.external_source]) - self.assertEqual(0, ret) - self.assertTrue(os.path.exists("bar.dvc")) - - os.remove("bar.dvc") - ret = main(["import-url", "--file", "bar.dvc", self.external_source]) self.assertEqual(0, ret) self.assertTrue(os.path.exists("bar.dvc")) diff --git a/tests/func/test_repro.py b/tests/func/test_repro.py index 641050509a..473bd46db1 100644 --- a/tests/func/test_repro.py +++ b/tests/func/test_repro.py @@ -411,7 +411,7 @@ def test(self): "run", "--no-exec", "--single-stage", - "-f", + "--file", DVC_FILE, *deps, "ls {}".format( @@ -818,7 +818,7 @@ def test(self): [ "run", "--single-stage", - "-f", + "--file", f"{dname}/Dvcfile", "-w", f"{dname}", diff --git a/tests/func/test_run_single_stage.py b/tests/func/test_run_single_stage.py index b92b9bc82e..04c30bf6e1 100644 --- a/tests/func/test_run_single_stage.py +++ b/tests/func/test_run_single_stage.py @@ -504,7 +504,7 @@ def test(self): self.CODE, "-o", "out", - "-f", + "--file", "out.dvc", "--single-stage", "python", @@ -528,7 +528,7 @@ def test(self): self.CODE, "-o", "out", - "-f", + "--file", "out.dvc", "--single-stage", "python", @@ -557,7 +557,7 @@ def test(self): "--single-stage", "-o", "out", - "-f", + "--file", "out.dvc", "python", self.CODE, @@ -578,7 +578,7 @@ def test(self): "run", "--overwrite", "--single-stage", - "-f", + "--file", "out.dvc", "-d", self.BAR,