@vercel/python 6.33.0 → 6.33.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +16 -8
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -4314,6 +4314,11 @@ var readFile = (0, import_util.promisify)(import_fs5.default.readFile);
4314
4314
  var LAMBDA_SIZE_THRESHOLD_BYTES = 245 * 1024 * 1024;
4315
4315
  var LAMBDA_EPHEMERAL_STORAGE_BYTES = 500 * 1024 * 1024;
4316
4316
  var HIVE_LAMBDA_SIZE_BYTES = 1 * 1024 * 1024 * 1024;
4317
+ var FUNCTIONS_BETA_CTA = "Run `vercel deploy --functions-beta` to use extended function limits (up to 1 GB), or reduce your dependency footprint.";
4318
+ function shouldShowFunctionsBetaHint() {
4319
+ const v = process.env.VERCEL_FUNCTIONS_BETA_HINT;
4320
+ return v === "1" || v === "true";
4321
+ }
4317
4322
  var PythonDependencyExternalizer = class {
4318
4323
  constructor(options) {
4319
4324
  // Populated by analyze()
@@ -4368,7 +4373,9 @@ var PythonDependencyExternalizer = class {
4368
4373
  const limitMB = (LAMBDA_SIZE_THRESHOLD_BYTES / (1024 * 1024)).toFixed(0);
4369
4374
  throw new import_build_utils5.NowBuildError({
4370
4375
  code: "LAMBDA_SIZE_EXCEEDED",
4371
- message: `Total bundle size (${totalBundleSizeMB} MB) exceeds the Lambda size limit (${limitMB} MB).
4376
+ message: shouldShowFunctionsBetaHint() ? `Total bundle size (${totalBundleSizeMB} MB) exceeds the size limit (${limitMB} MB).
4377
+
4378
+ ` + FUNCTIONS_BETA_CTA : `Total bundle size (${totalBundleSizeMB} MB) exceeds the Lambda size limit (${limitMB} MB).
4372
4379
 
4373
4380
  Runtime dependency installation is not available for projects that use a custom build or install command, because custom commands may install dependencies that are not tracked in uv.lock.
4374
4381
 
@@ -4420,7 +4427,9 @@ To resolve this, either:
4420
4427
  const ephemeralLimitMB = (LAMBDA_EPHEMERAL_STORAGE_BYTES / (1024 * 1024)).toFixed(0);
4421
4428
  throw new import_build_utils5.NowBuildError({
4422
4429
  code: "LAMBDA_SIZE_EXCEEDED",
4423
- message: `Total dependency size (${totalBundleSizeMB} MB) exceeds Lambda ephemeral storage limit (${ephemeralLimitMB} MB). Even with runtime dependency installation, all packages must fit within the ${ephemeralLimitMB} MB ephemeral storage available to Lambda functions. Consider removing unused dependencies or splitting your application into smaller functions.`,
4430
+ message: shouldShowFunctionsBetaHint() ? `Total dependency size (${totalBundleSizeMB} MB) exceeds the size limit (${ephemeralLimitMB} MB).
4431
+
4432
+ ` + FUNCTIONS_BETA_CTA : `Total dependency size (${totalBundleSizeMB} MB) exceeds Lambda ephemeral storage limit (${ephemeralLimitMB} MB). Even with runtime dependency installation, all packages must fit within the ${ephemeralLimitMB} MB ephemeral storage available to Lambda functions. Consider removing unused dependencies or splitting your application into smaller functions.`,
4424
4433
  link: "https://vercel.com/docs/functions/runtimes/python#controlling-what-gets-bundled",
4425
4434
  action: "Learn More"
4426
4435
  });
@@ -4614,7 +4623,9 @@ To fix this, either:
4614
4623
  const limitMB = (LAMBDA_SIZE_THRESHOLD_BYTES / (1024 * 1024)).toFixed(0);
4615
4624
  throw new import_build_utils5.NowBuildError({
4616
4625
  code: "LAMBDA_SIZE_EXCEEDED",
4617
- message: `Bundle size (${finalSizeMB} MB) exceeds Lambda limit (${limitMB} MB) even after deferring public packages to runtime installation. This usually means your private packages or source code are too large. Consider reducing the size of private dependencies or splitting your application.`,
4626
+ message: shouldShowFunctionsBetaHint() ? `Bundle size (${finalSizeMB} MB) exceeds the size limit (${limitMB} MB).
4627
+
4628
+ ` + FUNCTIONS_BETA_CTA : `Bundle size (${finalSizeMB} MB) exceeds Lambda limit (${limitMB} MB) even after deferring public packages to runtime installation. This usually means your private packages or source code are too large. Consider reducing the size of private dependencies or splitting your application.`,
4618
4629
  link: "https://vercel.com/docs/functions/runtimes/python#controlling-what-gets-bundled",
4619
4630
  action: "Learn More"
4620
4631
  });
@@ -7304,10 +7315,7 @@ from vercel_runtime.vc_init import vc_handler
7304
7315
  }
7305
7316
  const lambdaPath = service?.name ? `_svc/${service.name}/index` : "index";
7306
7317
  const staticFiles = djangoStatic?.cdnOutputDir ? await (0, import_build_utils16.glob)("**", { cwd: djangoStatic.cdnOutputDir }) : {};
7307
- const routes = [
7308
- { handle: "filesystem" },
7309
- { src: "/(.*)", dest: `/${lambdaPath}` }
7310
- ];
7318
+ const routes = service?.name ? void 0 : [{ handle: "filesystem" }, { src: "/(.*)", dest: `/${lambdaPath}` }];
7311
7319
  return {
7312
7320
  resultVersion: 2,
7313
7321
  result: {
@@ -7315,7 +7323,7 @@ from vercel_runtime.vc_init import vc_handler
7315
7323
  [lambdaPath]: output,
7316
7324
  ...staticFiles
7317
7325
  },
7318
- routes,
7326
+ ...routes ? { routes } : {},
7319
7327
  crons
7320
7328
  }
7321
7329
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/python",
3
- "version": "6.33.0",
3
+ "version": "6.33.1",
4
4
  "main": "./dist/index.js",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://vercel.com/docs/runtimes#official-runtimes/python",
@@ -36,8 +36,8 @@
36
36
  "smol-toml": "1.5.2",
37
37
  "vitest": "2.1.4",
38
38
  "which": "3.0.0",
39
- "@vercel/error-utils": "2.0.3",
40
39
  "@vercel/build-utils": "13.17.0",
40
+ "@vercel/error-utils": "2.0.3",
41
41
  "@vercel/python-runtime": "0.13.0"
42
42
  },
43
43
  "scripts": {