Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dvc: standard way to refer to DVC-files #2103

Merged
merged 1 commit into from
Jun 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dvc/command/add.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def add_parser(subparsers, parent_parser):
help="Don't put files/directories into cache.",
)
add_parser.add_argument(
"-f", "--file", help="Specify name of the DVC file it generates."
"-f", "--file", help="Specify name of the DVC-file it generates."
)
add_parser.add_argument(
"targets", nargs="+", help="Input files/directories."
Expand Down
2 changes: 1 addition & 1 deletion dvc/command/checkout.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,5 @@ def add_parser(subparsers, parent_parser):
default=False,
help="Checkout all subdirectories of the specified directory.",
)
checkout_parser.add_argument("targets", nargs="*", help="DVC files.")
checkout_parser.add_argument("targets", nargs="*", help="DVC-files.")
checkout_parser.set_defaults(func=CmdCheckout)
4 changes: 2 additions & 2 deletions dvc/command/commit.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def run(self):


def add_parser(subparsers, parent_parser):
COMMIT_HELP = "Save changed data to cache and update DVC files."
COMMIT_HELP = "Save changed data to cache and update DVC-files."

commit_parser = subparsers.add_parser(
"commit",
Expand Down Expand Up @@ -65,6 +65,6 @@ def add_parser(subparsers, parent_parser):
help="Commit cache for subdirectories of the specified directory.",
)
commit_parser.add_argument(
"targets", nargs="*", default=None, help="DVC files."
"targets", nargs="*", default=None, help="DVC-files."
)
commit_parser.set_defaults(func=CmdCommit)
2 changes: 1 addition & 1 deletion dvc/command/data_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def shared_parent_parser():
help="Show checksums instead of file names.",
)
shared_parent_parser.add_argument(
"targets", nargs="*", default=None, help="DVC files."
"targets", nargs="*", default=None, help="DVC-files."
)

return shared_parent_parser
Expand Down
2 changes: 1 addition & 1 deletion dvc/command/destroy.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def run_cmd(self):


def add_parser(subparsers, parent_parser):
DESTROY_HELP = "Remove DVC files, local DVC config and data cache."
DESTROY_HELP = "Remove DVC-files, local DVC config and data cache."

destroy_parser = subparsers.add_parser(
"destroy",
Expand Down
2 changes: 1 addition & 1 deletion dvc/command/imp.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,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 it generates."
"-f", "--file", help="Specify name of the DVC-file it generates."
)
import_parser.set_defaults(func=CmdImport)
8 changes: 4 additions & 4 deletions dvc/command/lock.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,24 +37,24 @@ def run(self):


def add_parser(subparsers, parent_parser):
LOCK_HELP = "Lock DVC file."
LOCK_HELP = "Lock DVC-file."
lock_parser = subparsers.add_parser(
"lock",
parents=[parent_parser],
description=append_doc_link(LOCK_HELP, "lock"),
help=LOCK_HELP,
formatter_class=argparse.RawDescriptionHelpFormatter,
)
lock_parser.add_argument("targets", nargs="+", help="DVC files.")
lock_parser.add_argument("targets", nargs="+", help="DVC-files.")
lock_parser.set_defaults(func=CmdLock)

UNLOCK_HELP = "Unlock DVC file."
UNLOCK_HELP = "Unlock DVC-file."
unlock_parser = subparsers.add_parser(
"unlock",
parents=[parent_parser],
description=append_doc_link(UNLOCK_HELP, "unlock"),
help=UNLOCK_HELP,
formatter_class=argparse.RawDescriptionHelpFormatter,
)
unlock_parser.add_argument("targets", nargs="+", help="DVC files.")
unlock_parser.add_argument("targets", nargs="+", help="DVC-files.")
unlock_parser.set_defaults(func=CmdUnlock)
2 changes: 1 addition & 1 deletion dvc/command/move.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def add_parser(subparsers, parent_parser):
MOVE_HELP = "Rename or move a DVC controlled data file or a directory."
MOVE_DESCRIPTION = (
"Rename or move a DVC controlled data file or a directory.\n"
"It renames and modifies the corresponding DVC file to reflect the"
"It renames and modifies the corresponding DVC-file to reflect the"
" changes."
)

