dvc: i/DVC file[s]?/ -> /DVC-file($1)/

Standardizes way to refer to DVC-file(s)

(Related to #2102)
This commit is contained in:
Jorge Orpinel
2019-06-07 03:33:20 -05:00
parent 1e7e2aaed5
commit 3dffe8e5c0
19 changed files with 49 additions and 49 deletions
+1 -1
View File
@@ -54,7 +54,7 @@ def add_parser(subparsers, parent_parser):
help="Don't put files/directories into cache.", help="Don't put files/directories into cache.",
) )
add_parser.add_argument( 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( add_parser.add_argument(
"targets", nargs="+", help="Input files/directories." "targets", nargs="+", help="Input files/directories."
+1 -1
View File
@@ -51,5 +51,5 @@ def add_parser(subparsers, parent_parser):
default=False, default=False,
help="Checkout all subdirectories of the specified directory.", 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) checkout_parser.set_defaults(func=CmdCheckout)
+2 -2
View File
@@ -34,7 +34,7 @@ class CmdCommit(CmdBase):
def add_parser(subparsers, parent_parser): 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_parser = subparsers.add_parser(
"commit", "commit",
@@ -65,6 +65,6 @@ def add_parser(subparsers, parent_parser):
help="Commit cache for subdirectories of the specified directory.", help="Commit cache for subdirectories of the specified directory.",
) )
commit_parser.add_argument( commit_parser.add_argument(
"targets", nargs="*", default=None, help="DVC files." "targets", nargs="*", default=None, help="DVC-files."
) )
commit_parser.set_defaults(func=CmdCommit) commit_parser.set_defaults(func=CmdCommit)
+1 -1
View File
@@ -113,7 +113,7 @@ def shared_parent_parser():
help="Show checksums instead of file names.", help="Show checksums instead of file names.",
) )
shared_parent_parser.add_argument( shared_parent_parser.add_argument(
"targets", nargs="*", default=None, help="DVC files." "targets", nargs="*", default=None, help="DVC-files."
) )
return shared_parent_parser return shared_parent_parser
+1 -1
View File
@@ -35,7 +35,7 @@ class CmdDestroy(CmdBase):
def add_parser(subparsers, parent_parser): 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_parser = subparsers.add_parser(
"destroy", "destroy",
+1 -1
View File
@@ -65,6 +65,6 @@ def add_parser(subparsers, parent_parser):
"out", nargs="?", help="Destination path to put files to." "out", nargs="?", help="Destination path to put files to."
) )
import_parser.add_argument( 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) import_parser.set_defaults(func=CmdImport)
+4 -4
View File
@@ -37,7 +37,7 @@ class CmdUnlock(CmdLockBase):
def add_parser(subparsers, parent_parser): def add_parser(subparsers, parent_parser):
LOCK_HELP = "Lock DVC file." LOCK_HELP = "Lock DVC-file."
lock_parser = subparsers.add_parser( lock_parser = subparsers.add_parser(
"lock", "lock",
parents=[parent_parser], parents=[parent_parser],
@@ -45,10 +45,10 @@ def add_parser(subparsers, parent_parser):
help=LOCK_HELP, help=LOCK_HELP,
formatter_class=argparse.RawDescriptionHelpFormatter, 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) lock_parser.set_defaults(func=CmdLock)
UNLOCK_HELP = "Unlock DVC file." UNLOCK_HELP = "Unlock DVC-file."
unlock_parser = subparsers.add_parser( unlock_parser = subparsers.add_parser(
"unlock", "unlock",
parents=[parent_parser], parents=[parent_parser],
@@ -56,5 +56,5 @@ def add_parser(subparsers, parent_parser):
help=UNLOCK_HELP, help=UNLOCK_HELP,
formatter_class=argparse.RawDescriptionHelpFormatter, 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) unlock_parser.set_defaults(func=CmdUnlock)
+1 -1
View File
@@ -27,7 +27,7 @@ def add_parser(subparsers, parent_parser):
MOVE_HELP = "Rename or move a DVC controlled data file or a directory." MOVE_HELP = "Rename or move a DVC controlled data file or a directory."
MOVE_DESCRIPTION = ( MOVE_DESCRIPTION = (
"Rename or move a DVC controlled data file or a directory.\n" "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." " changes."
) )
+3 -3
View File
@@ -209,14 +209,14 @@ def add_parser(subparsers, parent_parser):
"--commands", "--commands",
action="store_true", action="store_true",
default=False, 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( pipeline_show_group.add_argument(
"-o", "-o",
"--outs", "--outs",
action="store_true", action="store_true",
default=False, 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( pipeline_show_parser.add_argument(
"-l", "-l",
@@ -244,7 +244,7 @@ def add_parser(subparsers, parent_parser):
help="Output DAG as Dependencies Tree.", help="Output DAG as Dependencies Tree.",
) )
pipeline_show_parser.add_argument( 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) pipeline_show_parser.set_defaults(func=CmdPipelineShow)
+4 -4
View File
@@ -43,7 +43,7 @@ class CmdRemove(CmdBase):
def add_parser(subparsers, parent_parser): 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_parser = subparsers.add_parser(
"remove", "remove",
parents=[parent_parser], parents=[parent_parser],
@@ -57,14 +57,14 @@ def add_parser(subparsers, parent_parser):
"--outs", "--outs",
action="store_true", action="store_true",
default=True, default=True,
help="Only remove DVC file outputs. (Default)", help="Only remove DVC-file outputs. (Default)",
) )
remove_parser_group.add_argument( remove_parser_group.add_argument(
"-p", "-p",
"--purge", "--purge",
action="store_true", action="store_true",
default=False, default=False,
help="Remove DVC file and all its outputs.", help="Remove DVC-file and all its outputs.",
) )
remove_parser.add_argument( remove_parser.add_argument(
"-f", "-f",
@@ -73,5 +73,5 @@ def add_parser(subparsers, parent_parser):
default=False, default=False,
help="Force purge.", 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) remove_parser.set_defaults(func=CmdRemove)
+2 -2
View File
@@ -58,7 +58,7 @@ class CmdRepro(CmdBase):
def add_parser(subparsers, parent_parser): 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_parser = subparsers.add_parser(
"repro", "repro",
parents=[parent_parser], parents=[parent_parser],
@@ -69,7 +69,7 @@ def add_parser(subparsers, parent_parser):
repro_parser.add_argument( repro_parser.add_argument(
"targets", "targets",
nargs="*", nargs="*",
help="DVC file to reproduce (default - 'Dvcfile').", help="DVC-file to reproduce (default - 'Dvcfile').",
) )
repro_parser.add_argument( repro_parser.add_argument(
"-f", "-f",
+2 -2
View File
@@ -127,7 +127,7 @@ def add_parser(subparsers, parent_parser):
"(do not put into DVC cache).", "(do not put into DVC cache).",
) )
run_parser.add_argument( 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( run_parser.add_argument(
"-c", "--cwd", default=None, help="Deprecated, use -w and -f instead." "-c", "--cwd", default=None, help="Deprecated, use -w and -f instead."
@@ -155,7 +155,7 @@ def add_parser(subparsers, parent_parser):
"--overwrite-dvcfile", "--overwrite-dvcfile",
action="store_true", action="store_true",
default=False, default=False,
help="Overwrite existing dvc file without asking for confirmation.", help="Overwrite existing DVC-file without asking for confirmation.",
) )
run_parser.add_argument( run_parser.add_argument(
"--ignore-build-cache", "--ignore-build-cache",
+6 -6
View File
@@ -82,14 +82,14 @@ def add_parser(subparsers, parent_parser):
) )
tag_add_parser.add_argument("tag", help="Dvc tag.") tag_add_parser.add_argument("tag", help="Dvc tag.")
tag_add_parser.add_argument( tag_add_parser.add_argument(
"targets", nargs="*", default=[None], help="Dvc files." "targets", nargs="*", default=[None], help="DVC-files."
) )
tag_add_parser.add_argument( tag_add_parser.add_argument(
"-d", "-d",
"--with-deps", "--with-deps",
action="store_true", action="store_true",
default=False, 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( tag_add_parser.add_argument(
"-R", "-R",
@@ -109,14 +109,14 @@ def add_parser(subparsers, parent_parser):
) )
tag_remove_parser.add_argument("tag", help="Dvc tag.") tag_remove_parser.add_argument("tag", help="Dvc tag.")
tag_remove_parser.add_argument( tag_remove_parser.add_argument(
"targets", nargs="*", default=[None], help="Dvc files." "targets", nargs="*", default=[None], help="DVC-files."
) )
tag_remove_parser.add_argument( tag_remove_parser.add_argument(
"-d", "-d",
"--with-deps", "--with-deps",
action="store_true", action="store_true",
default=False, 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( tag_remove_parser.add_argument(
"-R", "-R",
@@ -135,14 +135,14 @@ def add_parser(subparsers, parent_parser):
help=TAG_LIST_HELP, help=TAG_LIST_HELP,
) )
tag_list_parser.add_argument( tag_list_parser.add_argument(
"targets", nargs="*", default=[None], help="Dvc files." "targets", nargs="*", default=[None], help="DVC-files."
) )
tag_list_parser.add_argument( tag_list_parser.add_argument(
"-d", "-d",
"--with-deps", "--with-deps",
action="store_true", action="store_true",
default=False, 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( tag_list_parser.add_argument(
"-R", "-R",
+1 -1
View File
@@ -318,7 +318,7 @@ class Repo(object):
for stage in stages: for stage in stages:
if active and not target and stage.locked: if active and not target and stage.locked:
logger.warning( 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( " not going to be pushed/pulled/fetched.".format(
path=stage.relpath path=stage.relpath
) )
+1 -1
View File
@@ -47,7 +47,7 @@ def checkout(self, target=None, with_deps=False, force=False, recursive=False):
for stage in stages: for stage in stages:
if stage.locked: if stage.locked:
logger.warning( 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) " not going to be checked out.".format(path=stage.relpath)
) )
+1 -1
View File
@@ -15,7 +15,7 @@ def _reproduce_stage(stages, node, force, dry, interactive, no_commit):
if stage.locked: if stage.locked:
logger.warning( 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) " not going to be reproduced.".format(path=stage.relpath)
) )
+1 -1
View File
@@ -14,7 +14,7 @@ def _local_status(self, target=None, with_deps=False):
for stage in stages: for stage in stages:
if stage.locked: if stage.locked:
logger.warning( 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( " not going to be shown in the status output.".format(
path=stage.relpath path=stage.relpath
) )
+4 -4
View File
@@ -54,7 +54,7 @@ class StageFileAlreadyExistsError(DvcException):
class StageFileIsNotDvcFileError(DvcException): class StageFileIsNotDvcFileError(DvcException):
def __init__(self, fname): 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 sname = fname + Stage.STAGE_FILE_SUFFIX
if Stage.is_stage_file(sname): if Stage.is_stage_file(sname):
@@ -218,7 +218,7 @@ class Stage(object):
if self.is_callback: if self.is_callback:
logger.warning( 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 " "(has a command and no dependencies) and thus always "
"considered as changed.".format(fname=self.relpath) "considered as changed.".format(fname=self.relpath)
) )
@@ -253,7 +253,7 @@ class Stage(object):
def _changed_md5(self): def _changed_md5(self):
if self.changed_md5(): if self.changed_md5():
logger.warning("Dvc file '{}' changed.".format(self.relpath)) logger.warning("DVC-file '{}' changed.".format(self.relpath))
return True return True
return False return False
@@ -583,7 +583,7 @@ class Stage(object):
# it raises the proper exceptions by priority: # it raises the proper exceptions by priority:
# 1. when the file doesn't exists # 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 # 3. path doesn't represent a regular file
Stage._check_file_exists(repo, fname) Stage._check_file_exists(repo, fname)
Stage._check_dvc_filename(fname) Stage._check_dvc_filename(fname)
+12 -12
View File
@@ -15,28 +15,28 @@ _dvc_commands() {
"add:Take data files or directories under DVC control." "add:Take data files or directories under DVC control."
"cache:Manage cache settings." "cache:Manage cache settings."
"checkout:Checkout data files from cache." "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." "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." "diff:Show a diff of a DVC controlled data file or a directory."
"fetch:Fetch data files from a DVC remote storage." "fetch:Fetch data files from a DVC remote storage."
"gc:Collect unused data from DVC cache or a 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." "import:Download or copy files from URL and take under DVC control."
"init:Initialize DVC in the current directory." "init:Initialize DVC in the current directory."
"install:Install DVC git hooks into the repository." "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." "metrics:Commands to add, manage, collect and display metrics."
"move:Rename or move a DVC controlled data file or a directory." "move:Rename or move a DVC controlled data file or a directory."
"pipeline:Manage pipelines." "pipeline:Manage pipelines."
"pull:Pull data files from a DVC remote storage." "pull:Pull data files from a DVC remote storage."
"push:Push data files to a DVC remote storage." "push:Push data files to a DVC remote storage."
"remote:Manage remote storage configuration." "remote:Manage remote storage configuration."
"remove:Remove outputs of DVC file." "remove:Remove outputs of DVC-file."
"repro:Check for changes and reproduce DVC file and dependencies." "repro:Check for changes and reproduce DVC-file and dependencies."
"root:Relative path to project's directory." "root:Relative path to project's directory."
"run:Generate a stage file from a command and execute the command." "run:Generate a stage file from a command and execute the command."
"status:Show changed stages, compare local cache and a remote storage." "status:Show changed stages, compare local cache and a remote storage."
"unlock:Unlock DVC file." "unlock:Unlock DVC-file."
"unprotect:Unprotect data file/directory." "unprotect:Unprotect data file/directory."
"version:Show DVC version and system/environment informaion." "version:Show DVC version and system/environment informaion."
) )
@@ -58,7 +58,7 @@ _dvc_global_options=(
_dvc_add=( _dvc_add=(
{-R,--recursive}"[Recursively add each file under the directory.]" {-R,--recursive}"[Recursively add each file under the directory.]"
"--no-commit[Don't put files/directories into cache.]" "--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" "1:File:_files"
) )
@@ -118,7 +118,7 @@ _dvc_gc=(
_dvc_import=( _dvc_import=(
"--resume[Resume previously started download.]" "--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:" "1:URL:"
"2:Output:" "2:Output:"
) )
@@ -177,8 +177,8 @@ _dvc_remote=(
_dvc_remove=( _dvc_remove=(
"*:Stages:_files -g '(*.dvc|Dvcfile)'" "*:Stages:_files -g '(*.dvc|Dvcfile)'"
"--dry[Only print the commands that would be executed without actually executing]" "--dry[Only print the commands that would be executed without actually executing]"
{-o,--outs}"[Only remove DVC file outputs. (Default)]" {-o,--outs}"[Only remove DVC-file outputs. (Default)]"
{-p,--purge}"[Remove DVC file and all its outputs.]" {-p,--purge}"[Remove DVC-file and all its outputs.]"
{-f,--force}"[Force purge.]" {-f,--force}"[Force purge.]"
) )
@@ -206,12 +206,12 @@ _dvc_run=(
"*"{-O,--outs-no-cache}"[Declare output file or directory (do not put into DVC cache).]:Output regular:_files" "*"{-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}"[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" "*"{-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 -/" {-c,--cwd}"[Deprecated, use -w and -f instead.]:CWD:_files -/"
{-w,--wdir}"[Directory within your repo to run your command in.]:WDIR:_files -/" {-w,--wdir}"[Directory within your repo to run your command in.]:WDIR:_files -/"
"--no-exec[Only create stage file without actually running it.]" "--no-exec[Only create stage file without actually running it.]"
{-y,--yes}"[Deprecated, use --overwrite-dvcfile instead]" {-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.]" "--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]" "--remove-outs[Deprecated, this is now the default behavior]"
"--no-commit[Don't put files/directories into cache.]" "--no-commit[Don't put files/directories into cache.]"