[python] Add python3.12 (#11478)

Allows for `python3.12` to be used when the build is being run in the AL2023 build container (Node v20 project setting). This version is not usable in the AL2 image because `python3.12` is not installed there.

The e2e tests now default to running in AL2023, except for a few fixtures which require an older version of Python.
This commit is contained in:
Nathan Rajlich
2024-04-23 13:56:44 -07:00
committed by GitHub
parent 4c018d4b78
commit adcfc365a7
9 changed files with 43 additions and 11 deletions

View File

@@ -11,6 +11,12 @@ interface PythonVersion {
// The order must be most recent first
const allOptions: PythonVersion[] = [
{
version: '3.12',
pipPath: 'pip3.12',
pythonPath: 'python3.12',
runtime: 'python3.12',
},
{
version: '3.11',
pipPath: 'pip3.11',

View File

@@ -0,0 +1,5 @@
{
"engines": {
"node": "18.x"
}
}

View File

@@ -0,0 +1,5 @@
{
"engines": {
"node": "18.x"
}
}

View File

@@ -0,0 +1,5 @@
{
"engines": {
"node": "18.x"
}
}

View File

@@ -0,0 +1,5 @@
{
"engines": {
"node": "18.x"
}
}

View File

@@ -0,0 +1,5 @@
{
"engines": {
"node": "18.x"
}
}

View File

@@ -0,0 +1,5 @@
{
"engines": {
"node": "18.x"
}
}

View File

@@ -28,19 +28,12 @@ module.exports = function setupTests(groupIndex) {
// eslint-disable-next-line no-restricted-syntax
for (const fixture of chunkedFixtures) {
// Python endpoints currently require the AL2 build image
const projectSettings = {
nodeVersion: '18.x',
};
const errMsg = testsThatFailToBuild.get(fixture);
if (errMsg) {
// eslint-disable-next-line no-loop-func
it(`should fail to build ${fixture}`, async () => {
try {
await testDeployment(path.join(fixturesPath, fixture), {
projectSettings,
});
await testDeployment(path.join(fixturesPath, fixture));
} catch (err) {
expect(err).toBeTruthy();
expect(err.deployment).toBeTruthy();
@@ -52,9 +45,7 @@ module.exports = function setupTests(groupIndex) {
// eslint-disable-next-line no-loop-func
it(`should build ${fixture}`, async () => {
await expect(
testDeployment(path.join(fixturesPath, fixture), {
projectSettings,
})
testDeployment(path.join(fixturesPath, fixture))
).resolves.toBeDefined();
});
}