{"id":23117512,"url":"https://github.com/micmurawski/poetry-plugin-lambda-build","last_synced_at":"2025-04-06T02:07:29.306Z","repository":{"id":223172576,"uuid":"759492002","full_name":"micmurawski/poetry-plugin-lambda-build","owner":"micmurawski","description":"Poetry plugin for building packages for serverless functions deployments like AWS Lambda, Google App Engine, Azure App Service, and more...","archived":false,"fork":false,"pushed_at":"2024-10-29T14:01:35.000Z","size":192,"stargazers_count":39,"open_issues_count":4,"forks_count":5,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-29T17:12:06.943Z","etag":null,"topics":["aws","aws-lambda","azure-functions","build","build-tool","ci","google-engine","lambda","package","poetry","python","serverless","serverless-functions","zip"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/micmurawski.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-02-18T18:29:57.000Z","updated_at":"2024-10-28T11:30:09.000Z","dependencies_parsed_at":"2024-04-10T14:30:55.376Z","dependency_job_id":"3093eb07-63a9-442f-aba1-cdc81ba20a31","html_url":"https://github.com/micmurawski/poetry-plugin-lambda-build","commit_stats":null,"previous_names":["micmurawski/poetry-plugin-lambda-build"],"tags_count":37,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/micmurawski%2Fpoetry-plugin-lambda-build","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/micmurawski%2Fpoetry-plugin-lambda-build/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/micmurawski%2Fpoetry-plugin-lambda-build/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/micmurawski%2Fpoetry-plugin-lambda-build/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/micmurawski","download_url":"https://codeload.github.com/micmurawski/poetry-plugin-lambda-build/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247423513,"owners_count":20936626,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","aws-lambda","azure-functions","build","build-tool","ci","google-engine","lambda","package","poetry","python","serverless","serverless-functions","zip"],"created_at":"2024-12-17T04:22:16.040Z","updated_at":"2025-04-06T02:07:29.299Z","avatar_url":"https://github.com/micmurawski.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Poetry Plugin Lambda Build\n\nThe plugin for poetry that allows you to build zip packages suited for serverless deployment like AWS Lambda, Google App Engine, Azure App Service, and more...\n\nAdditionally it provides docker container support for build inside container\n\n[![Test](https://github.com/micmurawski/poetry-plugin-lambda-build/actions/workflows/test.yml/badge.svg)](https://github.com/micmurawski/poetry-plugin-lambda-build/actions/workflows/test.yml)\n\n## Installation\n\n```bash\npoetry self add poetry-plugin-lambda-build\n```\n\n## Execution\n\nConfigure `pyproject.toml` with the following configuration. This is example for [AWS Lambda configuration](#aws)\n\n```.toml\n[tool.poetry-plugin-lambda-build]\ndocker-image = \"public.ecr.aws/sam/build-python3.11:latest-x86_64\"\ndocker-network = \"host\"\nlayer-artifact-path = \"artifacts/layer.zip\"\nlayer-install-dir = \"python\"\nfunction-artifact-path = \"artifacts/function.zip\"\n```\n\nRunning ...\n\n```bash\npoetry build-lambda\n```\nwill build function and layer packages for AWS Lambda deployment inside `public.ecr.aws/sam/build-python3.11:latest-x86_64` container.\n\n```\nartifacts\n├── function.zip\n└── layer.zip\n```\n\nRunning ...\n\n```bash\npoetry build-lambda docker-image=\"public.ecr.aws/sam/build-python3.12:latest-x86_64\"\n```\n\nwill override `docker-image` value in config \n\n## Configuration Examples\n### AWS Lambda - all in one - dependencies and function in the same zip package - Default\n\n```.toml\n[tool.poetry-plugin-lambda-build]\npackage-artifact-path = \"package.zip\"\n```\n\n### AWS Lambda - all in one - layer package\n```.toml\n[tool.poetry-plugin-lambda-build]\npackage-install-dir = \"python\"\npackage-artifact-path = \"layer.zip\"\n```\n### AWS Lambda - separated - separate layer package and function package\n\n```.toml\n[tool.poetry-plugin-lambda-build]\nlayer-artifact-path = \"layer.zip\"\nlayer-install-dir = \"python\"\nfunction-artifact-path = \"function.zip\"\n```\n### \u003ca name=\"aws\"\u003e\u003c/a\u003eAWS Lambda - separated - separate layer package and function package build in docker container\n\n```.toml\n[tool.poetry-plugin-lambda-build]\ndocker-image = \"public.ecr.aws/sam/build-python3.11:latest-x86_64\"\ndocker-network = \"host\"\nlayer-artifact-path = \"layer.zip\"\nlayer-install-dir = \"python\"\nfunction-artifact-path = \"function.zip\"\n```\n\n## Help\n\n```bash\npoetry build-lambda help\n```\n\n```\nDescription:\n  Execute to build lambda lambda artifacts\n\nUsage:\n  build-lambda [options] [--] [\u003cdocker-image\u003e [\u003cdocker-entrypoint\u003e [\u003cdocker-environment\u003e [\u003cdocker-dns\u003e [\u003cdocker-network\u003e [\u003cdocker-network-mode\u003e [\u003cdocker-platform\u003e [\u003cpackage-artifact-path\u003e [\u003cpackage-install-dir\u003e [\u003cfunction-artifact-path\u003e [\u003cfunction-install-dir\u003e [\u003clayer-artifact-path\u003e [\u003clayer-install-dir\u003e [\u003conly\u003e [\u003cwithout\u003e [\u003cwith\u003e [\u003czip-compresslevel\u003e [\u003czip-compression\u003e [\u003cpre-install-script\u003e [\u003cdockerignore\u003e [\u003cdockerignore-file\u003e]]]]]]]]]]]]]]]]]]]]]\n\nArguments:\n  docker-image                   The image to run\n  docker-entrypoint              The entrypoint for the container (comma separated string) [default: \"/bin/bash\"]\n  docker-environment             Environment variables to set inside the container (comma separated string) ex. VAR_1=VALUE_1,VAR_2=VALUE_2\n  docker-dns                     Set custom DNS servers (comma separated string)\n  docker-network                 The name of the network this container will be connected to at creation time [default: \"host\"]\n  docker-network-mode            Network-mode\n  docker-platform                Platform in the format os[/arch[/variant]]. Only used if the method needs to pull the requested image.\n  package-artifact-path          Output package path (default: package.zip). Set the '.zip' extension to wrap the artifact into a zip package otherwise, output will be created in the directory. [default: \"package.zip\"]\n  package-install-dir            Installation directory inside artifact for single package [default: \"\"]\n  function-artifact-path         Output function package path. Set the '.zip' extension to wrap the artifact into a zip package otherwise, output will be created in the directory.\n  function-install-dir           Installation directory inside artifact for function package [default: \"\"]\n  layer-artifact-path            Output layer package path. Set the '.zip' extension to wrap the artifact into a zip package otherwise, output will be created in the directory.\n  layer-install-dir              Installation directory inside artifact for layer package [default: \"\"]\n  only                           The only dependency groups to include\n  without                        The dependency groups to ignore\n  with                           The optional dependency groups to include\n  zip-compresslevel              None (default for the given compression type) or an integer specifying the level to pass to the compressor. When using ZIP_STORED or ZIP_LZMA this keyword has no effect. When using ZIP_DEFLATED integers 0 through 9 are accepted. When using ZIP_BZIP2 integers 1 through 9 are accepted.\n  zip-compression                ZIP_STORED (no compression), ZIP_DEFLATED (requires zlib), ZIP_BZIP2 (requires bz2) or ZIP_LZMA (requires lzma) [default: \"ZIP_STORED\"]\n  pre-install-script             The script that is executed before installation.\n  dockerignore                   Comma-separated list of patterns to ignore when copying files to container\n  dockerignore-file              Path to a .dockerignore file to use for filtering files\n\nOptions:\n      --no-checksum              Enable to suppress checksum checking\n      --docker-network-disabled  Disable networking\n  -h, --help                 Display help for the given command. When no command is given display help for the list command.\n  -q, --quiet                Do not output any message.\n  -V, --version              Display this application version.\n      --ansi                 Force ANSI output.\n      --no-ansi              Disable ANSI output.\n  -n, --no-interaction       Do not ask any interactive question.\n      --no-plugins           Disables plugins.\n      --no-cache             Disables Poetry source caches.\n  -C, --directory=DIRECTORY  The working directory for the Poetry command (defaults to the current working directory).\n  -v|vv|vvv, --verbose       Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug.\n```\n\n## Tips\n#### Mac users with Docker Desktops\nMake sure to configure `DOCKER_HOST` properly\n```bash\nexport DOCKER_HOST=unix:///Users/$USER/.docker/run/docker.sock\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicmurawski%2Fpoetry-plugin-lambda-build","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmicmurawski%2Fpoetry-plugin-lambda-build","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicmurawski%2Fpoetry-plugin-lambda-build/lists"}