@vercel/python 6.55.1 → 6.55.2
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 +22 -19
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -5032,7 +5032,7 @@ var import_fs20 = __toESM(require("fs"));
|
|
|
5032
5032
|
var import_path21 = require("path");
|
|
5033
5033
|
|
|
5034
5034
|
// src/package-versions.ts
|
|
5035
|
-
var VERCEL_RUNTIME_VERSION = "0.
|
|
5035
|
+
var VERCEL_RUNTIME_VERSION = "0.18.0";
|
|
5036
5036
|
var VERCEL_WORKERS_VERSION = "0.0.25";
|
|
5037
5037
|
|
|
5038
5038
|
// src/conditional-vendoring.ts
|
|
@@ -5083,12 +5083,6 @@ async function getQueueIntegrations({
|
|
|
5083
5083
|
}
|
|
5084
5084
|
return integrations;
|
|
5085
5085
|
}
|
|
5086
|
-
var INJECTED_PACKAGE_NAMES = /* @__PURE__ */ new Set([
|
|
5087
|
-
"vercel-celery",
|
|
5088
|
-
"vercel-celery-bundle",
|
|
5089
|
-
"vercel-dramatiq",
|
|
5090
|
-
"vercel-dramatiq-bundle"
|
|
5091
|
-
]);
|
|
5092
5086
|
async function getConditionalInjectedPackages({
|
|
5093
5087
|
pythonPackage,
|
|
5094
5088
|
env
|
|
@@ -5100,7 +5094,7 @@ async function getConditionalInjectedPackages({
|
|
|
5100
5094
|
for (const [upstream, adapter] of UPSTREAM_DEPENDENCY_ADAPTERS) {
|
|
5101
5095
|
if (!dependencies.has(upstream))
|
|
5102
5096
|
continue;
|
|
5103
|
-
if (
|
|
5097
|
+
if (dependencies.has(adapter.bundled) || dependencies.has(adapter.unbundled)) {
|
|
5104
5098
|
continue;
|
|
5105
5099
|
}
|
|
5106
5100
|
const name = adapter.preferUnbundledWhenPresent.some(
|
|
@@ -5126,13 +5120,6 @@ async function getDirectDependencyNames(pythonPackage) {
|
|
|
5126
5120
|
);
|
|
5127
5121
|
return dependencyNames;
|
|
5128
5122
|
}
|
|
5129
|
-
function hasDirectInjectedPackage(dependencies) {
|
|
5130
|
-
for (const packageName of INJECTED_PACKAGE_NAMES) {
|
|
5131
|
-
if (dependencies.has(packageName))
|
|
5132
|
-
return true;
|
|
5133
|
-
}
|
|
5134
|
-
return false;
|
|
5135
|
-
}
|
|
5136
5123
|
|
|
5137
5124
|
// src/sdk-detection.ts
|
|
5138
5125
|
var import_fs = __toESM(require("fs"));
|
|
@@ -8210,8 +8197,10 @@ function queueTopicPatternsOverlap(left, right) {
|
|
|
8210
8197
|
}
|
|
8211
8198
|
return left.startsWith(rightPrefix);
|
|
8212
8199
|
}
|
|
8213
|
-
function createIntegrationInstallLines(integrations, { serving }) {
|
|
8214
|
-
return integrations.
|
|
8200
|
+
function createIntegrationInstallLines(integrations, { serving, beforeImport }) {
|
|
8201
|
+
return integrations.filter(
|
|
8202
|
+
(integration) => Boolean(integration.installBeforeImport) === beforeImport
|
|
8203
|
+
).flatMap(({ module: module2, installer, servingActivator }) => [
|
|
8215
8204
|
`from ${module2} import ${installer}`,
|
|
8216
8205
|
`${installer}()`,
|
|
8217
8206
|
// Queue-serving processes must also activate consumption (register
|
|
@@ -8225,8 +8214,15 @@ function createQueueHandlerModule(declaration, integrations) {
|
|
|
8225
8214
|
"import importlib",
|
|
8226
8215
|
"import vercel.queue",
|
|
8227
8216
|
"",
|
|
8217
|
+
...createIntegrationInstallLines(integrations, {
|
|
8218
|
+
serving: true,
|
|
8219
|
+
beforeImport: true
|
|
8220
|
+
}),
|
|
8228
8221
|
`importlib.import_module(${JSON.stringify(declaration.moduleName)})`,
|
|
8229
|
-
...createIntegrationInstallLines(integrations, {
|
|
8222
|
+
...createIntegrationInstallLines(integrations, {
|
|
8223
|
+
serving: true,
|
|
8224
|
+
beforeImport: false
|
|
8225
|
+
}),
|
|
8230
8226
|
"app = vercel.queue.asgi_app()",
|
|
8231
8227
|
""
|
|
8232
8228
|
].join("\n");
|
|
@@ -8358,8 +8354,15 @@ function parseTopicPatterns(name, value) {
|
|
|
8358
8354
|
function createQueueIntrospectionScript(moduleName, integrations) {
|
|
8359
8355
|
return [
|
|
8360
8356
|
"import importlib, json, sys",
|
|
8357
|
+
...createIntegrationInstallLines(integrations, {
|
|
8358
|
+
serving: false,
|
|
8359
|
+
beforeImport: true
|
|
8360
|
+
}),
|
|
8361
8361
|
`importlib.import_module(${JSON.stringify(moduleName)})`,
|
|
8362
|
-
...createIntegrationInstallLines(integrations, {
|
|
8362
|
+
...createIntegrationInstallLines(integrations, {
|
|
8363
|
+
serving: false,
|
|
8364
|
+
beforeImport: false
|
|
8365
|
+
}),
|
|
8363
8366
|
"from vercel.queue import get_subscriptions",
|
|
8364
8367
|
"subs = [",
|
|
8365
8368
|
" {k: v for k, v in {",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vercel/python",
|
|
3
|
-
"version": "6.55.
|
|
3
|
+
"version": "6.55.2",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://vercel.com/docs/runtimes#official-runtimes/python",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"which": "3.0.0",
|
|
38
38
|
"@vercel/build-utils": "14.0.1",
|
|
39
39
|
"@vercel/error-utils": "2.2.1",
|
|
40
|
-
"@vercel/python-runtime": "0.
|
|
40
|
+
"@vercel/python-runtime": "0.18.0"
|
|
41
41
|
},
|
|
42
42
|
"scripts": {
|
|
43
43
|
"build": "node ../../utils/build-builder.mjs",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"test-unit": "vitest run --config ../../vitest.config.mts test/unit",
|
|
47
47
|
"test-e2e": "pnpm test test/integration-*",
|
|
48
48
|
"vitest-run": "vitest -c ../../vitest.config.mts",
|
|
49
|
-
"vitest-unit": "
|
|
49
|
+
"vitest-unit": "pnpm test test/unit",
|
|
50
50
|
"vitest-e2e": "glob --absolute 'test/integration-*'"
|
|
51
51
|
}
|
|
52
52
|
}
|