06.11.2018 · npm install serverless-plugin-simulate --save-dev npm install serverless-python-requirements --save-dev Then add a bit of configuration to the serverless.yml .
The plugin serverless-python-requirements uses cache. Make sure to clean it before package your service. Furthermore, psycopg requires to be compiled with a lambda environment: # serverless.yaml custom: pythonRequirements: dockerizePip: true # bash $ serverless requirements cleanCache $ serverless deploy --stage <stage>.
Lazy loading of your files with require cache invalidation: no need for a reloading tool like Nodemon. ... npm install serverless-offline-python --save-dev.
Does this plug-in works with serverless-python-requirements? I have module in serverless.yml and requirement.txt for python, but it completely ignored. An example of serverless-python-requirements would be great. Thanks, Ali
If you have different python functions, with different sets of requirements, you can avoid including all the unecessary dependencies of your functions by using the following structure: ├── serverless.yml ├── function1 │ ├── requirements.txt │ └── index.py └── function2 ├── requirements.txt └── index.py