MCPcopy Create free account
hub / github.com/vercel/vercel / isPythonEntrypoint

Function isPythonEntrypoint

packages/build-utils/src/python.ts:12–24  ·  view source on GitHub ↗
(
  file: FileFsRef | { fsPath?: string }
)

Source from the content-addressed store, hash-verified

10 * - A top-level 'handler' class (BaseHTTPRequestHandler subclass)
11 */
12export async function isPythonEntrypoint(
13 file: FileFsRef | { fsPath?: string }
14): Promise<boolean> {
15 try {
16 const fsPath = (file as FileFsRef).fsPath;
17 if (!fsPath) return false;
18 const content = await fs.promises.readFile(fsPath, 'utf-8');
19 return (await findAppOrHandler(content)) !== null;
20 } catch (err) {
21 debug(`Failed to check Python entrypoint: ${err}`);
22 return false;
23 }
24}

Callers 1

maybeGetApiBuilderFunction · 0.90

Calls 2

findAppOrHandlerFunction · 0.90
debugFunction · 0.70

Tested by

no test coverage detected