帮助为python项目构建aws lambda zip文件。
py-lambda-packer的Python项目详细描述
py lambda包装机
一个python aws lambda打包程序。这个项目非常松散地基于 工作 serverless-wsgi。
注意:此项目正在进行中,应考虑 不稳定。
功能:
- 编写为在python 3.6和2.7下运行。
- 生成python 3.6和2.7aws lambda部署包, 用户可配置。
- aws lambda部署包是在独立的、临时的 virtualenvs。
- 按项目配置文件减少键入。
- 可以很容易地作为 图书馆。
使用量
安装
最新稳定型
$ pip install py-lambda-packer
出血边缘
从github直接安装出血边缘版本:
$ pip install git+https://github.com/digitalrounin/py-lambda-packer.git@master#egg=py-lambda-packer
要安装特定的标记或分支,请替换url中的master
具有所需名称的前一个命令。
最新稳定型
$ pip install py-lambda-packer
出血边缘
从github直接安装出血边缘版本:
$ pip install git+https://github.com/digitalrounin/py-lambda-packer.git@master#egg=py-lambda-packer
要安装特定的标记或分支,请替换url中的master 具有所需名称的前一个命令。
快速启动
生成用于上载的py-lambda-package.zip的快速示例命令 以aws作为lambda函数
$ py-lambda-packer --requirement requirements.txt --package . \ --python python3.6 --include LICENSE
命令帮助
命令帮助信息:
$ py-lambda-packer --help usage: py-lambda-packer [-h] [--config-file CONFIG_FILE] [--include INCLUDES] [--exclude EXCLUDES] [--followlinks] [--virtualenv-dir VIRTUALENV_DIR] [--keep-virtualenv] [--python PYTHON] [--requirement REQUIREMENTS] [--package PACKAGES] [--output OUTPUT] [--archive-dir ARCHIVE_DIR] [--keep-archive] [--generate-config] optional arguments: -h, --help show this help message and exit --config-file CONFIG_FILE location of configuration file (default: ./py-lambda- packer.yaml) --include INCLUDES glob pattern of what to include, multiple allowed (default is empty) --exclude EXCLUDES glob pattern of what to exclude, multiple allowed (default is empty) --followlinks follows symbolic links (default=False) --virtualenv-dir VIRTUALENV_DIR directory to build the virtualenv in (default is a tmp dir) --keep-virtualenv do not delete virtualenv build directory when set (default=False) --python PYTHON version of python to build virtualenv with (default is python2.7) --requirement REQUIREMENTS, -r REQUIREMENTS pip requirements file to read, multiple allowed (default is empty) --package PACKAGES, -p PACKAGES pip package index options, multiple allowed (default is empty) --output OUTPUT, -o OUTPUT name of output zip file (default is py-lambda- packer.zip) --archive-dir ARCHIVE_DIR directory to build the archive in (default is a tmp dir) --keep-archive do not delete archive build directory when set (default=False) --generate-config prints thedefault configuration to help create one
项目配置
项目配置文件在 项目的基本目录。下面是一个示例:
virtualenv: python: python2.7 pip: requirements: - requirements.txt packages: - . - Flask packager: target: py-lambda-package.zip followlinks: true includes: - LICENSE - static/** - templates/**/*.html excludes: - static/**/*.tmp
要生成配置文件,请尝试 py-lambda-packer--generate-config命令。
待办事项列表
- 将代码覆盖率限制提高到80%,并修复失败的源代码 文件夹。
- 将注释添加到由创建的配置文件 py-lambda-packer--generate-config。
- 记录py lambda packerapi,以便它可以作为 将库转换为其他项目。
- 使colorlogpython包成为可选包以允许 py lambda packer将作为库导入其他项目 更干净。
- 插件支持。
- 支持用C和C++ Python扩展构建包。思考 大声地…通过一些东西在飞行中启动一个ec2实例 比如HashiCorp Packer,构建,打包, 销毁实例。
- 清除windows兼容性。(我无法访问 windows系统,因此这里的任何贡献都将是巨大的 谢谢。)
- 支持其他功能即服务(faas)平台的打包 提供人:azure,google cloud等