Skip to content

Commit

Permalink
fix python version
Browse files Browse the repository at this point in the history
  • Loading branch information
jgtvares committed Dec 27, 2021
1 parent 058523a commit 0fd29b0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,12 @@ handler. This can cause issues if your project requires a different version of

### `runtime`

Select the lambda runtime. Defaults to `python3.8`.
Select the lambda runtime. Defaults to `python3.9`.

```json
{
"builds": [{
"config": { "runtime": "python3.8" }
"config": { "runtime": "python3.9" }
}]
}
```
Expand Down
4 changes: 1 addition & 3 deletions build-utils/python.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ const log = require('./log');


const runtimeBinaryMap = [
'python2.7',
'python3.6',
'python3.7',
'python3.8',
'python3.9',
];


Expand Down
6 changes: 4 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ const {
} = require('./build-utils');


const DEFAULT_PYTHON_VERSION = 'python3.9';

exports.config = {
maxLambdaSize: '15mb',
};
Expand All @@ -27,7 +29,7 @@ exports.build = async ({ files, entrypoint, config }) => {
);
log.info(`Build AMI version: ${systemReleaseContents.trim()}`);

const runtime = config.runtime || 'python3.8';
const runtime = config.runtime || DEFAULT_PYTHON_VERSION;
python.validateRuntime(runtime);
log.info(`Lambda runtime: ${runtime}`);

Expand Down Expand Up @@ -75,7 +77,7 @@ exports.build = async ({ files, entrypoint, config }) => {
const lambda = await createLambda({
files: await glob('**', srcDir),
handler: 'lambda.vercel_handler',
runtime: `${config.runtime || 'python3.8'}`,
runtime: `${config.runtime || DEFAULT_PYTHON_VERSION}`,
environment: {
WSGI_APPLICATION: `${wsgiApplication}`,
},
Expand Down

0 comments on commit 0fd29b0

Please sign in to comment.