From 9af957df01efad976bcd525524bdeca97b04d7e0 Mon Sep 17 00:00:00 2001 From: Trek Glowacki Date: Thu, 21 Sep 2023 12:48:04 -0500 Subject: [PATCH 1/3] No longer rely on system Python for installs of python3 runtime --- src/runtimes/python3/index.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/runtimes/python3/index.ts b/src/runtimes/python3/index.ts index 1effd2d..e835338 100644 --- a/src/runtimes/python3/index.ts +++ b/src/runtimes/python3/index.ts @@ -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 { - await initializeRuntime(runtimes.python); +export async function init({ cacheDir }: Runtime): Promise { + await Promise.all([ + initializeRuntime(runtimes.python), + installPython(cacheDir, '3.6.8') + ]); } From 8bd90929542d3173559cfb872c4575269dda1b1b Mon Sep 17 00:00:00 2001 From: Trek Glowacki Date: Thu, 21 Sep 2023 13:52:00 -0500 Subject: [PATCH 2/3] Remove mention of fallback behavior --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c40931a..57fdcba 100644 --- a/README.md +++ b/README.md @@ -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 From f49d88d485fea4a5b27ed3f62f2dd5e6ebb90a7e Mon Sep 17 00:00:00 2001 From: Trek Glowacki Date: Thu, 21 Sep 2023 13:59:00 -0500 Subject: [PATCH 3/3] Update python3 test --- test/test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test.ts b/test/test.ts index 01db243..7b7ffa7 100644 --- a/test/test.ts +++ b/test/test.ts @@ -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'); } ) );