diff --git a/dvc/command/base.py b/dvc/command/base.py index 21838a9227..6831335596 100644 --- a/dvc/command/base.py +++ b/dvc/command/base.py @@ -41,12 +41,12 @@ def __init__(self, args): @property def default_targets(self): - """Default targets for `dvc repro` and `dvc pipeline`.""" - from dvc.dvcfile import DVC_FILE + """Default targets for `dvc repro`.""" + from dvc.dvcfile import PIPELINE_FILE - msg = "assuming default target '{}'.".format(DVC_FILE) + msg = "assuming default target '{}'.".format(PIPELINE_FILE) logger.warning(msg) - return [DVC_FILE] + return [PIPELINE_FILE] # Abstract methods that have to be implemented by any inheritance class def run(self): diff --git a/dvc/command/pipeline.py b/dvc/command/pipeline.py index d788031660..77f525c311 100644 --- a/dvc/command/pipeline.py +++ b/dvc/command/pipeline.py @@ -119,8 +119,10 @@ def _write_dot(self, target, commands, outs): logger.info(dot_file.getvalue()) def run(self): + from dvc.dvcfile import DVC_FILE + if not self.args.targets: - self.args.targets = self.default_targets + self.args.targets = [DVC_FILE] for target in self.args.targets: try: diff --git a/tests/func/test_repro.py b/tests/func/test_repro.py index c0ba14c412..d2e5eb2552 100644 --- a/tests/func/test_repro.py +++ b/tests/func/test_repro.py @@ -28,7 +28,7 @@ from dvc.remote.local import LocalRemote from dvc.repo import Repo as DvcRepo from dvc.stage import Stage -from dvc.dvcfile import Dvcfile +from dvc.dvcfile import Dvcfile, DVC_FILE from dvc.stage.exceptions import StageFileDoesNotExistError from dvc.system import System from dvc.utils import file_md5 @@ -407,11 +407,11 @@ def test(self): self.assertEqual(ret, 0) ret = main( - ["run", "--no-exec", "--single-stage", "-f", "Dvcfile"] + deps + ["run", "--no-exec", "--single-stage", "-f", DVC_FILE] + deps ) self.assertEqual(ret, 0) - ret = main(["repro", "--dry"]) + ret = main(["repro", "--dry", DVC_FILE]) self.assertEqual(ret, 0) @@ -820,7 +820,7 @@ def test(self): os.unlink(bar) - ret = main(["repro", "-c", dname]) + ret = main(["repro", "-c", dname, DVC_FILE]) self.assertEqual(ret, 0) self.assertTrue(os.path.isfile(foo)) self.assertTrue(os.path.isfile(bar)) @@ -1458,7 +1458,7 @@ def repro_dir(tmp_dir, dvc, run_copy): assert dir_file_copy.read_text() == "dir file content" stages["dir_file_copy"] = stage - last_stage = tmp_dir / "dir" / "Dvcfile" + last_stage = tmp_dir / "dir" / DVC_FILE stage = dvc.run( fname=fspath(last_stage), deps=[fspath(origin_copy_2), fspath(dir_file_copy)], diff --git a/tests/unit/command/test_repro.py b/tests/unit/command/test_repro.py index dcdfdbe743..1e20a04cec 100644 --- a/tests/unit/command/test_repro.py +++ b/tests/unit/command/test_repro.py @@ -1,5 +1,6 @@ from dvc.cli import parse_args from dvc.command.repro import CmdRepro +from dvc.dvcfile import PIPELINE_FILE default_arguments = { "all_pipelines": False, @@ -19,7 +20,7 @@ def test_default_arguments(dvc, mocker): cmd = CmdRepro(parse_args(["repro"])) mocker.patch.object(cmd.repo, "reproduce") cmd.run() - cmd.repo.reproduce.assert_called_with("Dvcfile", **default_arguments) + cmd.repo.reproduce.assert_called_with(PIPELINE_FILE, **default_arguments) def test_downstream(dvc, mocker): @@ -28,4 +29,4 @@ def test_downstream(dvc, mocker): cmd.run() arguments = default_arguments.copy() arguments.update({"downstream": True}) - cmd.repo.reproduce.assert_called_with("Dvcfile", **arguments) + cmd.repo.reproduce.assert_called_with(PIPELINE_FILE, **arguments)