mirror of
https://github.com/LukeHagar/vercel.git
synced 2025-12-10 21:07:48 +00:00
[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:
@@ -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',
|
||||
|
||||
5
packages/python/test/fixtures/00-request-path/package.json
vendored
Normal file
5
packages/python/test/fixtures/00-request-path/package.json
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"engines": {
|
||||
"node": "18.x"
|
||||
}
|
||||
}
|
||||
5
packages/python/test/fixtures/11-asgi/package.json
vendored
Normal file
5
packages/python/test/fixtures/11-asgi/package.json
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"engines": {
|
||||
"node": "18.x"
|
||||
}
|
||||
}
|
||||
5
packages/python/test/fixtures/12-asgi-function/package.json
vendored
Normal file
5
packages/python/test/fixtures/12-asgi-function/package.json
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"engines": {
|
||||
"node": "18.x"
|
||||
}
|
||||
}
|
||||
5
packages/python/test/fixtures/20-multivalue-header/package.json
vendored
Normal file
5
packages/python/test/fixtures/20-multivalue-header/package.json
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"engines": {
|
||||
"node": "18.x"
|
||||
}
|
||||
}
|
||||
5
packages/python/test/fixtures/28-pydantic/package.json
vendored
Normal file
5
packages/python/test/fixtures/28-pydantic/package.json
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"engines": {
|
||||
"node": "18.x"
|
||||
}
|
||||
}
|
||||
5
packages/python/test/fixtures/32-fail-duplicate-header/package.json
vendored
Normal file
5
packages/python/test/fixtures/32-fail-duplicate-header/package.json
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"engines": {
|
||||
"node": "18.x"
|
||||
}
|
||||
}
|
||||
13
packages/python/test/integration-setup.js
vendored
13
packages/python/test/integration-setup.js
vendored
@@ -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();
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user