Expand Down
6 changes: 3 additions & 3 deletions dvc/command/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,14 +209,14 @@ def add_parser(subparsers, parent_parser):
"--commands",
action="store_true",
default=False,
help="Print commands instead of paths to DVC files.",
help="Print commands instead of paths to DVC-files.",
)
pipeline_show_group.add_argument(
"-o",
"--outs",
action="store_true",
default=False,
help="Print output files instead of paths to DVC files.",
help="Print output files instead of paths to DVC-files.",
)
pipeline_show_parser.add_argument(
"-l",
Expand Down Expand Up @@ -244,7 +244,7 @@ def add_parser(subparsers, parent_parser):
help="Output DAG as Dependencies Tree.",
)
pipeline_show_parser.add_argument(
"targets", nargs="*", help="DVC files. 'Dvcfile' by default."
"targets", nargs="*", help="DVC-files. 'Dvcfile' by default."
)
pipeline_show_parser.set_defaults(func=CmdPipelineShow)

Expand Down
8 changes: 4 additions & 4 deletions dvc/command/remove.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def run(self):


def add_parser(subparsers, parent_parser):
REMOVE_HELP = "Remove outputs of DVC file."
REMOVE_HELP = "Remove outputs of DVC-file."
remove_parser = subparsers.add_parser(
"remove",
parents=[parent_parser],
Expand All @@ -57,14 +57,14 @@ def add_parser(subparsers, parent_parser):
"--outs",
action="store_true",
default=True,
help="Only remove DVC file outputs. (Default)",
help="Only remove DVC-file outputs. (Default)",
)
remove_parser_group.add_argument(
"-p",
"--purge",
action="store_true",
default=False,
help="Remove DVC file and all its outputs.",
help="Remove DVC-file and all its outputs.",
)
remove_parser.add_argument(
"-f",
Expand All @@ -73,5 +73,5 @@ def add_parser(subparsers, parent_parser):
default=False,
help="Force purge.",
)
remove_parser.add_argument("targets", nargs="+", help="DVC files.")
remove_parser.add_argument("targets", nargs="+", help="DVC-files.")
remove_parser.set_defaults(func=CmdRemove)
4 changes: 2 additions & 2 deletions dvc/command/repro.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def run(self):


