{"id":17049972,"url":"https://github.com/huonw/serverless-effortless","last_synced_at":"2026-04-19T19:34:08.379Z","repository":{"id":189110324,"uuid":"678285262","full_name":"huonw/serverless-effortless","owner":"huonw","description":"Packaging for serverless - effortless? Doubtless! - PyCon AU 2023","archived":false,"fork":false,"pushed_at":"2025-07-23T00:09:13.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-23T02:24:43.660Z","etag":null,"topics":["build-tool","lambda","pants","pantsbuild","serverless"],"latest_commit_sha":null,"homepage":"https://2023.pycon.org.au/program/RAKQDU/","language":"Shell","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/huonw.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-08-14T07:39:49.000Z","updated_at":"2025-07-23T00:09:16.000Z","dependencies_parsed_at":"2023-08-18T13:31:40.771Z","dependency_job_id":null,"html_url":"https://github.com/huonw/serverless-effortless","commit_stats":null,"previous_names":["huonw/serverless-effortless"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/huonw/serverless-effortless","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huonw%2Fserverless-effortless","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huonw%2Fserverless-effortless/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huonw%2Fserverless-effortless/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huonw%2Fserverless-effortless/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/huonw","download_url":"https://codeload.github.com/huonw/serverless-effortless/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huonw%2Fserverless-effortless/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32020697,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T20:23:30.271Z","status":"online","status_checked_at":"2026-04-19T02:00:07.110Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["build-tool","lambda","pants","pantsbuild","serverless"],"created_at":"2024-10-14T09:55:49.219Z","updated_at":"2026-04-19T19:34:08.354Z","avatar_url":"https://github.com/huonw.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Packaging for serverless - effortless? Doubtless\n\n[Presented at PyCon AU 23](https://2023.pycon.org.au/program/RAKQDU/), related to [Open Source at ExoFlare](https://www.exoflare.com/open-source/?utm_source=pyconau23\u0026utm_campaign=open_source).\n\nA package-and-deploy pipeline is like plumbing: if it's working, you don't notice, but when it's not… you really do, and getting it working can be messy. We've tried several approaches for building Python artefacts to run on AWS Lambda, and finally settled on one that works well. I'll walk through how the Pants build system works in practice for getting our code running in production, and how it's improved upon other common practices we previously used.\n\nAcross our system, we have dozens of serverless functions, most of which use PyPI dependencies. We previously used techniques like running `pip install --target=...` in a docker image, then copying in our source code: it mostly works, but… it sparks thumb-twiddling and pipeline-clogging more than it sparks joy.\n\nUsing [Pants](https://www.pantsbuild.org), we build our artefacts quickly, reliably, cross-platform, and without boilerplate! Our builds are quick, through caching, parallelism, and avoiding emulation. Dependency inference means each only includes exactly what it needs, without maintaining careful lists. We even benefit from these more generally, like testing and building non-serverless artefacts too.\n\nFaster coding, faster builds, faster deploys, and faster cold-starts. It's like a working drain: Who doesn’t want that?\n\n## Examples\n\nThis repository stores the code examples used in the talk:\n\n1. [`pip_echo_alone/`](pip_echo_alone/): the first example, using pip \u0026 docker to build the Echo lambda in isolation, and its single `msgspec` requirement.\n2. [`pip_echo_and_plot/`](pip_echo_and_plot/): the second example, using pip \u0026 docker to build both Echo and Plot lambdas, along with the three requirements: `msgspec`, `pandas` and `matplotlib`. This demonstrates the impact of the additional dependencies on the Echo lambda.\n3. [`pants/`](pants/): the final example, using Pants to build both lambdas and have fast builds and low configuration\n\nDetailed results, to build a working zip file:\n\n| Lambda           | Build system | Time (s) | Zip size (KB) |\n|------------------|--------------|---------:|--------------:|\n| Echo             | pip \u0026 docker |      5.1 |           228 |\n| Echo (with Plot) | pip \u0026 docker |      109 |        47 632 |\n| Echo             | pants        |      2.0 |           198 |\n| Plot             | pip \u0026 docker |      102 |        47 635 |\n| Plot             | pants        |      7.7 |        40 109 |\n\nWhen cached, Pants will emit the artifact near-instantly, without needing a build step.\n\n## Related links\n\n- [Open Source at ExoFlare](https://www.exoflare.com/open-source/?utm_source=pyconau23\u0026utm_campaign=open_source)\n- [Pants build system](https://www.pantsbuild.org)\n- [Building AWS Lambdas with Pants](https://www.pantsbuild.org/docs/awslambda-python)\n- [Building Google Cloud Functions with Pants](https://www.pantsbuild.org/docs/google-cloud-function-python)\n- [How would a corgi wear pants?](https://www.dinotomic.com/product/275-corgi-pants-print)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhuonw%2Fserverless-effortless","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhuonw%2Fserverless-effortless","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhuonw%2Fserverless-effortless/lists"}