Skip to content

Commit

Permalink
docs: Add how to install Pydantic without binaries
Browse files Browse the repository at this point in the history
Pydantic can be installed without binary files. This significantly
reduces the additional size it adds to the compressed Lambda packages
(down to 2MB from 25MB) at the expense of 30%-50% of its performance.

While at it I also updated the amount of megabyte Pydantic adds to the
package, as it wasn't clear if the stated number referred to compressed
or uncompressed package size and I couldn't reproduce the 75MB either
way.
  • Loading branch information
Dunedan committed Mar 16, 2022
1 parent 1394d00 commit fe98327
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion docs/utilities/parser.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,13 @@ This utility provides data parsing and deep validation using [Pydantic](https://
**Extra dependency**

???+ warning
This will increase the overall package size by approximately 75MB due to Pydantic dependency.

This will increase the compressed package size by approximately 25MB due to the Pydantic dependency.

To reduce the impact on the package size at the expense of 30%-50% of its performance [Pydantic can also be
installed without binary files](https://pydantic-docs.helpmanual.io/install/#performance-vs-package-size-trade-off):

`SKIP_CYTHON=1 pip install --no-binary pydantic aws-lambda-powertools[pydantic]`

Install parser's extra dependencies using **`pip install aws-lambda-powertools[pydantic]`**.

Expand Down

0 comments on commit fe98327

Please sign in to comment.