Solvedjsonschema Package version mechanism incompatible with AWS Lambda
✔️Accepted Answer
@Julian Perhaps a blurb can be added to the docs related to deploying this library using Serverless?
If deploying with Serverless framework, ensure that *.dist-info
files are included in the deployed .zip file using something like this:
pythonRequirements:
dockerizePip: non-linux
useDownloadCache: false
useStaticCache: false
slim: true
slimPatternsAppendDefaults: false
slimPatterns:
- '**/*.py[c|o]'
- '**/__pycache__*'
Otherwise you be unable to import the library. By default, the serverless-python-requirements
plugin ignores these files when using slim
mode.
Other Answers:
Can you please add a note to the front page of the documentation that this library is not Lambda-compatible? I just threw a few hours down the drain that could have easily been avoided were this prominently noted.
Also, on a side-note, labeling Lambda an "uncommon" platform is perhaps a bit out-of-touch. My current project is about 90% lambda code vs traditional server instances and I don't believe my approach is unusual.
In any case, breaking backwards-compatibility without a really good reason is always a bad idea.
For my own use, I've pinned this package to 3.0.2 and I guess I will be forced to maintain a fork going forward.
Tested on AWS Lambda. Following code does not work on AWS Lambda due to lack of package manager.
jsonschema/jsonschema/__init__.py
Lines 32 to 33 in e4fa34f
It has beed added in b07d0f1 commit.
Stacktrace I'm getting