def add_parser(subparsers, parent_parser):
REPRO_HELP = "Check for changes and reproduce DVC file and dependencies."
REPRO_HELP = "Check for changes and reproduce DVC-file and dependencies."
repro_parser = subparsers.add_parser(
"repro",
parents=[parent_parser],
Expand All @@ -69,7 +69,7 @@ def add_parser(subparsers, parent_parser):
repro_parser.add_argument(
"targets",
nargs="*",
help="DVC file to reproduce (default - 'Dvcfile').",
help="DVC-file to reproduce (default - 'Dvcfile').",
)
repro_parser.add_argument(
"-f",
Expand Down
4 changes: 2 additions & 2 deletions dvc/command/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def add_parser(subparsers, parent_parser):
"(do not put into DVC cache).",
)
run_parser.add_argument(
"-f", "--file", help="Specify name of the DVC file it generates."
"-f", "--file", help="Specify name of the DVC-file it generates."
)
run_parser.add_argument(
"-c", "--cwd", default=None, help="Deprecated, use -w and -f instead."
Expand Down Expand Up @@ -155,7 +155,7 @@ def add_parser(subparsers, parent_parser):
"--overwrite-dvcfile",
action="store_true",
default=False,
help="Overwrite existing dvc file without asking for confirmation.",
help="Overwrite existing DVC-file without asking for confirmation.",
)
run_parser.add_argument(
"--ignore-build-cache",
Expand Down
12 changes: 6 additions & 6 deletions dvc/command/tag.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,14 @@ def add_parser(subparsers, parent_parser):
)
tag_add_parser.add_argument("tag", help="Dvc tag.")
tag_add_parser.add_argument(
"targets", nargs="*", default=[None], help="Dvc files."
"targets", nargs="*", default=[None], help="DVC-files."
)
tag_add_parser.add_argument(
"-d",
"--with-deps",
action="store_true",
default=False,
help="Add tag for all dependencies of the specified DVC file.",
help="Add tag for all dependencies of the specified DVC-file.",
)
tag_add_parser.add_argument(
"-R",
Expand All @@ -109,14 +109,14 @@ def add_parser(subparsers, parent_parser):
)
tag_remove_parser.add_argument("tag", help="Dvc tag.")
tag_remove_parser.add_argument(
"targets", nargs="*", default=[None], help="Dvc files."
"targets", nargs="*", default=[None], help="DVC-files."
)
tag_remove_parser.add_argument(
"-d",
"--with-deps",
action="store_true",
default=False,
help="Remove tag for all dependencies of the specified DVC file.",
help="Remove tag for all dependencies of the specified DVC-file.",
)
tag_remove_parser.add_argument(
"-R",
Expand All @@ -135,14 +135,14 @@ def add_parser(subparsers, parent_parser):
help=TAG_LIST_HELP,
)
tag_list_parser.add_argument(
"targets", nargs="*", default=[None], help="Dvc files."
"targets", nargs="*", default=[None], help="DVC-files."
)
tag_list_parser.add_argument(
"-d",
"--with-deps",
action="store_true",
default=False,
help="List tags for all dependencies of the specified DVC file.",
help="List tags for all dependencies of the specified DVC-file.",
)
tag_list_parser.add_argument(
"-R",
Expand Down
2 changes: 1 addition & 1 deletion dvc/repo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ def used_cache(
for stage in stages:
if active and not target and stage.locked:
logger.warning(
"DVC file '{path}' is locked. Its dependencies are"
"DVC-file '{path}' is locked. Its dependencies are"
" not going to be pushed/pulled/fetched.".format(
path=stage.relpath
)
Expand Down
2 changes: 1 addition & 1 deletion dvc/repo/checkout.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def checkout(self, target=None, with_deps=False, force=False, recursive=False):
for stage in stages:
if stage.locked:
logger.warning(
"DVC file '{path}' is locked. Its dependencies are"
"DVC-file '{path}' is locked. Its dependencies are"
" not going to be checked out.".format(path=stage.relpath)
)

Expand Down
2 changes: 1 addition & 1 deletion dvc/repo/reproduce.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def _reproduce_stage(stages, node, force, dry, interactive, no_commit):

if stage.locked:
logger.warning(
"DVC file '{path}' is locked. Its dependencies are"
"DVC-file '{path}' is locked. Its dependencies are"
" not going to be reproduced.".format(path=stage.relpath)
)

Expand Down
2 changes: 1 addition & 1 deletion dvc/repo/status.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def _local_status(self, target=None, with_deps=False):
for stage in stages:
if stage.locked:
logger.warning(
"DVC file '{path}' is locked. Its dependencies are"
"DVC-file '{path}' is locked. Its dependencies are"
" not going to be shown in the status output.".format(
path=stage.relpath
)
Expand Down
8 changes: 4 additions & 4 deletions dvc/stage.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def __init__(self, relpath):

class StageFileIsNotDvcFileError(DvcException):
def __init__(self, fname):
msg = "'{}' is not a dvc file".format(fname)
msg = "'{}' is not a DVC-file".format(fname)

sname = fname + Stage.STAGE_FILE_SUFFIX
if Stage.is_stage_file(sname):
Expand Down Expand Up @@ -218,7 +218,7 @@ def _changed_deps(self):

if self.is_callback:
logger.warning(
"Dvc file '{fname}' is a 'callback' stage "
"DVC-file '{fname}' is a 'callback' stage "
"(has a command and no dependencies) and thus always "
"considered as changed.".format(fname=self.relpath)
)
Expand Down Expand Up @@ -253,7 +253,7 @@ def _changed_outs(self):

def _changed_md5(self):
if self.changed_md5():
logger.warning("Dvc file '{}' changed.".format(self.relpath))
logger.warning("DVC-file '{}' changed.".format(self.relpath))
return True
return False

Expand Down Expand Up @@ -583,7 +583,7 @@ def load(repo, fname):

# it raises the proper exceptions by priority:
# 1. when the file doesn't exists
# 2. filename is not a dvc filename
# 2. filename is not a DVC-file
# 3. path doesn't represent a regular file
Stage._check_file_exists(repo, fname)
Stage._check_dvc_filename(fname)
Expand Down
24 changes: 12 additions & 12 deletions scripts/completion/dvc.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -15,28 +15,28 @@ _dvc_commands() {
"add:Take data files or directories under DVC control."
"cache:Manage cache settings."
"checkout:Checkout data files from cache."
"commit:Save changed data to cache and update DVC files."
"commit:Save changed data to cache and update DVC-files."
"config:Get or set config settings."
"destroy:Remove DVC files, local DVC config and data cache."
"destroy:Remove DVC-files, local DVC config and data cache."
"diff:Show a diff of a DVC controlled data file or a directory."
"fetch:Fetch data files from a DVC remote storage."
"gc:Collect unused data from DVC cache or a remote storage."
"import:Download or copy files from URL and take under DVC control."
"init:Initialize DVC in the current directory."
"install:Install DVC git hooks into the repository."
"lock:Lock DVC file."
"lock:Lock DVC-file."
"metrics:Commands to add, manage, collect and display metrics."
"move:Rename or move a DVC controlled data file or a directory."
"pipeline:Manage pipelines."
"pull:Pull data files from a DVC remote storage."
"push:Push data files to a DVC remote storage."
"remote:Manage remote storage configuration."
"remove:Remove outputs of DVC file."
"repro:Check for changes and reproduce DVC file and dependencies."
"remove:Remove outputs of DVC-file."
"repro:Check for changes and reproduce DVC-file and dependencies."
"root:Relative path to project's directory."
"run:Generate a stage file from a command and execute the command."
"status:Show changed stages, compare local cache and a remote storage."
"unlock:Unlock DVC file."
"unlock:Unlock DVC-file."
"unprotect:Unprotect data file/directory."
"version:Show DVC version and system/environment informaion."
)
Expand All @@ -58,7 +58,7 @@ _dvc_global_options=(
_dvc_add=(
{-R,--recursive}"[Recursively add each file under the directory.]"
"--no-commit[Don't put files/directories into cache.]"
{-f,--file}"[Specify name of the DVC file it generates.]:File:_files"
{-f,--file}"[Specify name of the DVC-file it generates.]:File:_files"
"1:File:_files"
)

Expand Down Expand Up @@ -118,7 +118,7 @@ _dvc_gc=(

_dvc_import=(
"--resume[Resume previously started download.]"
{-f,--file}"[Specify name of the DVC file it generates.]:File:_files"
{-f,--file}"[Specify name of the DVC-file it generates.]:File:_files"
"1:URL:"
"2:Output:"
)
Expand Down Expand Up @@ -177,8 +177,8 @@ _dvc_remote=(
_dvc_remove=(
"*:Stages:_files -g '(*.dvc|Dvcfile)'"
"--dry[Only print the commands that would be executed without actually executing]"
{-o,--outs}"[Only remove DVC file outputs. (Default)]"
{-p,--purge}"[Remove DVC file and all its outputs.]"
{-o,--outs}"[Only remove DVC-file outputs. (Default)]"
{-p,--purge}"[Remove DVC-file and all its outputs.]"
{-f,--force}"[Force purge.]"
)

Expand Down Expand Up @@ -206,12 +206,12 @@ _dvc_run=(
"*"{-O,--outs-no-cache}"[Declare output file or directory (do not put into DVC cache).]:Output regular:_files"
"*"{-m,--metrics}"[Declare output metric file or directory.]:Metrics:_files"
"*"{-M,--metrics-no-cache}"[Declare output metric file or directory (do not put into DVC cache).]:Metrics (no cache):_files"
{-f,--file}"[Specify name of the DVC file it generates.]:File:_files"
{-f,--file}"[Specify name of the DVC-file it generates.]:File:_files"
{-c,--cwd}"[Deprecated, use -w and -f instead.]:CWD:_files -/"
{-w,--wdir}"[Directory within your repo to run your command in.]:WDIR:_files -/"
"--no-exec[Only create stage file without actually running it.]"
{-y,--yes}"[Deprecated, use --overwrite-dvcfile instead]"
"--overwrite-dvcfile[Overwrite existing dvc file without asking for confirmation.]"
"--overwrite-dvcfile[Overwrite existing DVC-file without asking for confirmation.]"
"--ignore-build-cache[Run this stage even if it has been already ran with the same command/dependencies/outputs/etc before.]"
"--remove-outs[Deprecated, this is now the default behavior]"
"--no-commit[Don't put files/directories into cache.]"
Expand Down