@vercel/python 6.33.0 → 6.33.2

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 +18 -12
  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,13 +4373,13 @@ 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).
4372
4377
 
4373
- 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.
4378
+ ` + FUNCTIONS_BETA_CTA : `Total bundle size (${totalBundleSizeMB} MB) exceeds the size limit (${limitMB} MB).
4374
4379
 
4375
- To resolve this, either:
4376
- 1. Remove the custom build/install command and let Vercel manage dependencies automatically
4377
- 2. Reduce your dependency footprint to fit within the ${limitMB} MB limit`,
4380
+ When using a custom install command, Vercel cannot automatically optimize dependency bundling. To reduce the size of your dependencies, you can:
4381
+ 1. Remove unused dependencies from your project
4382
+ 2. Remove the custom install command to allow Vercel to manage and optimize dependencies automatically`,
4378
4383
  link: "https://vercel.com/docs/functions/runtimes/python#controlling-what-gets-bundled",
4379
4384
  action: "Learn More"
4380
4385
  });
@@ -4420,7 +4425,9 @@ To resolve this, either:
4420
4425
  const ephemeralLimitMB = (LAMBDA_EPHEMERAL_STORAGE_BYTES / (1024 * 1024)).toFixed(0);
4421
4426
  throw new import_build_utils5.NowBuildError({
4422
4427
  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.`,
4428
+ message: shouldShowFunctionsBetaHint() ? `Total bundle size (${totalBundleSizeMB} MB) exceeds the ephemeral storage limit (${ephemeralLimitMB} MB).
4429
+
4430
+ ` + FUNCTIONS_BETA_CTA : `Total bundle 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
4431
  link: "https://vercel.com/docs/functions/runtimes/python#controlling-what-gets-bundled",
4425
4432
  action: "Learn More"
4426
4433
  });
@@ -4614,7 +4621,9 @@ To fix this, either:
4614
4621
  const limitMB = (LAMBDA_SIZE_THRESHOLD_BYTES / (1024 * 1024)).toFixed(0);
4615
4622
  throw new import_build_utils5.NowBuildError({
4616
4623
  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.`,
4624
+ message: shouldShowFunctionsBetaHint() ? `Total bundle size (${finalSizeMB} MB) exceeds the size limit (${limitMB} MB).
4625
+
4626
+ ` + FUNCTIONS_BETA_CTA : `Total 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
4627
  link: "https://vercel.com/docs/functions/runtimes/python#controlling-what-gets-bundled",
4619
4628
  action: "Learn More"
4620
4629
  });
@@ -7304,10 +7313,7 @@ from vercel_runtime.vc_init import vc_handler
7304
7313
  }
7305
7314
  const lambdaPath = service?.name ? `_svc/${service.name}/index` : "index";
7306
7315
  const staticFiles = djangoStatic?.cdnOutputDir ? await (0, import_build_utils16.glob)("**", { cwd: djangoStatic.cdnOutputDir }) : {};
7307
- const routes = [
7308
- { handle: "filesystem" },
7309
- { src: "/(.*)", dest: `/${lambdaPath}` }
7310
- ];
7316
+ const routes = service?.name ? void 0 : [{ handle: "filesystem" }, { src: "/(.*)", dest: `/${lambdaPath}` }];
7311
7317
  return {
7312
7318
  resultVersion: 2,
7313
7319
  result: {
@@ -7315,7 +7321,7 @@ from vercel_runtime.vc_init import vc_handler
7315
7321
  [lambdaPath]: output,
7316
7322
  ...staticFiles
7317
7323
  },
7318
- routes,
7324
+ ...routes ? { routes } : {},
7319
7325
  crons
7320
7326
  }
7321
7327
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/python",
3
- "version": "6.33.0",
3
+ "version": "6.33.2",
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/build-utils": "13.17.1",
39
40
  "@vercel/error-utils": "2.0.3",
40
- "@vercel/build-utils": "13.17.0",
41
41
  "@vercel/python-runtime": "0.13.0"
42
42
  },
43
43
  "scripts": {