A Command extension to setuptools that allows building an AWS Lamba dist
Project description
# lambda-setuptools
####A Command extension to setuptools that builds an AWS Lambda compatible zip file
Use is simple:
Add this setup_requires=[‘lambda_setuptools’] as an attribute to your _setup.py_ file
- Call python setup.py _ldist_
This will build (using bdist_wheel) and install your package, along with all of the dependencies in _install_requires_
- Zip the result up into an AWS Lambda compatible format
The result will be in _dist/[your-package-name]-lambda-[version].zip_ (along with your wheel)
This extension also adds three new attributes to the setup() function:
- lambda_function
Usage: _lambda_function=<my_package>.<some_module>:<some_function>_
Effect: ldist will create a root-level python module named <package_name>_function.py where package_name is derived from the _name_ attribute. This created module will simply redefine your lambda handler function at the root-level.
- lambda_module
Usage: _lambda_module=<some_module>_
Effect: ldist adds the named module to the list of _py_modules_ to install, normally at the root level
- lambda_package
Usage: _lambda_package=<some_dir>_
Effect: ldist will copy the contents of the provided directory into the root level of the resulting lambda distribution. The provided directory MUST NOT have and __init__.py in it (e.g. - it can’t be a real package)
All ldist attributes can be used in the same setup() call. It is up to the user to ensure that you don’t step all over yourself…
Note that all other commands and attributes in setup.py will still work the way you expect them to.
Enjoy!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for lambda_setuptools-0.1.3-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d56890b27d749ac611018542f00034440fb6687f1182448cd737d6ac081c8ce6 |
|
MD5 | 991b47746c207756ae7f3e2a505f8a19 |
|
BLAKE2b-256 | 27adc35c37bf83472c7a4d7c6f28526b22bd08577ed9c23d633fa0b3f95a02bb |