runway.cfngin.hooks.awslambda.python_requirements package¶
Handle python requirements.
- class runway.cfngin.hooks.awslambda.python_requirements.PythonDeploymentPackage[source]¶
Bases:
DeploymentPackage
[PythonProject
]AWS Lambda Python Deployment Package.
- property gitignore_filter: IgnoreParser | None¶
Filter to use when zipping dependencies.
This should be overridden by subclasses if a filter should be used.
- static insert_layer_dir(file_path: Path, relative_to: Path) Path [source]¶
Insert
python
directory into local file path for layer archive.- Parameters:
file_path – Path to local file.
relative_to – Path to a directory that the file_path will be relative to in the deployment package.
- project: PythonProject¶
Project that is being built into a deployment package.
- class runway.cfngin.hooks.awslambda.python_requirements.PythonDockerDependencyInstaller[source]¶
Bases:
DockerDependencyInstaller
Docker dependency installer for Python.
- __init__(project: PythonProject, *, client: DockerClient | None = None, context: CfnginContext | RunwayContext | None = None) None [source]¶
Instantiate class.
- Parameters:
project – awslambda project.
client – Pre-configured
docker.client.DockerClient
.context – CFNgin or Runway context object.
- class runway.cfngin.hooks.awslambda.python_requirements.PythonProject[source]¶
Bases:
Project
[PythonHookArgs
]Python project.
- property docker: PythonDockerDependencyInstaller | None¶
Docker interface that can be used to build the project.
- property metadata_files: tuple[Path, ...]¶
Project metadata files.
Files are only included in return value if they exist.
- property pipenv: Pipenv | None¶
Pipenv dependency manager.
- Returns:
If the project uses pipenv and pipenv is not explicitly disabled, an object for interfacing with pipenv will be returned.
- Raises:
PipenvNotFoundError – pipenv is not installed or not found in PATH.
- property poetry: Poetry | None¶
Poetry dependency manager.
- Returns:
If the project uses poetry and poetry is not explicitly disabled, an object for interfacing with poetry will be returned.
- Raises:
PoetryNotFound – poetry is not installed or not found in PATH.
- property project_type: Literal['pip', 'pipenv', 'poetry']¶
Type of python project.
- property runtime: str¶
Runtime of the build system.
Value should be a valid Lambda Function runtime (https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html).
- property supported_metadata_files: set[str]¶
Names of all supported metadata files.
- Returns:
Set of file names - not paths.
- property tmp_requirements_txt: Path¶
Temporary requirements.txt file.
This path is only used when exporting from another format.