@vercel/python-analysis 0.5.0 → 0.7.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.cjs CHANGED
@@ -66,7 +66,6 @@ __export(src_exports, {
66
66
  containsAppOrHandler: () => containsAppOrHandler,
67
67
  createMinimalManifest: () => createMinimalManifest,
68
68
  discoverPythonPackage: () => discoverPythonPackage,
69
- generateRuntimeRequirements: () => generateRuntimeRequirements,
70
69
  isPrivatePackageSource: () => isPrivatePackageSource,
71
70
  normalizePackageName: () => normalizePackageName,
72
71
  parseUvLock: () => parseUvLock,
@@ -118,7 +117,7 @@ async function importWasmModule() {
118
117
 
119
118
  // src/semantic/entrypoints.ts
120
119
  async function containsAppOrHandler(source) {
121
- if (!source.includes("app") && !source.includes("handler") && !source.includes("Handler")) {
120
+ if (!source.includes("app") && !source.includes("application") && !source.includes("handler") && !source.includes("Handler")) {
122
121
  return false;
123
122
  }
124
123
  const mod = await importWasmModule();
@@ -2289,22 +2288,6 @@ function classifyPackages(options) {
2289
2288
  }
2290
2289
  return { privatePackages, publicPackages, packageVersions };
2291
2290
  }
2292
- function generateRuntimeRequirements(classification) {
2293
- const lines = [
2294
- "# Auto-generated requirements for runtime installation",
2295
- "# Private packages are bundled separately and not listed here.",
2296
- ""
2297
- ];
2298
- for (const pkgName of classification.publicPackages) {
2299
- const version = classification.packageVersions[pkgName];
2300
- if (version) {
2301
- lines.push(`${pkgName}==${version}`);
2302
- } else {
2303
- lines.push(pkgName);
2304
- }
2305
- }
2306
- return lines.join("\n");
2307
- }
2308
2291
 
2309
2292
  // src/manifest/python-selector.ts
2310
2293
  function selectPython(constraints, available) {
@@ -2493,7 +2476,6 @@ var HashDigestSchema = hashDigestSchema;
2493
2476
  containsAppOrHandler,
2494
2477
  createMinimalManifest,
2495
2478
  discoverPythonPackage,
2496
- generateRuntimeRequirements,
2497
2479
  isPrivatePackageSource,
2498
2480
  normalizePackageName,
2499
2481
  parseUvLock,
package/dist/index.d.ts CHANGED
@@ -13,7 +13,7 @@ export type { PythonConfig, PythonConfigs, PythonLockFile, PythonManifest, Pytho
13
13
  export { discoverPythonPackage, PythonConfigKind, PythonLockFileKind, PythonManifestConvertedKind, PythonManifestKind, } from './manifest/package';
14
14
  export { createMinimalManifest, stringifyManifest, type CreateMinimalManifestOptions, } from './manifest/serialize';
15
15
  export type { ClassifyPackagesOptions, PackageClassification, UvLockFile, UvLockPackage, UvLockPackageSource, } from './manifest/uv-lock-parser';
16
- export { classifyPackages, generateRuntimeRequirements, isPrivatePackageSource, normalizePackageName, parseUvLock, } from './manifest/uv-lock-parser';
16
+ export { classifyPackages, isPrivatePackageSource, normalizePackageName, parseUvLock, } from './manifest/uv-lock-parser';
17
17
  export type { PythonSelectionResult } from './manifest/python-selector';
18
18
  export { selectPython } from './manifest/python-selector';
19
19
  export { PythonAnalysisError } from './util/error';
package/dist/index.js CHANGED
@@ -40,7 +40,7 @@ async function importWasmModule() {
40
40
 
41
41
  // src/semantic/entrypoints.ts
42
42
  async function containsAppOrHandler(source) {
43
- if (!source.includes("app") && !source.includes("handler") && !source.includes("Handler")) {
43
+ if (!source.includes("app") && !source.includes("application") && !source.includes("handler") && !source.includes("Handler")) {
44
44
  return false;
45
45
  }
46
46
  const mod = await importWasmModule();
@@ -2214,22 +2214,6 @@ function classifyPackages(options) {
2214
2214
  }
2215
2215
  return { privatePackages, publicPackages, packageVersions };
2216
2216
  }
2217
- function generateRuntimeRequirements(classification) {
2218
- const lines = [
2219
- "# Auto-generated requirements for runtime installation",
2220
- "# Private packages are bundled separately and not listed here.",
2221
- ""
2222
- ];
2223
- for (const pkgName of classification.publicPackages) {
2224
- const version = classification.packageVersions[pkgName];
2225
- if (version) {
2226
- lines.push(`${pkgName}==${version}`);
2227
- } else {
2228
- lines.push(pkgName);
2229
- }
2230
- }
2231
- return lines.join("\n");
2232
- }
2233
2217
 
2234
2218
  // src/manifest/python-selector.ts
2235
2219
  function selectPython(constraints, available) {
@@ -2417,7 +2401,6 @@ export {
2417
2401
  containsAppOrHandler,
2418
2402
  createMinimalManifest,
2419
2403
  discoverPythonPackage,
2420
- generateRuntimeRequirements,
2421
2404
  isPrivatePackageSource,
2422
2405
  normalizePackageName,
2423
2406
  parseUvLock,
@@ -68,10 +68,3 @@ export interface ClassifyPackagesOptions {
68
68
  * at runtime vs. which must be bundled with the deployment.
69
69
  */
70
70
  export declare function classifyPackages(options: ClassifyPackagesOptions): PackageClassification;
71
- /**
72
- * Generate requirements.txt content for runtime installation.
73
- *
74
- * Only includes public packages that will be installed at runtime from PyPI.
75
- * Private packages should be bundled separately.
76
- */
77
- export declare function generateRuntimeRequirements(classification: PackageClassification): string;
@@ -5,6 +5,7 @@
5
5
  /**
6
6
  * Check if Python source code contains or exports:
7
7
  * - A top-level 'app' callable (e.g., Flask, FastAPI, Sanic apps)
8
+ * - A top-level 'application' callable (e.g., Django )
8
9
  * - A top-level 'handler' class (e.g., BaseHTTPRequestHandler subclass)
9
10
  *
10
11
  * This function uses a WASM-based Python parser (ruff_python_ast) for
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/python-analysis",
3
- "version": "0.5.0",
3
+ "version": "0.7.0",
4
4
  "main": "./dist/index.cjs",
5
5
  "module": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",