Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python usage example #728

Closed
Selion05 opened this issue Jul 3, 2019 · 6 comments
Closed

python usage example #728

Selion05 opened this issue Jul 3, 2019 · 6 comments
Labels

Comments

@Selion05
Copy link

Selion05 commented Jul 3, 2019

how can i use python as runtime?

I tried your manual python test but it is not working

Serverless: GET /hello (λ: hello)
Serverless: Replying timeout after 30000ms

@Selion05
Copy link
Author

Selion05 commented Jul 3, 2019

just tested sls invoke local -f hello works

@dnalborczyk
Copy link
Collaborator

hey @Selion05 , do you have any more details to your problem?

@Selion05
Copy link
Author

Selion05 commented Jul 4, 2019

Sure :)

I wanted to use python as runtime for one of my lambdas
so basically what I did is

git clone git@github.com:dherault/serverless-offline.git
cd serverless-offline
npm install 
npm link 
cd manual_test_python
npm link serverless-offline
sls offline start

and then $ curl 'http://localhost:3000/hello' -i

HTTP/1.1 200 OK
content-type: application/json; charset=utf-8
cache-control: no-cache
content-length: 0
Date: Thu, 04 Jul 2019 07:46:58 GMT
Connection: keep-alive

I get an empty response. But if I run $ sls invoke local -f hello

{
"body": "{"input": {}, "message": "Go Serverless v1.0! Your function executed successfully!"}",
"statusCode": 200
}

which is what I expected.

So now I'm not sure if I forgot something or if it's a bug

@dnalborczyk
Copy link
Collaborator

dnalborczyk commented Jul 4, 2019

hey @Selion05 just reverted a commit which broke the functionality. should be fixed with the next release. if you pull the latest master again it should work. (note: there still seems to be a timeout issue.)

from npm: I fairly safe version to use should be v5.4.2 (until master is released)

@dherault
Copy link
Owner

dherault commented Jul 6, 2019

v5.6.1

@dherault
Copy link
Owner

dherault commented Jul 6, 2019

Thanks @dnalborczyk for the awesome work once again! I like what you did it is so clean! Please PR next time though to ease the review process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants