@vercel/python 6.5.0 → 6.6.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.
- package/dist/index.js +36 -36
- package/package.json +6 -3
package/dist/index.js
CHANGED
|
@@ -2822,10 +2822,17 @@ var UvRunner = class {
|
|
|
2822
2822
|
`Failed to parse 'uv python list' output: ${err instanceof Error ? err.message : String(err)}`
|
|
2823
2823
|
);
|
|
2824
2824
|
}
|
|
2825
|
-
|
|
2826
|
-
pyList.filter(
|
|
2825
|
+
if (process.env.VERCEL_BUILD_IMAGE) {
|
|
2826
|
+
pyList = pyList.filter(
|
|
2827
2827
|
(entry) => entry.path !== null && entry.path.startsWith(UV_PYTHON_PATH_PREFIX) && entry.implementation === "cpython"
|
|
2828
|
-
)
|
|
2828
|
+
);
|
|
2829
|
+
} else {
|
|
2830
|
+
pyList = pyList.filter(
|
|
2831
|
+
(entry) => entry.path !== null && entry.implementation === "cpython"
|
|
2832
|
+
);
|
|
2833
|
+
}
|
|
2834
|
+
return new Set(
|
|
2835
|
+
pyList.map(
|
|
2829
2836
|
(entry) => `${entry.version_parts.major}.${entry.version_parts.minor}`
|
|
2830
2837
|
)
|
|
2831
2838
|
);
|
|
@@ -3977,6 +3984,20 @@ var ANSI_ESCAPE_RE = new RegExp(ANSI_PATTERN, "g");
|
|
|
3977
3984
|
var stripAnsi = (s) => s.replace(ANSI_ESCAPE_RE, "");
|
|
3978
3985
|
var ASGI_SHIM_MODULE = "vc_init_dev_asgi";
|
|
3979
3986
|
var WSGI_SHIM_MODULE = "vc_init_dev_wsgi";
|
|
3987
|
+
function createLogListener(callback, stream) {
|
|
3988
|
+
return (buf) => {
|
|
3989
|
+
if (callback) {
|
|
3990
|
+
callback(buf);
|
|
3991
|
+
} else {
|
|
3992
|
+
const s = buf.toString();
|
|
3993
|
+
for (const line of s.split(/\r?\n/)) {
|
|
3994
|
+
if (line) {
|
|
3995
|
+
stream.write(line.endsWith("\n") ? line : line + "\n");
|
|
3996
|
+
}
|
|
3997
|
+
}
|
|
3998
|
+
}
|
|
3999
|
+
};
|
|
4000
|
+
}
|
|
3980
4001
|
var PERSISTENT_SERVERS = /* @__PURE__ */ new Map();
|
|
3981
4002
|
var PENDING_STARTS = /* @__PURE__ */ new Map();
|
|
3982
4003
|
var restoreWarnings = null;
|
|
@@ -4053,7 +4074,14 @@ function createDevWsgiShim(workPath, modulePath) {
|
|
|
4053
4074
|
}
|
|
4054
4075
|
}
|
|
4055
4076
|
var startDevServer = async (opts) => {
|
|
4056
|
-
const {
|
|
4077
|
+
const {
|
|
4078
|
+
entrypoint: rawEntrypoint,
|
|
4079
|
+
workPath,
|
|
4080
|
+
meta = {},
|
|
4081
|
+
config,
|
|
4082
|
+
onStdout,
|
|
4083
|
+
onStderr
|
|
4084
|
+
} = opts;
|
|
4057
4085
|
const framework = config?.framework;
|
|
4058
4086
|
if (framework !== "fastapi" && framework !== "flask") {
|
|
4059
4087
|
return null;
|
|
@@ -4161,22 +4189,8 @@ If you are using a virtual environment, activate it before running "vercel dev",
|
|
|
4161
4189
|
stdio: ["inherit", "pipe", "pipe"]
|
|
4162
4190
|
});
|
|
4163
4191
|
childProcess = child;
|
|
4164
|
-
stdoutLogListener = (
|
|
4165
|
-
|
|
4166
|
-
for (const line of s.split(/\r?\n/)) {
|
|
4167
|
-
if (line) {
|
|
4168
|
-
process.stdout.write(line.endsWith("\n") ? line : line + "\n");
|
|
4169
|
-
}
|
|
4170
|
-
}
|
|
4171
|
-
};
|
|
4172
|
-
stderrLogListener = (buf) => {
|
|
4173
|
-
const s = buf.toString();
|
|
4174
|
-
for (const line of s.split(/\r?\n/)) {
|
|
4175
|
-
if (line) {
|
|
4176
|
-
process.stderr.write(line.endsWith("\n") ? line : line + "\n");
|
|
4177
|
-
}
|
|
4178
|
-
}
|
|
4179
|
-
};
|
|
4192
|
+
stdoutLogListener = createLogListener(onStdout, process.stdout);
|
|
4193
|
+
stderrLogListener = createLogListener(onStderr, process.stderr);
|
|
4180
4194
|
child.stdout?.on("data", stdoutLogListener);
|
|
4181
4195
|
child.stderr?.on("data", stderrLogListener);
|
|
4182
4196
|
const readinessRegexes = [
|
|
@@ -4239,22 +4253,8 @@ If you are using a virtual environment, activate it before running "vercel dev",
|
|
|
4239
4253
|
stdio: ["inherit", "pipe", "pipe"]
|
|
4240
4254
|
});
|
|
4241
4255
|
childProcess = child;
|
|
4242
|
-
stdoutLogListener = (
|
|
4243
|
-
|
|
4244
|
-
for (const line of s.split(/\r?\n/)) {
|
|
4245
|
-
if (line) {
|
|
4246
|
-
process.stdout.write(line.endsWith("\n") ? line : line + "\n");
|
|
4247
|
-
}
|
|
4248
|
-
}
|
|
4249
|
-
};
|
|
4250
|
-
stderrLogListener = (buf) => {
|
|
4251
|
-
const s = buf.toString();
|
|
4252
|
-
for (const line of s.split(/\r?\n/)) {
|
|
4253
|
-
if (line) {
|
|
4254
|
-
process.stderr.write(line.endsWith("\n") ? line : line + "\n");
|
|
4255
|
-
}
|
|
4256
|
-
}
|
|
4257
|
-
};
|
|
4256
|
+
stdoutLogListener = createLogListener(onStdout, process.stdout);
|
|
4257
|
+
stderrLogListener = createLogListener(onStderr, process.stderr);
|
|
4258
4258
|
child.stdout?.on("data", stdoutLogListener);
|
|
4259
4259
|
child.stderr?.on("data", stderrLogListener);
|
|
4260
4260
|
const readinessRegexes = [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vercel/python",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.6.0",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://vercel.com/docs/runtimes#official-runtimes/python",
|
|
@@ -29,15 +29,18 @@
|
|
|
29
29
|
"minimatch": "10.1.1",
|
|
30
30
|
"pip-requirements-js": "1.0.2",
|
|
31
31
|
"smol-toml": "1.5.2",
|
|
32
|
+
"vitest": "2.1.4",
|
|
32
33
|
"which": "3.0.0",
|
|
33
|
-
"@vercel/build-utils": "13.
|
|
34
|
+
"@vercel/build-utils": "13.3.0",
|
|
34
35
|
"@vercel/error-utils": "2.0.3"
|
|
35
36
|
},
|
|
36
37
|
"scripts": {
|
|
37
38
|
"build": "node ../../utils/build-builder.mjs",
|
|
38
39
|
"test": "cross-env VERCEL_FORCE_PYTHON_STREAMING=1 jest --reporters=default --reporters=jest-junit --env node --verbose --runInBand --bail",
|
|
39
|
-
"test-unit": "
|
|
40
|
+
"test-unit": "vitest run --config ../../vitest.config.mts test/unit.test.ts",
|
|
40
41
|
"test-e2e": "pnpm test test/integration-*",
|
|
42
|
+
"vitest-run": "vitest -c ../../vitest.config.mts",
|
|
43
|
+
"vitest-unit": "glob --absolute 'test/unit.test.ts'",
|
|
41
44
|
"type-check": "tsc --noEmit"
|
|
42
45
|
}
|
|
43
46
|
}
|