@@ -79,19 +79,23 @@ def __init__(
79
79
self .no_output_detection = no_output_detection
80
80
81
81
if not command_line :
82
- raise errors .UsageError ("Command line can not be empty." )
82
+ raise errors .UsageError ("Command line can not be empty. Please specify a command to execute. " )
83
83
84
84
if not directory :
85
85
directory = os .getcwd ()
86
86
self .directory = Path (directory )
87
87
if not self .directory .exists ():
88
- raise errors .UsageError ("Directory must exist." )
88
+ raise errors .UsageError (
89
+ f"Directory '{ self .directory } ' doesn't exist. Please make sure you are inside an existing directory."
90
+ )
89
91
90
92
if not working_dir :
91
93
working_dir = os .getcwd ()
92
94
self .working_dir = Path (working_dir )
93
95
if not self .working_dir .exists ():
94
- raise errors .UsageError ("Working Directory must exist." )
96
+ raise errors .UsageError (
97
+ f"Repository path '{ self .working_dir } ' doesn't exist. Make sure you are inside a Renku repository."
98
+ )
95
99
96
100
if isinstance (command_line , (list , tuple )):
97
101
self .command_line = list (command_line )
@@ -298,7 +302,7 @@ def add_outputs(self, candidates: Set[Tuple[Union[Path, str], Optional[str]]]):
298
302
candidate = self ._resolve_existing_subpath (self .working_dir / candidate_path )
299
303
300
304
if candidate is None :
301
- raise errors .UsageError ('Path "{0}" does not exist.' .format (candidate_path ))
305
+ raise errors .UsageError ('Path "{0}" does not exist inside the current project .' .format (candidate_path ))
302
306
303
307
glob = str (candidate .relative_to (self .working_dir ))
304
308
@@ -324,17 +328,17 @@ def _check_potential_output_directory(
324
328
preexisting_paths = content - subpaths
325
329
if preexisting_paths :
326
330
raise errors .InvalidOutputPath (
327
- 'The output directory "{0}" is not empty. \n \n '
328
- "Delete existing files before running the "
329
- "command:"
330
- '\n (use "git rm <file>..." to remove them '
331
- "first)"
332
- "\n \n " .format (input_path )
331
+ f"The output directory '{ input_path } ' is not empty. \n \n "
332
+ "As renku treats whole directory outputs as generated by renku,"
333
+ "those directories have to be empty before being tracked by renku.\n \n "
334
+ "You can solve this by:\n "
335
+ f"- Deleting the existing files in the directory (use 'git rm -r { input_path } ')\n "
336
+ "- Using a different output folder\n "
337
+ "- Using a new empty subfolder inside the output folder\n \n "
338
+ "Output directories with existing files:\n \n "
333
339
+ "\n " .join ("\t " + click .style (path , fg = "yellow" ) for path in preexisting_paths )
334
340
+ "\n \n "
335
- "Once you have removed files that should be used "
336
- "as outputs,\n "
337
- "you can safely rerun the previous command."
341
+ "Once you have resolved the issues above, you can safely rerun the previous command."
338
342
)
339
343
340
344
# Remove files from the input directory
@@ -590,8 +594,6 @@ def watch(self, client_dispatcher: IClientDispatcher, no_output=False):
590
594
# List of all output paths.
591
595
output_paths = []
592
596
593
- inputs = {input .id : input for input in self .inputs }
594
-
595
597
# Keep track of unmodified output files.
596
598
unmodified = set ()
597
599
@@ -639,7 +641,7 @@ def watch(self, client_dispatcher: IClientDispatcher, no_output=False):
639
641
raise errors .UnmodifiedOutputs (repository , unmodified )
640
642
641
643
if not no_output and not output_paths :
642
- raise errors .OutputsNotFound (repository , inputs . values () )
644
+ raise errors .OutputsNotFound ()
643
645
644
646
if client .check_external_storage ():
645
647
client .track_paths_in_storage (* output_paths )
@@ -725,7 +727,7 @@ def read_files_list(files_list: Path):
725
727
data = yaml .safe_load (files_list .read_text ())
726
728
727
729
if not isinstance (data , dict ):
728
- raise errors .OperationError ("Inputs/outputs files list must be a YAML dictionary." )
730
+ raise errors .OperationError ("Explicit Inputs/Outputs/Parameters files list must be a YAML dictionary." )
729
731
730
732
return data
731
733
0 commit comments