帮助为python项目构建aws lambda zip文件。

py-lambda-packer的Python项目详细描述


Code ClimateBuild StatuscodecovPyPI version

py lambda包装机

一个python aws lambda打包程序。这个项目非常松散地基于 工作 serverless-wsgi

注意此项目正在进行中,应考虑 不稳定。

功能:

  • 编写为在python 3.62.7下运行。
  • 生成python 3.62.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 具有所需名称的前一个命令。

快速启动

生成用于上载的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)平台的打包 提供人:azuregoogle cloud

参考文献

了解更多信息

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
如何获得@sign,以便在Java代码中键入@override?   java Facebook登录不起作用,我忘了什么?   json如何在java中从MongoDB Atlas获取特定字段?   java如何在Android上的JNI中实现委托/协议(在iOS上)?   java为什么这个循环多次的程序在循环后有一个“println”时需要花费时间?   java无法使组合框正常工作   JavaCQ5。如何为作者显示列表发布者?版本5.5   java我可以要求泛型参数具有泛型参数吗?   JavaOKHTTP无法获取整个JSON   数组Java:用字符减去字符意味着什么?   java为什么Eclipse content assist无法从部分方法名生成方法存根?   java使用线程在Android Studio中一次加载一个多位图   java遍历二叉树并返回一个值