@vercel/python 6.13.0 → 6.14.0

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 +12 -5
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -21987,6 +21987,7 @@ function isInstalled({ version: version2 }) {
21987
21987
 
21988
21988
  // src/install.ts
21989
21989
  var LAMBDA_SIZE_THRESHOLD_BYTES = 249 * 1024 * 1024;
21990
+ var LAMBDA_EPHEMERAL_STORAGE_BYTES = 500 * 1024 * 1024;
21990
21991
  var makeDependencyCheckCode = (dependency) => `
21991
21992
  from importlib import util
21992
21993
  dep = '${dependency}'.replace('-', '_')
@@ -23307,7 +23308,6 @@ ${pipfileLockContent}`
23307
23308
  `uv is required for this project but failed to install: ${err instanceof Error ? err.message : String(err)}`
23308
23309
  );
23309
23310
  }
23310
- const runtimeInstallFeatureEnabled = process.env.VERCEL_EXPERIMENTAL_PYTHON_UV_INSTALL_ON_STARTUP === "1" || process.env.VERCEL_EXPERIMENTAL_PYTHON_UV_INSTALL_ON_STARTUP === "true";
23311
23311
  let uvLockPath = null;
23312
23312
  let uvProjectDir = null;
23313
23313
  let projectName;
@@ -23319,8 +23319,8 @@ ${pipfileLockContent}`
23319
23319
  repoRootPath,
23320
23320
  pythonVersion: pythonVersion.version,
23321
23321
  uv,
23322
- generateLockFile: runtimeInstallFeatureEnabled,
23323
- requireBinaryWheels: runtimeInstallFeatureEnabled
23322
+ generateLockFile: true,
23323
+ requireBinaryWheels: false
23324
23324
  });
23325
23325
  uvLockPath = lockPath;
23326
23326
  uvProjectDir = projectDir;
@@ -23330,7 +23330,7 @@ ${pipfileLockContent}`
23330
23330
  repoRootPath
23331
23331
  });
23332
23332
  projectName = installInfo.pythonPackage?.manifest?.data?.project?.name;
23333
- if (lockFileProvidedByUser && runtimeInstallFeatureEnabled) {
23333
+ if (lockFileProvidedByUser) {
23334
23334
  try {
23335
23335
  await uv.sync({
23336
23336
  venvPath,
@@ -23439,11 +23439,18 @@ from vercel_runtime.vc_init import vc_handler
23439
23439
  const totalBundleSize = await calculateBundleSize(tempFilesForSizing);
23440
23440
  const totalBundleSizeMB = (totalBundleSize / (1024 * 1024)).toFixed(2);
23441
23441
  (0, import_build_utils8.debug)(`Total bundle size: ${totalBundleSizeMB} MB`);
23442
- const runtimeInstallEnabled = runtimeInstallFeatureEnabled && totalBundleSize > LAMBDA_SIZE_THRESHOLD_BYTES && uvLockPath !== null;
23442
+ const runtimeInstallEnabled = totalBundleSize > LAMBDA_SIZE_THRESHOLD_BYTES && uvLockPath !== null;
23443
23443
  if (runtimeInstallEnabled && uvLockPath && uvProjectDir) {
23444
23444
  console.log(
23445
23445
  `Bundle size (${totalBundleSizeMB} MB) exceeds limit. Enabling runtime dependency installation.`
23446
23446
  );
23447
+ if (totalBundleSize > LAMBDA_EPHEMERAL_STORAGE_BYTES) {
23448
+ const ephemeralLimitMB = (LAMBDA_EPHEMERAL_STORAGE_BYTES / (1024 * 1024)).toFixed(0);
23449
+ throw new import_build_utils8.NowBuildError({
23450
+ code: "LAMBDA_SIZE_EXCEEDED",
23451
+ 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.`
23452
+ });
23453
+ }
23447
23454
  if (noBuildCheckFailed) {
23448
23455
  throw new import_build_utils8.NowBuildError({
23449
23456
  code: "RUNTIME_DEPENDENCY_INSTALLATION_FAILED",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/python",
3
- "version": "6.13.0",
3
+ "version": "6.14.0",
4
4
  "main": "./dist/index.js",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://vercel.com/docs/runtimes#official-runtimes/python",
@@ -31,7 +31,7 @@
31
31
  "smol-toml": "1.5.2",
32
32
  "vitest": "2.1.4",
33
33
  "which": "3.0.0",
34
- "@vercel/build-utils": "13.4.0",
34
+ "@vercel/build-utils": "13.4.1",
35
35
  "@vercel/error-utils": "2.0.3",
36
36
  "@vercel/python-analysis": "0.4.1"
37
37
  },