serverless-s3-local icon indicating copy to clipboard operation
serverless-s3-local copied to clipboard

Python support?

Open cpvandehey opened this issue 7 years ago • 7 comments

I've opened this Stack Overflow question regarding an error that I am seeing in python. Does serverless-s3-local support invoking python handlers?

https://stackoverflow.com/questions/53398606/serverless-offline-error-while-running-handler-cannot-find-module

cpvandehey avatar Nov 20 '18 17:11 cpvandehey

After some investigation, I saw that the JS runtime works out of the box. This did not work for me as I wanted to use python 3.

I implemented a quick fix to work around this for a while:

I changed all instances of serverless-offline to serverless-offline-python

AND

I added this at line 303: funOptions["serviceRuntime"] = "python3.6"

In short, I found that the run time environment is required to run the python script (while javascript doesn't require this).

cpvandehey avatar Nov 21 '18 02:11 cpvandehey

Let me know if you're interested in a PR and we can work to make this multi-runtime capable.

cpvandehey avatar Nov 21 '18 02:11 cpvandehey

@cpvandehey Thanks for your great work !! It is good news for me. I’m interested in your PR about multi-runtime capable. But I have a request to your PR. I want to maintain the compatibility to serverless-offline. It means that users can choise serverless-offline or serverless-offline-python.

ar90n avatar Nov 22 '18 01:11 ar90n

Hi,

I tried @cpvandehey's solution, but couldn't get it to work. Has there been any progress on this issue?

magnusmoan avatar Apr 05 '19 10:04 magnusmoan

Hi @magnusmoan

Unfortunately, as long as I know there is no progress yet.

ar90n avatar Apr 06 '19 18:04 ar90n

I updated the depending version of serverless-offline. So serverless-s3-local could invoke handlers which are written in python from v0.4.0. Please see this example.

ar90n avatar Apr 19 '19 14:04 ar90n

@ar90n hi, you can to better specify the README.ME. i don't undertaind right

Weigle avatar Aug 26 '19 21:08 Weigle