Skip to content
Merged
Changes from 1 commit
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
10 changes: 10 additions & 0 deletions src/flyte/_code_bundle/bundle.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,16 @@ async def build_code_bundle(

logger.debug(f"Finding files to bundle, ignoring as configured by: {ignore}")
files, digest = list_files_to_bundle(from_dir, True, *ignore, copy_style=copy_style)
if len(files) == 0:
raise ValueError(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we make this a flyte.errors.CodeBundleError

f"No files found to bundle in '{from_dir}'.\n"
"Possible causes:\n"
" - The task file is inside a virtual environment directory (e.g., .venv/, venv/)\n"
" - The task file is excluded by .gitignore\n"
" - The directory does not contain any Python files\n"
"To debug, check that your task file exists in the specified directory and is not ignored."
)

if logger.getEffectiveLevel() <= logging.INFO:
print_ls_tree(from_dir, files)

Expand Down
Loading