Hi quick question, I am just getting started and h...
# help
h
Hi quick question, I am just getting started and have run the following commands listed in the docs •
npx create-serverless-stack@latest my-sst-app --language python
npm run test
I get the following error:
Cannot find a handler file at src/lambda.js".
Is it possible to change the default extension sst looks for to .py? instead of .js?
j
Is the error on the test command?
It might be that the test command isn’t running the Python files.
What’s the extension of the file in the src directory?
h
Ah its because the default code generated doesnt include the
runtime: "python3.7"
configuration when the API is defined. However, it does seem a bit weird because the default function props are already set in index.ts
app.setDefaultFunctionProps({
runtime: "python3.7"
});
j
Hmm that’s weird. @Frank can you take a look at this?
f
Yup, taking a look.
Hey @Hosy Mia, in your
test/MyStack.test.js
, replace
Copy code
const app = new <http://sst.App|sst.App>();
with
Copy code
const app = new <http://sst.App|sst.App>();
  app.setDefaultFunctionProps({
    runtime: "python3.7"
  });
Each test creates a new
<http://sst.App|sst.App>
object in this case.
Hey @Hosy Mia, we just release v0.32.1 with a change to the
create-serverless-stack
Python template to set the default function props in the test, similar to the code snippet above.
Thanks for pointing it out!