def build(<EOL>src, requirements=None, local_package=None,<EOL>config_file='<STR_LIT>', profile_name=None,<EOL>):
<EOL>path_to_config_file = os.path.join(src, config_file)<EOL>cfg = read_cfg(path_to_config_file, profile_name)<EOL>dist_directory = cfg.get('<STR_LIT>', '<STR_LIT>')<EOL>path_to_dist = os.path.join(src, dist_directory)<EOL>mkdir(path_to_dist)<EOL>function_name = cfg.get('<STR_LIT>')<EOL>output_filename = '<STR_LIT>'.format(timestamp(), function_name)<EOL>path_to_temp = mkdtemp(prefix='<STR_LIT>')<EOL>pip_install_to_target(<EOL>path_to_temp,<EOL>requirements=requirements,<EOL>local_package=local_package,<EOL>)<EOL>if '<STR_LIT>' in os.listdir(path_to_temp):<EOL><INDENT>print(<EOL>'<STR_LIT>'<EOL>'<STR_LIT>',<EOL>)<EOL>with open(os.path.join(path_to_temp, '<STR_LIT>'), '<STR_LIT:wb>'):<EOL><INDENT>pass<EOL><DEDENT><DEDENT>output_filename = (<EOL>'<STR_LIT>'.format(output_filename)<EOL>if not output_filename.endswith('<STR_LIT>')<EOL>else output_filename<EOL>)<EOL>build_config = defaultdict(**cfg.get('<STR_LIT>', {}))<EOL>build_source_directories = build_config.get('<STR_LIT>', '<STR_LIT>')<EOL>build_source_directories = (<EOL>build_source_directories<EOL>if build_source_directories is not None<EOL>else '<STR_LIT>'<EOL>)<EOL>source_directories = [<EOL>d.strip() for d in build_source_directories.split('<STR_LIT:U+002C>')<EOL>]<EOL>files = []<EOL>for filename in os.listdir(src):<EOL><INDENT>if os.path.isfile(filename):<EOL><INDENT>if filename == '<STR_LIT>':<EOL><INDENT>continue<EOL><DEDENT>if filename == config_file:<EOL><INDENT>continue<EOL><DEDENT>print('<STR_LIT>' % filename)<EOL>files.append(os.path.join(src, filename))<EOL><DEDENT>elif os.path.isdir(filename) and filename in source_directories:<EOL><INDENT>print('<STR_LIT>' % filename)<EOL>files.append(os.path.join(src, filename))<EOL><DEDENT><DEDENT>os.chdir(path_to_temp)<EOL>for f in files:<EOL><INDENT>if os.path.isfile(f):<EOL><INDENT>_, filename = os.path.split(f)<EOL>copyfile(f, os.path.join(path_to_temp, filename))<EOL>copystat(f, os.path.join(path_to_temp, filename))<EOL><DEDENT>elif os.path.isdir(f):<EOL><INDENT>destination_folder = os.path.join(path_to_temp, f[len(src) + <NUM_LIT:1>:])<EOL>copytree(f, destination_folder)<EOL><DEDENT><DEDENT>path_to_zip_file = archive('<STR_LIT>', path_to_dist, output_filename)<EOL>return path_to_zip_file<EOL>
Builds the file bundle.

    :param str src:
       The path to your Lambda ready project (folder must contain a valid
        config.yaml and handler module (e.g.: service.py).
    :param str local_package:
        The path to a local package with should be included in the deploy as
        well (and/or is not available on PyPi)