Skip to main content

lambda-packager

HMRC: Digital PyPI Python License: Apache 2.0 Code style: black

The purpose of this tool is to avoid writing AWS lambda packaging scripts repeatedly. It is intended to give a consistent output regardless of how you currently define your python dependencies. The tool was built as most existing tools are built into larger frameworks that have other considerations when adopting

Currently, requires python >=3.8 and later due to required features of copytree

Usage

  • You can run with the following:
$ lambda-packager
 # or if not in the project directory  
$ lambda-packager --project-directory path/to/project/dir
  • lambda-packager will include any dependencies defined in
    • poetry (pyproject.toml)
    • requirements.txt
    • Pipenv (Coming soon!)
  • By default lambda-packager will include all src files that match *.py
  • You can customise this through config in pyproject.toml:
[tool.lambda-packager]
src_patterns = ["lambda_packager/*.py"]

Hidden files

  • Hidden files and folders are ignored by default when including src files
  • if you wish to disable this, then add the following config to your pyproject.toml
[tool.lambda-packager]
ignore_hidden_files = false

Ignore folders

If there are folders that you wish always exclude, then you can use ignore_folders Note: ignore_folders is always respected even if there was a match via src_patterns

[tool.lambda-packager]
ignore_folders = ["venv"]

Ignore hashes

Only has an effect when using poetry pyproject.toml files

Skips exporting hashes from poetry to avoid issues when using non-pypi packages by providing --without-hashes flag when calling poetry export See https://github.com/hmrc/python-aws-lambda-packager/issues/2 for more info (Note: version number remains pinned when this is enabled)

without_hashes = True

Full usage

usage: lambda-packager [-h] [--project-directory PROJECT_DIRECTORY] [-l {DEBUG,INFO,WARNING,ERROR}]

Build code and dependencies into zip files that can be uploaded and run in AWS Lambda

optional arguments:
  -h, --help            show this help message and exit
  --project-directory PROJECT_DIRECTORY
                        The path to the top level project directory. This is where source files and files that declare dependencies are expected to be held. Defaults to current directory
  -l {DEBUG,INFO,WARNING,ERROR}, --log-level {DEBUG,INFO,WARNING,ERROR}
                        set output verbosity, defaults to 'INFO'

License

This code is open source software licensed under the Apache 2.0 License.

Metadata

Release files for lambda-packager 1.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lambda-packager 1.2.2
File Size Uploaded Provenance Actions
lambda_packager-1.2.2.tar.gz 9.5 kB Without provenance Details for lambda_packager-1.2.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for lambda-packager 1.2.2
File Interpreter ABI Platform Actions
lambda_packager-1.2.2-py3-none-any.whl Python 3 none any Details for lambda_packager-1.2.2-py3-none-any.whl

Total release size: 21.5 kB

Release files / lambda_packager-1.2.2.tar.gz

Download URL lambda_packager-1.2.2.tar.gz
Size 9.5 kB
Tags Source
SHA-256 checksum
How to use checksums
dd66ad5288b2b508a085a69e79511d0394f2f76e610e715e0d113b7124d9044a
BLAKE2b-256 checksum
How to use checksums
dd26be3561751f2fbc39aba0020f0320204c7f2068e99052bc2d3cb9a9554d44
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.4.2 CPython/3.8.0 Linux/5.19.0-1022-aws

Release files / lambda_packager-1.2.2-py3-none-any.whl

Download URL lambda_packager-1.2.2-py3-none-any.whl
Size 12.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1f6df1b9c2da5fd5487c4c36e044d0515d8a7df393d4b447eaa7e9c0c0a7fb00
BLAKE2b-256 checksum
How to use checksums
360d9ff3340ff1c16a6130e0d4179b3670018579606bb401daf0235afd39a198
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.4.2 CPython/3.8.0 Linux/5.19.0-1022-aws

Security for lambda-packager 1.2.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page