@vercel/python 6.56.0 → 6.56.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 +50 -0
  2. package/package.json +6 -6
package/dist/index.js CHANGED
@@ -5170,6 +5170,30 @@ async function hasExplicitVercelSdkDependency(pythonPackage) {
5170
5170
  );
5171
5171
  return names?.has("vercel") ?? false;
5172
5172
  }
5173
+ async function getLocalSdkSourcePaths({
5174
+ pythonPackage,
5175
+ env
5176
+ }) {
5177
+ const sdkRoot = env.VERCEL_SDK_PYTHON;
5178
+ if (!sdkRoot) {
5179
+ return [];
5180
+ }
5181
+ const names = await getDeclaredDependencyNames(
5182
+ pythonPackage?.manifest?.data?.project?.dependencies
5183
+ );
5184
+ const hasVercelPackage = [...names ?? []].some(
5185
+ (name) => name === "vercel" || name.startsWith("vercel-")
5186
+ );
5187
+ if (!hasVercelPackage) {
5188
+ return [];
5189
+ }
5190
+ const entries = await import_fs.default.promises.readdir((0, import_path.join)(sdkRoot, "src"), {
5191
+ withFileTypes: true
5192
+ });
5193
+ return entries.filter(
5194
+ (entry) => entry.isDirectory() && (entry.name === "vercel" || entry.name.startsWith("vercel-")) && (names?.has("vercel") || names?.has(entry.name))
5195
+ ).map((entry) => entry.name).sort().map((name) => (0, import_path.join)(sdkRoot, "src", name));
5196
+ }
5173
5197
  async function getInstalledVercelSdkVersion({
5174
5198
  uv,
5175
5199
  venvPath,
@@ -11652,6 +11676,32 @@ var build = async ({
11652
11676
  pipPlatformArgs
11653
11677
  });
11654
11678
  }
11679
+ const localSdkSourcePaths = await getLocalSdkSourcePaths({
11680
+ pythonPackage,
11681
+ env: baseEnv
11682
+ });
11683
+ if (localSdkSourcePaths.length > 0) {
11684
+ (0, import_build_utils24.debug)(
11685
+ `Installing vercel SDK override from ${baseEnv.VERCEL_SDK_PYTHON}: ` + localSdkSourcePaths.join(", ")
11686
+ );
11687
+ await uv.pip({
11688
+ venvPath,
11689
+ projectDir: (0, import_path21.join)(workPath, entryDirectory),
11690
+ args: [
11691
+ "install",
11692
+ "--link-mode",
11693
+ "copy",
11694
+ // Without --no-sources, uv resolves the checkout's workspace
11695
+ // dependencies as editable .pth installs pointing at the (build
11696
+ // only) checkout mount — invisible to bundling and dangling at
11697
+ // runtime. Explicit paths stay real installs; the remaining
11698
+ // workspace siblings resolve from PyPI.
11699
+ "--no-sources",
11700
+ ...pipPlatformArgs,
11701
+ ...localSdkSourcePaths
11702
+ ]
11703
+ });
11704
+ }
11655
11705
  if (workflows.length > 0) {
11656
11706
  workflowMode = await resolveWorkflowServingMode({
11657
11707
  pythonPackage,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/python",
3
- "version": "6.56.0",
3
+ "version": "6.56.1",
4
4
  "main": "./dist/index.js",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://vercel.com/docs/runtimes#official-runtimes/python",
@@ -14,7 +14,7 @@
14
14
  "directory": "packages/python"
15
15
  },
16
16
  "dependencies": {
17
- "@vercel/python-analysis": "0.13.1"
17
+ "@vercel/python-analysis": "0.13.2"
18
18
  },
19
19
  "devDependencies": {
20
20
  "@renovatebot/pep440": "4.2.1",
@@ -33,11 +33,11 @@
33
33
  "pip-requirements-js": "1.0.2",
34
34
  "semver": "6.3.1",
35
35
  "smol-toml": "1.5.2",
36
- "vitest": "2.1.4",
36
+ "vitest": "4.1.10",
37
37
  "which": "3.0.0",
38
- "@vercel/build-utils": "14.0.3",
39
- "@vercel/error-utils": "2.2.1",
40
- "@vercel/python-runtime": "0.19.0"
38
+ "@vercel/build-utils": "14.0.5",
39
+ "@vercel/python-runtime": "0.19.0",
40
+ "@vercel/error-utils": "2.2.1"
41
41
  },
42
42
  "scripts": {
43
43
  "build": "node ../../utils/build-builder.mjs",