@vercel/python 6.43.1 → 6.43.3

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 +24 -4
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -3231,7 +3231,7 @@ var import_fs13 = __toESM(require("fs"));
3231
3231
  var import_path13 = require("path");
3232
3232
 
3233
3233
  // src/package-versions.ts
3234
- var VERCEL_RUNTIME_VERSION = "0.14.0";
3234
+ var VERCEL_RUNTIME_VERSION = "0.14.1";
3235
3235
  var VERCEL_WORKERS_VERSION = "0.0.24";
3236
3236
 
3237
3237
  // src/index.ts
@@ -4461,7 +4461,26 @@ var import_path6 = require("path");
4461
4461
  var import_build_utils6 = require("@vercel/build-utils");
4462
4462
  var import_python_analysis3 = require("@vercel/python-analysis");
4463
4463
  var readFile = (0, import_util.promisify)(import_fs5.default.readFile);
4464
- var LAMBDA_SIZE_THRESHOLD_BYTES = 245 * 1024 * 1024;
4464
+ var STRIP_BASENAMES = /* @__PURE__ */ new Set([
4465
+ "py.typed",
4466
+ "WHEEL",
4467
+ "INSTALLER",
4468
+ "direct_url.json"
4469
+ ]);
4470
+ function shouldStripVendorFile(filePath) {
4471
+ const segments = filePath.split(import_path6.sep);
4472
+ if (segments.includes("__pycache__"))
4473
+ return true;
4474
+ const name = segments[segments.length - 1] ?? "";
4475
+ if (name.endsWith(".pyc") || name.endsWith(".pyi"))
4476
+ return true;
4477
+ if (STRIP_BASENAMES.has(name))
4478
+ return true;
4479
+ return false;
4480
+ }
4481
+ var LAMBDA_BASE_SIZE_THRESHOLD_BYTES = 245 * 1024 * 1024;
4482
+ var OTEL_LAYER_RESERVATION_BYTES = 5 * 1024 * 1024;
4483
+ var LAMBDA_SIZE_THRESHOLD_BYTES = process.env.VERCEL_DEPLOYMENT_HAS_OTEL_LAYER === "1" ? LAMBDA_BASE_SIZE_THRESHOLD_BYTES - OTEL_LAYER_RESERVATION_BYTES : LAMBDA_BASE_SIZE_THRESHOLD_BYTES;
4465
4484
  var LAMBDA_EPHEMERAL_STORAGE_BYTES = 500 * 1024 * 1024;
4466
4485
  var HIVE_LAMBDA_SIZE_BYTES = 1 * 1024 * 1024 * 1024;
4467
4486
  var FUNCTIONS_BETA_CTA = "Run `vercel deploy --functions-beta` to use extended function limits (up to 1 GB), or reduce your dependency footprint.";
@@ -4931,7 +4950,7 @@ splitting your application.`,
4931
4950
  if (!(0, import_path6.resolve)(resolvedDir, filePath).startsWith(dirPrefix)) {
4932
4951
  continue;
4933
4952
  }
4934
- if (filePath.endsWith(".pyc") || filePath.split(import_path6.sep).includes("__pycache__")) {
4953
+ if (shouldStripVendorFile(filePath)) {
4935
4954
  continue;
4936
4955
  }
4937
4956
  const srcFsPath = (0, import_path6.join)(dir, filePath);
@@ -5000,7 +5019,7 @@ splitting your application.`,
5000
5019
  if (!(0, import_path6.resolve)(resolvedDir, filePath).startsWith(dirPrefix)) {
5001
5020
  continue;
5002
5021
  }
5003
- if (filePath.endsWith(".pyc") || filePath.split(import_path6.sep).includes("__pycache__")) {
5022
+ if (shouldStripVendorFile(filePath)) {
5004
5023
  continue;
5005
5024
  }
5006
5025
  if (recordSize !== void 0 && recordSize !== null) {
@@ -7768,6 +7787,7 @@ from vercel_runtime.vc_init import vc_handler
7768
7787
  ];
7769
7788
  const lambdaEnv = {};
7770
7789
  lambdaEnv.PYTHONPATH = vendorDir;
7790
+ lambdaEnv.PYTHONDONTWRITEBYTECODE = "1";
7771
7791
  Object.assign(lambdaEnv, quirksResult.env);
7772
7792
  if (shouldInstallVercelWorkers) {
7773
7793
  lambdaEnv.VERCEL_HAS_WORKER_SERVICES = "1";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/python",
3
- "version": "6.43.1",
3
+ "version": "6.43.3",
4
4
  "main": "./dist/index.js",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://vercel.com/docs/runtimes#official-runtimes/python",
@@ -34,9 +34,9 @@
34
34
  "smol-toml": "1.5.2",
35
35
  "vitest": "2.1.4",
36
36
  "which": "3.0.0",
37
- "@vercel/build-utils": "13.26.1",
37
+ "@vercel/build-utils": "13.26.3",
38
38
  "@vercel/error-utils": "2.1.0",
39
- "@vercel/python-runtime": "0.14.0"
39
+ "@vercel/python-runtime": "0.14.1"
40
40
  },
41
41
  "scripts": {
42
42
  "build": "node ../../utils/build-builder.mjs",