@vercel/python 25.1.3 → 26.0.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.
- package/dist/index.js +17 -6
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -5523,11 +5523,18 @@ var UvRunner = class {
|
|
|
5523
5523
|
}
|
|
5524
5524
|
/**
|
|
5525
5525
|
* Run a `uv pip` command (e.g., `uv pip install`).
|
|
5526
|
+
*
|
|
5527
|
+
* Only packages the builder adds on top of the user's dependencies are
|
|
5528
|
+
* installed this way. Their pins carry no hashes, so the user's
|
|
5529
|
+
* UV_REQUIRE_HASHES is dropped; uv also rejects `--no-require-hashes`
|
|
5530
|
+
* while it is set.
|
|
5526
5531
|
*/
|
|
5527
5532
|
async pip(options) {
|
|
5528
5533
|
const { venvPath, projectDir, args } = options;
|
|
5529
5534
|
const fullArgs = ["pip", ...args];
|
|
5530
|
-
await this.runUvCmd(fullArgs, projectDir, venvPath
|
|
5535
|
+
await this.runUvCmd(fullArgs, projectDir, venvPath, {
|
|
5536
|
+
UV_REQUIRE_HASHES: void 0
|
|
5537
|
+
});
|
|
5531
5538
|
}
|
|
5532
5539
|
/**
|
|
5533
5540
|
* Run a command through `uv run` inside the active virtual environment.
|
|
@@ -5559,13 +5566,13 @@ var UvRunner = class {
|
|
|
5559
5566
|
);
|
|
5560
5567
|
}
|
|
5561
5568
|
}
|
|
5562
|
-
async runUvCmd(args, cwd, venvPath) {
|
|
5569
|
+
async runUvCmd(args, cwd, venvPath, env) {
|
|
5563
5570
|
const pretty = `uv ${args.join(" ")}`;
|
|
5564
5571
|
(0, import_build_utils2.debug)(`Running "${pretty}"...`);
|
|
5565
5572
|
try {
|
|
5566
5573
|
await (0, import_execa2.default)(this.uvPath, args, {
|
|
5567
5574
|
cwd,
|
|
5568
|
-
env: this.getVenvEnv(venvPath)
|
|
5575
|
+
env: { ...this.getVenvEnv(venvPath), ...env }
|
|
5569
5576
|
});
|
|
5570
5577
|
} catch (err) {
|
|
5571
5578
|
const error = new Error(
|
|
@@ -9243,20 +9250,21 @@ async function doInstallInjectedDevPackage(pkg, opts) {
|
|
|
9243
9250
|
`Installing ${pkg.name} into ${targetDir} (type: ${isLocalDev ? "local" : "pypi"}, source: ${dep})`
|
|
9244
9251
|
);
|
|
9245
9252
|
const pip = uvPath ? { cmd: uvPath, prefix: ["pip", "install"] } : { cmd: pythonBin, prefix: ["-m", "pip", "install"] };
|
|
9246
|
-
const
|
|
9253
|
+
const uvOverrides = uvPath ? ["--exclude-newer-package", `${pkg.name}=false`, "--no-require-hashes"] : [];
|
|
9247
9254
|
const extras = pkg.envOverride || isLocalDev ? [] : pkg.extraRequirements ?? [];
|
|
9248
9255
|
const spawnArgs = [
|
|
9249
9256
|
...pip.prefix,
|
|
9250
9257
|
"--target",
|
|
9251
9258
|
targetDir,
|
|
9252
|
-
...
|
|
9259
|
+
...uvOverrides,
|
|
9253
9260
|
...extras,
|
|
9254
9261
|
dep
|
|
9255
9262
|
];
|
|
9256
9263
|
await new Promise((resolve4, reject) => {
|
|
9257
9264
|
const child = (0, import_child_process2.spawn)(pip.cmd, spawnArgs, {
|
|
9258
9265
|
cwd: workPath,
|
|
9259
|
-
|
|
9266
|
+
// uv rejects `--no-require-hashes` while UV_REQUIRE_HASHES is set.
|
|
9267
|
+
env: { ...getProtectedUvEnv(env), UV_REQUIRE_HASHES: void 0 },
|
|
9260
9268
|
stdio: ["inherit", "pipe", "pipe"]
|
|
9261
9269
|
});
|
|
9262
9270
|
child.stdout?.on("data", (data) => {
|
|
@@ -11745,6 +11753,9 @@ async function installInjectedPackage({
|
|
|
11745
11753
|
"install",
|
|
11746
11754
|
"--link-mode",
|
|
11747
11755
|
"copy",
|
|
11756
|
+
// The pin has no hash, so override `require-hashes` from the user's
|
|
11757
|
+
// uv config. `uv.pip` drops UV_REQUIRE_HASHES.
|
|
11758
|
+
"--no-require-hashes",
|
|
11748
11759
|
...pipPlatformArgs,
|
|
11749
11760
|
...noExclude,
|
|
11750
11761
|
...extras,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vercel/python",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "26.0.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,10 +14,10 @@
|
|
|
14
14
|
"directory": "packages/python"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@vercel/python-analysis": "0.15.
|
|
17
|
+
"@vercel/python-analysis": "0.15.1"
|
|
18
18
|
},
|
|
19
19
|
"peerDependencies": {
|
|
20
|
-
"@vercel/build-utils": "14.
|
|
20
|
+
"@vercel/build-utils": "14.22.0"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"@renovatebot/pep440": "4.2.1",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"smol-toml": "1.5.2",
|
|
38
38
|
"vitest": "4.1.10",
|
|
39
39
|
"which": "3.0.0",
|
|
40
|
-
"@vercel/build-utils": "14.
|
|
40
|
+
"@vercel/build-utils": "14.22.0",
|
|
41
41
|
"@vercel/error-utils": "2.2.1",
|
|
42
42
|
"@vercel/python-runtime": "0.23.3"
|
|
43
43
|
},
|