This applicaiton if serverless.com python so is not intended to be installed and used as a local application.
- clone the repo
- check/install a recent node version >=17.8
- check/install a recent npm version >=8.11
- install serverless
npm install --save serverless
more info - install
npm install --save serverless-python-requirements
more info - install
npm install -save serverless-wsgi
more info serverless plugin install -n serverless-python-requirements
serverless plugin install -n serverless-wsgi
Now sls info
should print something like ...
chrisbc@tryharder-ubuntu:/GNSDATA/API/kororaa-graphql-api$ sls info
Running "serverless" from node_modules
Environment: linux, node 17.8.0, framework 3.18.2 (local) 3.10.1v (global), plugin 6.2.2, SDK 4.3.2
Credentials: Local, "default" profile
Docs: docs.serverless.com
Support: forum.serverless.com
Bugs: github.com/serverless/serverless/issue
You'll problably see an error, if youtr AWS credentials are not thise required for SLS.
$> ENABLE_METRICS=0 AWS_PROFILE=toshi_batch_devops sls wsgi serve --region ap-southeast-2 --stage PROD
You need an environment variable set: TESTING=1
othereise Moto mocking for S3 is clobbered.
Using the poetry-dotenv-plugin
you can create an .env file like so...
echo TESTING=1 > .env
then $>poetry run pytest
sholud just work.