Skip to content

Commit ef560d2

Browse files
committed
No longer rely on system Python for installs of python3 runtime (#93)
1 parent a8b371c commit ef560d2

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ implemented are:
8080
* `nodejs14.x` for Node.js Lambda functions using a downloaded Node v14.18.1 binary
8181
* `python` for Python Lambda functions using the system `python` binary
8282
* `python2.7` for Python Lambda functions using a downloaded Python v2.7.12 binary
83-
* `python3` for Python Lambda functions using the system `python3` binary (or fallback to `python`)
83+
* `python3` for Python Lambda functions using the system `python3` binary
8484
* `python3.6` for Python Lambda functions using a downloaded Python v3.6.8 binary
8585
* `python3.7` for Python Lambda functions using a downloaded Python v3.7.2 binary
8686
* `go1.x` for Lambda functions written in Go - binary must be compiled for your platform

src/runtimes/python3/index.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
import { Runtime } from '../../types';
2+
import { installPython } from '../../install-python';
23
import { runtimes, initializeRuntime } from '../../runtimes';
34

4-
export async function init(_runtime: Runtime): Promise<void> {
5-
await initializeRuntime(runtimes.python);
5+
export async function init({ cacheDir }: Runtime): Promise<void> {
6+
await Promise.all([
7+
initializeRuntime(runtimes.python),
8+
installPython(cacheDir, '3.6.8')
9+
]);
610
}

test/test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -719,7 +719,7 @@ it(
719719
}),
720720
async fn => {
721721
const payload = await fn();
722-
assert.equal(payload['platform.python_version'][0], '3');
722+
assert.equal(payload['platform.python_version'], '3.6.8');
723723
}
724724
)
725725
);

0 commit comments

Comments
 (0)