vercel-cli 47.0.7__py3-none-any.whl → 47.1.4__py3-none-any.whl
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.
Potentially problematic release.
This version of vercel-cli might be problematic. Click here for more details.
- vercel_cli/vendor/dist/index.js +673 -572
- vercel_cli/vendor/node_modules/.package-lock.json +3 -3
- vercel_cli/vendor/node_modules/@vercel/python/dist/index.js +163 -54
- vercel_cli/vendor/node_modules/@vercel/python/package.json +2 -2
- vercel_cli/vendor/node_modules/@vercel/python/vc_init.py +26 -2
- vercel_cli/vendor/package.json +2 -2
- {vercel_cli-47.0.7.dist-info → vercel_cli-47.1.4.dist-info}/METADATA +1 -1
- {vercel_cli-47.0.7.dist-info → vercel_cli-47.1.4.dist-info}/RECORD +10 -10
- {vercel_cli-47.0.7.dist-info → vercel_cli-47.1.4.dist-info}/WHEEL +0 -0
- {vercel_cli-47.0.7.dist-info → vercel_cli-47.1.4.dist-info}/entry_points.txt +0 -0
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
"license": "Apache-2.0"
|
|
16
16
|
},
|
|
17
17
|
"node_modules/@vercel/python": {
|
|
18
|
-
"version": "5.0.
|
|
19
|
-
"resolved": "https://registry.npmjs.org/@vercel/python/-/python-5.0.
|
|
20
|
-
"integrity": "sha512-
|
|
18
|
+
"version": "5.0.3",
|
|
19
|
+
"resolved": "https://registry.npmjs.org/@vercel/python/-/python-5.0.3.tgz",
|
|
20
|
+
"integrity": "sha512-kalXcbgwnAyP97VrE+Rb7tLtBlkgUVsbxvOD4zleBXo5hpw5jugCOqrtGglECuUXLOYQhlBCnNgNczb8HfrG2g==",
|
|
21
21
|
"license": "Apache-2.0"
|
|
22
22
|
}
|
|
23
23
|
}
|
|
@@ -2651,7 +2651,7 @@ ${stderr}${stdout}`;
|
|
|
2651
2651
|
var require_lib = __commonJS({
|
|
2652
2652
|
"../../node_modules/.pnpm/which@3.0.0/node_modules/which/lib/index.js"(exports, module2) {
|
|
2653
2653
|
var isexe = require_isexe();
|
|
2654
|
-
var { join:
|
|
2654
|
+
var { join: join3, delimiter, sep, posix } = require("path");
|
|
2655
2655
|
var isWindows = process.platform === "win32";
|
|
2656
2656
|
var rSlash = new RegExp(`[${posix.sep}${sep === posix.sep ? "" : sep}]`.replace(/(\\)/g, "\\$1"));
|
|
2657
2657
|
var rRel = new RegExp(`^\\.${rSlash.source}`);
|
|
@@ -2680,7 +2680,7 @@ var require_lib = __commonJS({
|
|
|
2680
2680
|
var getPathPart = (raw, cmd) => {
|
|
2681
2681
|
const pathPart = /^".*"$/.test(raw) ? raw.slice(1, -1) : raw;
|
|
2682
2682
|
const prefix = !pathPart && rRel.test(cmd) ? cmd.slice(0, 2) : "";
|
|
2683
|
-
return prefix +
|
|
2683
|
+
return prefix + join3(pathPart, cmd);
|
|
2684
2684
|
};
|
|
2685
2685
|
var which2 = async (cmd, opt = {}) => {
|
|
2686
2686
|
const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
|
|
@@ -2749,11 +2749,12 @@ module.exports = __toCommonJS(src_exports);
|
|
|
2749
2749
|
var import_fs = __toESM(require("fs"));
|
|
2750
2750
|
var import_execa2 = __toESM(require_execa());
|
|
2751
2751
|
var import_util = require("util");
|
|
2752
|
-
var
|
|
2752
|
+
var import_path2 = require("path");
|
|
2753
2753
|
var import_build_utils3 = require("@vercel/build-utils");
|
|
2754
2754
|
|
|
2755
2755
|
// src/install.ts
|
|
2756
2756
|
var import_execa = __toESM(require_execa());
|
|
2757
|
+
var import_path = require("path");
|
|
2757
2758
|
var import_build_utils = require("@vercel/build-utils");
|
|
2758
2759
|
var makeDependencyCheckCode = (dependency) => `
|
|
2759
2760
|
from importlib import util
|
|
@@ -2768,7 +2769,8 @@ async function isInstalled(pythonPath, dependency, cwd) {
|
|
|
2768
2769
|
["-c", makeDependencyCheckCode(dependency)],
|
|
2769
2770
|
{
|
|
2770
2771
|
stdio: "pipe",
|
|
2771
|
-
cwd
|
|
2772
|
+
cwd,
|
|
2773
|
+
env: { ...process.env, PYTHONPATH: (0, import_path.join)(cwd, resolveVendorDir()) }
|
|
2772
2774
|
}
|
|
2773
2775
|
);
|
|
2774
2776
|
return stdout.startsWith(cwd);
|
|
@@ -2790,7 +2792,8 @@ async function areRequirementsInstalled(pythonPath, requirementsPath, cwd) {
|
|
|
2790
2792
|
["-c", makeRequirementsCheckCode(requirementsPath)],
|
|
2791
2793
|
{
|
|
2792
2794
|
stdio: "pipe",
|
|
2793
|
-
cwd
|
|
2795
|
+
cwd,
|
|
2796
|
+
env: { ...process.env, PYTHONPATH: (0, import_path.join)(cwd, resolveVendorDir()) }
|
|
2794
2797
|
}
|
|
2795
2798
|
);
|
|
2796
2799
|
return true;
|
|
@@ -2798,12 +2801,18 @@ async function areRequirementsInstalled(pythonPath, requirementsPath, cwd) {
|
|
|
2798
2801
|
return false;
|
|
2799
2802
|
}
|
|
2800
2803
|
}
|
|
2804
|
+
function resolveVendorDir() {
|
|
2805
|
+
const vendorDir = process.env.VERCEL_PYTHON_VENDOR_DIR || "_vendor";
|
|
2806
|
+
return vendorDir;
|
|
2807
|
+
}
|
|
2801
2808
|
async function pipInstall(pipPath, workPath, args) {
|
|
2802
|
-
const target =
|
|
2809
|
+
const target = resolveVendorDir();
|
|
2803
2810
|
process.env.PIP_USER = "0";
|
|
2804
2811
|
const cmdArgs = [
|
|
2805
2812
|
"install",
|
|
2806
2813
|
"--disable-pip-version-check",
|
|
2814
|
+
"--no-compile",
|
|
2815
|
+
"--no-cache-dir",
|
|
2807
2816
|
"--target",
|
|
2808
2817
|
target,
|
|
2809
2818
|
...args
|
|
@@ -2958,14 +2967,32 @@ function isInstalled2({ pipPath, pythonPath }) {
|
|
|
2958
2967
|
// src/index.ts
|
|
2959
2968
|
var readFile = (0, import_util.promisify)(import_fs.default.readFile);
|
|
2960
2969
|
var writeFile = (0, import_util.promisify)(import_fs.default.writeFile);
|
|
2961
|
-
|
|
2970
|
+
var fastapiEntrypointFilenames = ["app", "index", "server", "main"];
|
|
2971
|
+
var fastapiEntrypointDirs = ["", "src", "app"];
|
|
2972
|
+
var fastapiContentRegex = /(from\s+fastapi\s+import\s+FastAPI|import\s+fastapi|FastAPI\s*\()/;
|
|
2973
|
+
var fastapiCandidateEntrypoints = fastapiEntrypointFilenames.flatMap(
|
|
2974
|
+
(filename) => fastapiEntrypointDirs.map((dir) => import_path2.posix.join(dir, `${filename}.py`))
|
|
2975
|
+
);
|
|
2976
|
+
function isFastapiEntrypoint(file) {
|
|
2977
|
+
try {
|
|
2978
|
+
const fsPath = file.fsPath;
|
|
2979
|
+
if (!fsPath)
|
|
2980
|
+
return false;
|
|
2981
|
+
const contents = import_fs.default.readFileSync(fsPath, "utf8");
|
|
2982
|
+
return fastapiContentRegex.test(contents);
|
|
2983
|
+
} catch {
|
|
2984
|
+
return false;
|
|
2985
|
+
}
|
|
2986
|
+
}
|
|
2987
|
+
async function pipenvConvert(cmd, srcDir, env) {
|
|
2962
2988
|
(0, import_build_utils3.debug)("Running pipfile2req...");
|
|
2963
2989
|
try {
|
|
2964
2990
|
const out = await import_execa2.default.stdout(cmd, [], {
|
|
2965
|
-
cwd: srcDir
|
|
2991
|
+
cwd: srcDir,
|
|
2992
|
+
env
|
|
2966
2993
|
});
|
|
2967
2994
|
(0, import_build_utils3.debug)("Contents of requirements.txt is: " + out);
|
|
2968
|
-
import_fs.default.writeFileSync((0,
|
|
2995
|
+
import_fs.default.writeFileSync((0, import_path2.join)(srcDir, "requirements.txt"), out);
|
|
2969
2996
|
} catch (err) {
|
|
2970
2997
|
console.log('Failed to run "pipfile2req"');
|
|
2971
2998
|
throw err;
|
|
@@ -2981,8 +3008,8 @@ async function downloadFilesInWorkPath({
|
|
|
2981
3008
|
(0, import_build_utils3.debug)("Downloading user files...");
|
|
2982
3009
|
let downloadedFiles = await (0, import_build_utils3.download)(files, workPath, meta);
|
|
2983
3010
|
if (meta.isDev) {
|
|
2984
|
-
const { devCacheDir = (0,
|
|
2985
|
-
const destCache = (0,
|
|
3011
|
+
const { devCacheDir = (0, import_path2.join)(workPath, ".now", "cache") } = meta;
|
|
3012
|
+
const destCache = (0, import_path2.join)(devCacheDir, (0, import_path2.basename)(entrypoint, ".py"));
|
|
2986
3013
|
await (0, import_build_utils3.download)(downloadedFiles, destCache);
|
|
2987
3014
|
downloadedFiles = await (0, import_build_utils3.glob)("**", destCache);
|
|
2988
3015
|
workPath = destCache;
|
|
@@ -3005,57 +3032,120 @@ var build = async ({
|
|
|
3005
3032
|
});
|
|
3006
3033
|
try {
|
|
3007
3034
|
if (meta.isDev) {
|
|
3008
|
-
const setupCfg = (0,
|
|
3035
|
+
const setupCfg = (0, import_path2.join)(workPath, "setup.cfg");
|
|
3009
3036
|
await writeFile(setupCfg, "[install]\nprefix=\n");
|
|
3010
3037
|
}
|
|
3011
3038
|
} catch (err) {
|
|
3012
3039
|
console.log('Failed to create "setup.cfg" file');
|
|
3013
3040
|
throw err;
|
|
3014
3041
|
}
|
|
3042
|
+
let fsFiles = await (0, import_build_utils3.glob)("**", workPath);
|
|
3043
|
+
if (!fsFiles[entrypoint]) {
|
|
3044
|
+
let discovered;
|
|
3045
|
+
if (config?.framework === "fastapi") {
|
|
3046
|
+
const entrypointCandidates = fastapiCandidateEntrypoints.filter(
|
|
3047
|
+
(c) => !!fsFiles[c]
|
|
3048
|
+
);
|
|
3049
|
+
if (entrypointCandidates.length) {
|
|
3050
|
+
const fastapiEntrypoint = entrypointCandidates.find(
|
|
3051
|
+
(c) => isFastapiEntrypoint(fsFiles[c])
|
|
3052
|
+
);
|
|
3053
|
+
discovered = fastapiEntrypoint || entrypointCandidates[0];
|
|
3054
|
+
}
|
|
3055
|
+
}
|
|
3056
|
+
if (discovered) {
|
|
3057
|
+
(0, import_build_utils3.debug)(
|
|
3058
|
+
`Resolved Python entrypoint to "${discovered}" (configured "${entrypoint}" not found).`
|
|
3059
|
+
);
|
|
3060
|
+
entrypoint = discovered;
|
|
3061
|
+
} else if (config?.framework === "fastapi") {
|
|
3062
|
+
const searchedList = fastapiCandidateEntrypoints.join(", ");
|
|
3063
|
+
throw new import_build_utils3.NowBuildError({
|
|
3064
|
+
code: "FASTAPI_ENTRYPOINT_NOT_FOUND",
|
|
3065
|
+
message: `No FastAPI entrypoint found. Searched for: ${searchedList}`
|
|
3066
|
+
});
|
|
3067
|
+
}
|
|
3068
|
+
}
|
|
3069
|
+
const entryDirectory = (0, import_path2.dirname)(entrypoint);
|
|
3070
|
+
const hasReqLocal = !!fsFiles[(0, import_path2.join)(entryDirectory, "requirements.txt")];
|
|
3071
|
+
const hasReqGlobal = !!fsFiles["requirements.txt"];
|
|
3072
|
+
const pipfileLockDir = fsFiles[(0, import_path2.join)(entryDirectory, "Pipfile.lock")] ? (0, import_path2.join)(workPath, entryDirectory) : fsFiles["Pipfile.lock"] ? workPath : null;
|
|
3073
|
+
const pipfileDir = fsFiles[(0, import_path2.join)(entryDirectory, "Pipfile")] ? (0, import_path2.join)(workPath, entryDirectory) : fsFiles["Pipfile"] ? workPath : null;
|
|
3074
|
+
if (!hasReqLocal && !hasReqGlobal && (pipfileLockDir || pipfileDir)) {
|
|
3075
|
+
if (pipfileLockDir) {
|
|
3076
|
+
(0, import_build_utils3.debug)('Found "Pipfile.lock"');
|
|
3077
|
+
} else {
|
|
3078
|
+
(0, import_build_utils3.debug)('Found "Pipfile"');
|
|
3079
|
+
}
|
|
3080
|
+
if (pipfileLockDir) {
|
|
3081
|
+
let lock = {};
|
|
3082
|
+
try {
|
|
3083
|
+
const json = await readFile(
|
|
3084
|
+
(0, import_path2.join)(pipfileLockDir, "Pipfile.lock"),
|
|
3085
|
+
"utf8"
|
|
3086
|
+
);
|
|
3087
|
+
lock = JSON.parse(json);
|
|
3088
|
+
} catch (err) {
|
|
3089
|
+
throw new import_build_utils3.NowBuildError({
|
|
3090
|
+
code: "INVALID_PIPFILE_LOCK",
|
|
3091
|
+
message: "Unable to parse Pipfile.lock"
|
|
3092
|
+
});
|
|
3093
|
+
}
|
|
3094
|
+
pythonVersion = getSupportedPythonVersion({
|
|
3095
|
+
isDev: meta.isDev,
|
|
3096
|
+
pipLockPythonVersion: lock?._meta?.requires?.python_version
|
|
3097
|
+
});
|
|
3098
|
+
}
|
|
3099
|
+
if (!hasReqLocal && !hasReqGlobal) {
|
|
3100
|
+
const tempDir = await (0, import_build_utils3.getWriteableDirectory)();
|
|
3101
|
+
await installRequirement({
|
|
3102
|
+
pythonPath: pythonVersion.pythonPath,
|
|
3103
|
+
pipPath: pythonVersion.pipPath,
|
|
3104
|
+
dependency: "pipfile-requirements",
|
|
3105
|
+
version: "0.3.0",
|
|
3106
|
+
workPath: tempDir,
|
|
3107
|
+
meta,
|
|
3108
|
+
args: ["--no-warn-script-location"]
|
|
3109
|
+
});
|
|
3110
|
+
const tempVendorDir = (0, import_path2.join)(tempDir, resolveVendorDir());
|
|
3111
|
+
const envForConvert = { ...process.env, PYTHONPATH: tempVendorDir };
|
|
3112
|
+
const convertCmd = process.platform === "win32" ? (0, import_path2.join)(tempVendorDir, "Scripts", "pipfile2req.exe") : (0, import_path2.join)(tempVendorDir, "bin", "pipfile2req");
|
|
3113
|
+
await pipenvConvert(
|
|
3114
|
+
convertCmd,
|
|
3115
|
+
pipfileLockDir || pipfileDir,
|
|
3116
|
+
envForConvert
|
|
3117
|
+
);
|
|
3118
|
+
} else {
|
|
3119
|
+
(0, import_build_utils3.debug)(
|
|
3120
|
+
'Skipping Pipfile.lock conversion because "requirements.txt" exists'
|
|
3121
|
+
);
|
|
3122
|
+
}
|
|
3123
|
+
}
|
|
3124
|
+
fsFiles = await (0, import_build_utils3.glob)("**", workPath);
|
|
3125
|
+
const requirementsTxt = (0, import_path2.join)(entryDirectory, "requirements.txt");
|
|
3126
|
+
const vendorBaseDir = (0, import_path2.join)(
|
|
3127
|
+
workPath,
|
|
3128
|
+
".vercel",
|
|
3129
|
+
"cache",
|
|
3130
|
+
"python",
|
|
3131
|
+
`py${pythonVersion.version}`,
|
|
3132
|
+
entryDirectory
|
|
3133
|
+
);
|
|
3134
|
+
try {
|
|
3135
|
+
await import_fs.default.promises.mkdir(vendorBaseDir, { recursive: true });
|
|
3136
|
+
} catch (err) {
|
|
3137
|
+
console.log("Failed to create vendor cache directory");
|
|
3138
|
+
throw err;
|
|
3139
|
+
}
|
|
3015
3140
|
console.log("Installing required dependencies...");
|
|
3016
3141
|
await installRequirement({
|
|
3017
3142
|
pythonPath: pythonVersion.pythonPath,
|
|
3018
3143
|
pipPath: pythonVersion.pipPath,
|
|
3019
3144
|
dependency: "werkzeug",
|
|
3020
3145
|
version: "1.0.1",
|
|
3021
|
-
workPath,
|
|
3146
|
+
workPath: vendorBaseDir,
|
|
3022
3147
|
meta
|
|
3023
3148
|
});
|
|
3024
|
-
let fsFiles = await (0, import_build_utils3.glob)("**", workPath);
|
|
3025
|
-
const entryDirectory = (0, import_path.dirname)(entrypoint);
|
|
3026
|
-
const pipfileLockDir = fsFiles[(0, import_path.join)(entryDirectory, "Pipfile.lock")] ? (0, import_path.join)(workPath, entryDirectory) : fsFiles["Pipfile.lock"] ? workPath : null;
|
|
3027
|
-
if (pipfileLockDir) {
|
|
3028
|
-
(0, import_build_utils3.debug)('Found "Pipfile.lock"');
|
|
3029
|
-
let lock = {};
|
|
3030
|
-
try {
|
|
3031
|
-
const json = await readFile((0, import_path.join)(pipfileLockDir, "Pipfile.lock"), "utf8");
|
|
3032
|
-
lock = JSON.parse(json);
|
|
3033
|
-
} catch (err) {
|
|
3034
|
-
throw new import_build_utils3.NowBuildError({
|
|
3035
|
-
code: "INVALID_PIPFILE_LOCK",
|
|
3036
|
-
message: "Unable to parse Pipfile.lock"
|
|
3037
|
-
});
|
|
3038
|
-
}
|
|
3039
|
-
pythonVersion = getSupportedPythonVersion({
|
|
3040
|
-
isDev: meta.isDev,
|
|
3041
|
-
pipLockPythonVersion: lock?._meta?.requires?.python_version
|
|
3042
|
-
});
|
|
3043
|
-
const tempDir = await (0, import_build_utils3.getWriteableDirectory)();
|
|
3044
|
-
await installRequirement({
|
|
3045
|
-
pythonPath: pythonVersion.pythonPath,
|
|
3046
|
-
pipPath: pythonVersion.pipPath,
|
|
3047
|
-
dependency: "pipfile-requirements",
|
|
3048
|
-
version: "0.3.0",
|
|
3049
|
-
workPath: tempDir,
|
|
3050
|
-
meta,
|
|
3051
|
-
args: ["--no-warn-script-location"]
|
|
3052
|
-
});
|
|
3053
|
-
process.env.PYTHONPATH = tempDir;
|
|
3054
|
-
const convertCmd = (0, import_path.join)(tempDir, "bin", "pipfile2req");
|
|
3055
|
-
await pipenvConvert(convertCmd, pipfileLockDir);
|
|
3056
|
-
}
|
|
3057
|
-
fsFiles = await (0, import_build_utils3.glob)("**", workPath);
|
|
3058
|
-
const requirementsTxt = (0, import_path.join)(entryDirectory, "requirements.txt");
|
|
3059
3149
|
if (fsFiles[requirementsTxt]) {
|
|
3060
3150
|
(0, import_build_utils3.debug)('Found local "requirements.txt"');
|
|
3061
3151
|
const requirementsTxtPath = fsFiles[requirementsTxt].fsPath;
|
|
@@ -3063,7 +3153,7 @@ var build = async ({
|
|
|
3063
3153
|
pythonPath: pythonVersion.pythonPath,
|
|
3064
3154
|
pipPath: pythonVersion.pipPath,
|
|
3065
3155
|
filePath: requirementsTxtPath,
|
|
3066
|
-
workPath,
|
|
3156
|
+
workPath: vendorBaseDir,
|
|
3067
3157
|
meta
|
|
3068
3158
|
});
|
|
3069
3159
|
} else if (fsFiles["requirements.txt"]) {
|
|
@@ -3073,31 +3163,50 @@ var build = async ({
|
|
|
3073
3163
|
pythonPath: pythonVersion.pythonPath,
|
|
3074
3164
|
pipPath: pythonVersion.pipPath,
|
|
3075
3165
|
filePath: requirementsTxtPath,
|
|
3076
|
-
workPath,
|
|
3166
|
+
workPath: vendorBaseDir,
|
|
3077
3167
|
meta
|
|
3078
3168
|
});
|
|
3079
3169
|
}
|
|
3080
|
-
const originalPyPath = (0,
|
|
3170
|
+
const originalPyPath = (0, import_path2.join)(__dirname, "..", "vc_init.py");
|
|
3081
3171
|
const originalHandlerPyContents = await readFile(originalPyPath, "utf8");
|
|
3082
3172
|
(0, import_build_utils3.debug)("Entrypoint is", entrypoint);
|
|
3083
3173
|
const moduleName = entrypoint.replace(/\//g, ".").replace(/\.py$/, "");
|
|
3174
|
+
const vendorDir = resolveVendorDir();
|
|
3084
3175
|
const suffix = meta.isDev && !entrypoint.endsWith(".py") ? ".py" : "";
|
|
3085
3176
|
const entrypointWithSuffix = `${entrypoint}${suffix}`;
|
|
3086
3177
|
(0, import_build_utils3.debug)("Entrypoint with suffix is", entrypointWithSuffix);
|
|
3087
|
-
const handlerPyContents = originalHandlerPyContents.replace(/__VC_HANDLER_MODULE_NAME/g, moduleName).replace(/__VC_HANDLER_ENTRYPOINT/g, entrypointWithSuffix);
|
|
3178
|
+
const handlerPyContents = originalHandlerPyContents.replace(/__VC_HANDLER_MODULE_NAME/g, moduleName).replace(/__VC_HANDLER_ENTRYPOINT/g, entrypointWithSuffix).replace(/__VC_HANDLER_VENDOR_DIR/g, vendorDir);
|
|
3088
3179
|
const predefinedExcludes = [
|
|
3089
3180
|
".git/**",
|
|
3181
|
+
".gitignore",
|
|
3090
3182
|
".vercel/**",
|
|
3091
3183
|
".pnpm-store/**",
|
|
3092
3184
|
"**/node_modules/**",
|
|
3093
3185
|
"**/.next/**",
|
|
3094
|
-
"**/.nuxt/**"
|
|
3186
|
+
"**/.nuxt/**",
|
|
3187
|
+
"**/.venv/**",
|
|
3188
|
+
"**/venv/**",
|
|
3189
|
+
"**/__pycache__/**"
|
|
3095
3190
|
];
|
|
3191
|
+
const lambdaEnv = {};
|
|
3192
|
+
lambdaEnv.PYTHONPATH = vendorDir;
|
|
3096
3193
|
const globOptions = {
|
|
3097
3194
|
cwd: workPath,
|
|
3098
3195
|
ignore: config && typeof config.excludeFiles === "string" ? [...predefinedExcludes, config.excludeFiles] : predefinedExcludes
|
|
3099
3196
|
};
|
|
3100
3197
|
const files = await (0, import_build_utils3.glob)("**", globOptions);
|
|
3198
|
+
try {
|
|
3199
|
+
const cachedVendorAbs = (0, import_path2.join)(vendorBaseDir, resolveVendorDir());
|
|
3200
|
+
if (import_fs.default.existsSync(cachedVendorAbs)) {
|
|
3201
|
+
const vendorFiles = await (0, import_build_utils3.glob)("**", cachedVendorAbs, resolveVendorDir());
|
|
3202
|
+
for (const [p, f] of Object.entries(vendorFiles)) {
|
|
3203
|
+
files[p] = f;
|
|
3204
|
+
}
|
|
3205
|
+
}
|
|
3206
|
+
} catch (err) {
|
|
3207
|
+
console.log("Failed to include cached vendor directory");
|
|
3208
|
+
throw err;
|
|
3209
|
+
}
|
|
3101
3210
|
const handlerPyFilename = "vc__handler__python";
|
|
3102
3211
|
files[`${handlerPyFilename}.py`] = new import_build_utils3.FileBlob({ data: handlerPyContents });
|
|
3103
3212
|
if (config.framework === "fasthtml") {
|
|
@@ -3108,7 +3217,7 @@ var build = async ({
|
|
|
3108
3217
|
files,
|
|
3109
3218
|
handler: `${handlerPyFilename}.vc_handler`,
|
|
3110
3219
|
runtime: pythonVersion.runtime,
|
|
3111
|
-
environment:
|
|
3220
|
+
environment: lambdaEnv,
|
|
3112
3221
|
supportsResponseStreaming: true
|
|
3113
3222
|
});
|
|
3114
3223
|
return { output };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vercel/python",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.3",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://vercel.com/docs/runtimes#official-runtimes/python",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"@types/jest": "27.4.1",
|
|
20
20
|
"@types/node": "14.18.33",
|
|
21
21
|
"@types/which": "3.0.0",
|
|
22
|
-
"@vercel/build-utils": "
|
|
22
|
+
"@vercel/build-utils": "12.1.0",
|
|
23
23
|
"cross-env": "7.0.3",
|
|
24
24
|
"execa": "^1.0.0",
|
|
25
25
|
"fs-extra": "11.1.1",
|
|
@@ -1,14 +1,38 @@
|
|
|
1
1
|
import sys
|
|
2
|
+
import os
|
|
3
|
+
import site
|
|
4
|
+
import importlib
|
|
2
5
|
import base64
|
|
3
6
|
import json
|
|
4
7
|
import inspect
|
|
5
8
|
from importlib import util
|
|
6
9
|
from http.server import BaseHTTPRequestHandler
|
|
7
10
|
import socket
|
|
8
|
-
|
|
11
|
+
|
|
12
|
+
_here = os.path.dirname(__file__)
|
|
13
|
+
_vendor_rel = '__VC_HANDLER_VENDOR_DIR'
|
|
14
|
+
_vendor = os.path.normpath(os.path.join(_here, _vendor_rel))
|
|
15
|
+
|
|
16
|
+
if os.path.isdir(_vendor):
|
|
17
|
+
# Process .pth files like a real site-packages dir
|
|
18
|
+
site.addsitedir(_vendor)
|
|
19
|
+
|
|
20
|
+
# Move _vendor to the front (after script dir if present)
|
|
21
|
+
try:
|
|
22
|
+
while _vendor in sys.path:
|
|
23
|
+
sys.path.remove(_vendor)
|
|
24
|
+
except ValueError:
|
|
25
|
+
pass
|
|
26
|
+
|
|
27
|
+
# Put vendored deps ahead of site-packages but after the script dir
|
|
28
|
+
idx = 1 if (sys.path and sys.path[0] in ('', _here)) else 0
|
|
29
|
+
sys.path.insert(idx, _vendor)
|
|
30
|
+
|
|
31
|
+
importlib.invalidate_caches()
|
|
9
32
|
|
|
10
33
|
# Import relative path https://docs.python.org/3/library/importlib.html#importing-a-source-file-directly
|
|
11
|
-
|
|
34
|
+
user_mod_path = os.path.join(_here, "__VC_HANDLER_ENTRYPOINT") # absolute
|
|
35
|
+
__vc_spec = util.spec_from_file_location("__VC_HANDLER_MODULE_NAME", user_mod_path)
|
|
12
36
|
__vc_module = util.module_from_spec(__vc_spec)
|
|
13
37
|
sys.modules["__VC_HANDLER_MODULE_NAME"] = __vc_module
|
|
14
38
|
__vc_spec.loader.exec_module(__vc_module)
|
vercel_cli/vendor/package.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"@vercel/build-utils": "12.1.0",
|
|
8
8
|
"@vercel/detect-agent": "0.2.0",
|
|
9
|
-
"@vercel/python": "5.0.
|
|
9
|
+
"@vercel/python": "5.0.3"
|
|
10
10
|
},
|
|
11
11
|
"description": "The command-line interface for Vercel",
|
|
12
12
|
"engines": {
|
|
@@ -37,5 +37,5 @@
|
|
|
37
37
|
"vitest-run": "vitest --config ./vitest.config.mts",
|
|
38
38
|
"vitest-unit": "jest test/unit/ --listTests"
|
|
39
39
|
},
|
|
40
|
-
"version": "47.
|
|
40
|
+
"version": "47.1.4"
|
|
41
41
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: vercel-cli
|
|
3
|
-
Version: 47.
|
|
3
|
+
Version: 47.1.4
|
|
4
4
|
Summary: Vercel CLI packaged for Python (bundled Node.js, vendored npm)
|
|
5
5
|
Project-URL: Homepage, https://github.com/nuage-studio/vercel-cli-python
|
|
6
6
|
Project-URL: Repository, https://github.com/nuage-studio/vercel-cli-python
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
vercel_cli/vendor/LICENSE,sha256=sHDXe_ssUqHdaZbeDOX2TEmgylXIibFjqWPd9csAHuI,11343
|
|
2
2
|
vercel_cli/vendor/README.md,sha256=2ZrJzd7x21xlpsOZ9QKG6478zbXb8-3YN8cPyzPxZNk,1799
|
|
3
|
-
vercel_cli/vendor/package.json,sha256=
|
|
3
|
+
vercel_cli/vendor/package.json,sha256=pAUVy4NjIPrkT_Z6nj0DpSAv0cmr_ra-1MWqGg4KZ5M,1261
|
|
4
4
|
vercel_cli/vendor/dist/VERCEL_DIR_README.txt,sha256=9dHtD1AyrhKJMfRkWbX6oa9jGfwt-z56X-VKhL-T29Y,520
|
|
5
5
|
vercel_cli/vendor/dist/builder-worker.js,sha256=RgutTXJcurRisV2NtlruuPDtCBOi8eHSGCo3n4GcCIM,1969
|
|
6
6
|
vercel_cli/vendor/dist/get-latest-worker.js,sha256=w7nK8nQtlYad_SKuFQGw_sg7_bb-p0uHOf1MYiwrUNs,7964
|
|
7
|
-
vercel_cli/vendor/dist/index.js,sha256=
|
|
7
|
+
vercel_cli/vendor/dist/index.js,sha256=ES9bNJKYDWuDf3TK9hpo61Q2jdQmRYFmroWfLX_ZZDE,8858810
|
|
8
8
|
vercel_cli/vendor/dist/vc.js,sha256=AAC4u6uwjpO0KfFVuLRs5YWXjW4aMCkgSj_45hR3W8k,340
|
|
9
|
-
vercel_cli/vendor/node_modules/.package-lock.json,sha256=
|
|
9
|
+
vercel_cli/vendor/node_modules/.package-lock.json,sha256=bjdhiBvW31jIhFUeW_CcgnKPbPB-wcs164ID4Xwgdww,1002
|
|
10
10
|
vercel_cli/vendor/node_modules/@vercel/build-utils/CHANGELOG.md,sha256=ji-V7NgIUH1Fj-lmUh0LmIxhS6bq_0TW7xFH0e9yiF8,18051
|
|
11
11
|
vercel_cli/vendor/node_modules/@vercel/build-utils/LICENSE,sha256=sHDXe_ssUqHdaZbeDOX2TEmgylXIibFjqWPd9csAHuI,11343
|
|
12
12
|
vercel_cli/vendor/node_modules/@vercel/build-utils/build.mjs,sha256=UCAJgPaur_bxtLTnQxSkBwoq246SSCBvI-0w_PvbAVU,132
|
|
@@ -94,10 +94,10 @@ vercel_cli/vendor/node_modules/@vercel/detect-agent/package.json,sha256=Mt64aqQb
|
|
|
94
94
|
vercel_cli/vendor/node_modules/@vercel/detect-agent/dist/index.d.ts,sha256=vmuS3wT5-mth54kB1N8ue-58SV_K6vMlaaZr3YPY30k,67
|
|
95
95
|
vercel_cli/vendor/node_modules/@vercel/detect-agent/dist/index.js,sha256=WfZXin2E4GP1hNp0-jz3-XhHgFrbyp-wmGo-Mw0q3js,1973
|
|
96
96
|
vercel_cli/vendor/node_modules/@vercel/python/LICENSE,sha256=sHDXe_ssUqHdaZbeDOX2TEmgylXIibFjqWPd9csAHuI,11343
|
|
97
|
-
vercel_cli/vendor/node_modules/@vercel/python/package.json,sha256=
|
|
98
|
-
vercel_cli/vendor/node_modules/@vercel/python/vc_init.py,sha256=
|
|
99
|
-
vercel_cli/vendor/node_modules/@vercel/python/dist/index.js,sha256=
|
|
100
|
-
vercel_cli-47.
|
|
101
|
-
vercel_cli-47.
|
|
102
|
-
vercel_cli-47.
|
|
103
|
-
vercel_cli-47.
|
|
97
|
+
vercel_cli/vendor/node_modules/@vercel/python/package.json,sha256=atlkXbQQzFjD6wQioF1v2-uKZ6ppHEYcBxRCRw9GD0Q,1044
|
|
98
|
+
vercel_cli/vendor/node_modules/@vercel/python/vc_init.py,sha256=A7949hQi18B9yqPkTr1bepToi7nKRh_yRP7GwmsI-Ww,28201
|
|
99
|
+
vercel_cli/vendor/node_modules/@vercel/python/dist/index.js,sha256=ViBtEehBNplFPGqjIo_4Vtd937VcX6UqPQfRXYpD4og,107048
|
|
100
|
+
vercel_cli-47.1.4.dist-info/METADATA,sha256=KaJacoVtPOeKPsOe1Iq-DRZeUjuOxUZu8VeGHb2U7Cc,7085
|
|
101
|
+
vercel_cli-47.1.4.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
102
|
+
vercel_cli-47.1.4.dist-info/entry_points.txt,sha256=3iHkg20gi2BZorK1g5UlyZY3tN5E1vJX6PX5-ibn9fI,83
|
|
103
|
+
vercel_cli-47.1.4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|