Skip to content

Commit 6b47a5d

Browse files
committed
chore: clean up README
1 parent 22f701b commit 6b47a5d

1 file changed

Lines changed: 14 additions & 22 deletions

File tree

README.md

Lines changed: 14 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,39 @@
11
# package-python-function
2-
Python command-line (CLI) tool to package a Python function for deploying to AWS Lambda, and possibly other
3-
cloud platforms.
2+
Python command-line (CLI) tool to package a Python function for deploying to AWS Lambda, and possibly other cloud platforms.
43

5-
This tool builds a ZIP file from a virtual environment with all depedencies installed that are to be included in the final deployment asset. If the content is larger than AWS Lambda's maximum unzipped package size of 250 MiB,
6-
then this tool will employ the ZIP-inside-ZIP (nested-ZIP) workaround. This allows deploying Lambdas with large
7-
dependency packages, especially those with native code compiled extensions like Pandas, PyArrow, etc.
4+
This tool builds a ZIP file from a virtual environment with all dependencies installed that are to be included in the final deployment asset. If the content is larger than AWS Lambda's maximum unzipped package size of 250 MiB, This tool will then employ the ZIP-inside-ZIP (nested-ZIP) workaround. This allows deploying Lambdas with large dependency packages, especially those with native code compiled extensions like Pandas, PyArrow, etc.
85

9-
This technique was originally pioneered by [serverless-python-requirements](https://github.com/serverless/serverless-python-requirements), which is a NodeJS (JavaScript) plugin for the [Serverless Framework](https://github.com/serverless/serverless). The technique has been improved here to not require any special imports in your entrypoint source file. That is, no changes are needed to your source code to leverage the nested ZIP deployment.
6+
This technique was originally pioneered by [serverless-python-requirements](https://github.com/serverless/serverless-python-requirements), which is a NodeJS (JavaScript) plugin for the [Serverless Framework](https://github.com/serverless/serverless). The technique has been improved here to not require any special imports in your entrypoint source file. That is, no changes are needed to your source code to leverage the nested ZIP deployment.
107

11-
The motivation for this Python tool is to achieve the same results as serverless-python-requirements but with a
12-
purely Python tool. This can simplify and speed up developer and CI/CD workflows.
8+
The motivation for this Python tool is to achieve the same results as [serverless-python-requirements](https://www.serverless.com/plugins/serverless-python-requirements) but with a purely Python tool. This can simplify and speed up developer and CI/CD workflows.
139

14-
One important thing that this tool does not do is build the target virtual environment and install all of the
15-
dependencies. You must first generate that with a tool like [Poetry](https://github.com/python-poetry/poetry) and the [poetry-plugin-bundle](https://github.com/python-poetry/poetry-plugin-bundle).
10+
One important thing that this tool does not do is build the target virtual environment and install all of the dependencies. You must first generate that with a tool like [Poetry](https://github.com/python-poetry/poetry) and the [poetry-plugin-bundle](https://github.com/python-poetry/poetry-plugin-bundle).
1611

1712
## Example command sequence
18-
```
13+
```shell
1914
poetry bundle venv .build/.venv --without dev
2015
package-python-function .build/.venv --output-dir .build/lambda
2116
```
2217

23-
The output will be a .zip file with the same name as your project from your pyproject.toml file (with dashes replaced
18+
The output will be a .zip file with the same name as your project from your `pyproject.toml` file (with dashes replaced
2419
with underscores).
2520

2621
## Installation
2722
Use [pipx](https://github.com/pypa/pipx) to install:
2823

29-
```
24+
```shell
3025
pipx install package-python-function
3126
```
3227

3328
## Usage / Arguments
29+
```shell
3430
`package-python-function venv_dir [--project PROJECT] [--output-dir OUTPUT_DIR] [--output OUTPUT]`
31+
```
3532

36-
- `venv_dir` [Required]: The path to the virtual environment to package.
37-
38-
- `--project` [Optional]: Path to the pyproject.toml file. Omit to use the pyproject.toml file in the current working directory.
33+
- `venv_dir` [Required]: The path to the virtual environment to package.
34+
- `--project` [Optional]: Path to the `pyproject.toml` file. Omit to use the `pyproject.toml` file in the current working directory.
3935

4036
One of the following must be specified:
4137
- `--output`: The full output path of the final zip file.
42-
43-
- `--output-dir`: The output directory for the final zip file. The name of the zip file will be based on the project's
44-
name in the pyproject.toml file (with dashes replaced with underscores).
45-
46-
47-
38+
- `--output-dir`: The output directory for the final zip file. The name of the zip file will be based on the project's
39+
name in the `pyproject.toml` file (with dashes replaced with underscores).

0 commit comments

Comments
 (0)