- class runway.cfngin.hooks.awslambda.source_code.SourceCode
Source code iterable.
- __init__(root_directory: StrPath, *, gitignore_filter: Optional[igittigitt.IgnoreParser] = None, include_files_in_hash: Optional[Sequence[Path]] = None, project_root: Optional[StrPath] = None) None
root_directory – The root directory containing the source code.
gitignore_filter – Object that has been pre-populated with rules/patterns to determine if a file should be ignored.
include_files_in_hash – Files that should be included in hash calculation even if they are filtered by gitignore (e.g.
project_root – Optional project root if the source code is located within a larger project. This should only be used if the contents of value of
include_files_in_hashcontains paths that exist outside of the root directory. If this is provided, it must be a parent of the root directory.
- gitignore_filter: igittigitt.igittigitt.IgnoreParser
Filter to use when zipping dependencies. If file/folder matches the filter, it should be ignored.
- project_root: pathlib.Path
Top-level directory containing the project metadata files and source code root directory. The value can be the same as
root_directory. If it is not, it must be a parent of
- property md5_hash: str
Calculate the md5 hash of the directory contents.
This can be resource intensive depending on the size of the project.
- add_filter_rule(pattern: str) None
Add rule to ignore filter.
pattern – The gitignore pattern to add to the filter.
- sorted(*, reverse: bool = False) List[pathlib.Path]
Sorted list of source code files.
reverse – Sort the list in reverse.
Sorted list of source code files excluding those that match the ignore filter.
- __iter__() Iterator[pathlib.Path]
Iterate over the source code files.
Files that do not match the ignore filter. Order in arbitrary.
- __truediv__(other: StrPath) Path
Create a new path object from source code’s root directory.