Skip to content

Commit

Permalink
address @dmitry's comments
Browse files Browse the repository at this point in the history
  • Loading branch information
skshetry committed May 25, 2020
1 parent fce08fa commit eedd9cd
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
8 changes: 4 additions & 4 deletions dvc/dvcfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ def _dump_pipeline_file(self, stage):
with open(self.path) as fd:
data = parse_stage_for_update(fd.read(), self.path)
else:
logger.info("'%s' does not exist, creating…", self.relpath)
logger.info("Creating '%s'", self.relpath)
open(self.path, "w+").close()

data["stages"] = data.get("stages", {})
Expand All @@ -209,7 +209,7 @@ def _dump_pipeline_file(self, stage):
data["stages"].update(stage_data)

logger.info(
"Adding stage '%s' to '%s'", stage.name, self.relpath,
"Adding stage '%s' to '%s'", stage.name, self.relpath,
)
dump_stage_file(self.path, data)
self.repo.scm.track_file(relpath(self.path))
Expand Down Expand Up @@ -255,7 +255,7 @@ def dump(self, stage, **kwargs):
stage_data = serialize.to_lockfile(stage)
if not self.exists():
modified = True
logger.info("Generating lock file…")
logger.info("Generating lock file '%s'", self.relpath)
data = stage_data
open(self.path, "w+").close()
else:
Expand All @@ -265,7 +265,7 @@ def dump(self, stage, **kwargs):
stage.name, {}
)
if modified:
logger.info("Updating lock file…")
logger.info("Updating lock file '%s'", self.relpath)
data.update(stage_data)
dump_stage_file(self.path, data)
if modified:
Expand Down
7 changes: 4 additions & 3 deletions dvc/repo/reproduce.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,10 @@ def _reproduce_stages(

force_downstream = kwargs.pop("force_downstream", False)
result = []
for idx, stage in enumerate(pipeline):
if idx != 0:
# Cosmetic newline
# `ret` is used to add a cosmetic newline.
ret = []
for stage in pipeline:
if ret:
logger.info("")

try:
Expand Down
4 changes: 2 additions & 2 deletions dvc/stage/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def create_stage(cls, repo, path, **kwargs):
logger.warning("Build cache is ignored when persisting outputs.")

if not ignore_run_cache and stage.can_be_skipped:
logger.info("Stage is cached, skipping")
logger.info("Stage is cached, skipping")
return None

return stage
Expand Down Expand Up @@ -294,7 +294,7 @@ def remove(self, force=False, remove_outs=True):
@rwlocked(read=["deps"], write=["outs"])
def reproduce(self, interactive=False, **kwargs):
if not (kwargs.get("force", False) or self.changed()):
logger.info("Stage '%s' didn't change, skipping", self.addressing)
logger.info("Stage '%s' didn't change, skipping", self.addressing)
return None

msg = (
Expand Down
7 changes: 3 additions & 4 deletions dvc/stage/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def _is_cached(stage):
and stage.already_cached()
)
if cached:
logger.info("Stage '%s' is cached, skipping…", stage.addressing)
logger.info("Stage '%s' is cached", stage.addressing)
return cached


Expand All @@ -98,9 +98,7 @@ def restored_from_cache(stage):
stage_cache.restore(stage)
restored = stage.outs_cached()
if restored:
logger.info(
"Restored stage '%s' from run-cache, skipping…", stage.addressing
)
logger.info("Restored stage '%s' from run-cache", stage.addressing)
return restored


Expand All @@ -110,6 +108,7 @@ def run_stage(stage, dry=False, force=False, run_cache=False):
run_cache and restored_from_cache(stage)
)
if stage_cached:
logger.info("Skipping run, checking out outputs")
stage.checkout()
return

Expand Down

0 comments on commit eedd9cd

Please sign in to comment.