Skip to content

Commit

Permalink
No longer rely on system Python for installs of python3 runtime (#93)
Browse files Browse the repository at this point in the history
  • Loading branch information
trek committed Sep 25, 2023
1 parent a8b371c commit ef560d2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ implemented are:
* `nodejs14.x` for Node.js Lambda functions using a downloaded Node v14.18.1 binary
* `python` for Python Lambda functions using the system `python` binary
* `python2.7` for Python Lambda functions using a downloaded Python v2.7.12 binary
* `python3` for Python Lambda functions using the system `python3` binary (or fallback to `python`)
* `python3` for Python Lambda functions using the system `python3` binary
* `python3.6` for Python Lambda functions using a downloaded Python v3.6.8 binary
* `python3.7` for Python Lambda functions using a downloaded Python v3.7.2 binary
* `go1.x` for Lambda functions written in Go - binary must be compiled for your platform
Expand Down
8 changes: 6 additions & 2 deletions src/runtimes/python3/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import { Runtime } from '../../types';
import { installPython } from '../../install-python';
import { runtimes, initializeRuntime } from '../../runtimes';

export async function init(_runtime: Runtime): Promise<void> {
await initializeRuntime(runtimes.python);
export async function init({ cacheDir }: Runtime): Promise<void> {
await Promise.all([
initializeRuntime(runtimes.python),
installPython(cacheDir, '3.6.8')
]);
}
2 changes: 1 addition & 1 deletion test/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,7 @@ it(
}),
async fn => {
const payload = await fn();
assert.equal(payload['platform.python_version'][0], '3');
assert.equal(payload['platform.python_version'], '3.6.8');
}
)
);
Expand Down

0 comments on commit ef560d2

Please sign in to comment.