@vercel/python-analysis 0.3.2 → 0.4.1
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 +332 -19
- package/dist/index.d.ts +3 -2
- package/dist/index.js +328 -18
- package/dist/manifest/package.d.ts +24 -0
- package/dist/manifest/pyproject/schema.zod.d.ts +16 -0
- package/dist/manifest/requirements-txt-parser.d.ts +4 -0
- package/dist/manifest/serialize.d.ts +22 -0
- package/dist/manifest/uv-config/schema.zod.d.ts +8 -0
- package/dist/manifest/uv-config/types.d.ts +2 -0
- package/dist/util/error.d.ts +7 -1
- package/package.json +1 -1
|
@@ -12,6 +12,10 @@ export interface PipOptions {
|
|
|
12
12
|
indexUrl?: string;
|
|
13
13
|
/** Extra index URLs (--extra-index-url) */
|
|
14
14
|
extraIndexUrls: string[];
|
|
15
|
+
/** Directories/URLs for --find-links / -f (only set when present) */
|
|
16
|
+
findLinks?: string[];
|
|
17
|
+
/** Whether --no-index was specified (only set when true) */
|
|
18
|
+
noIndex?: boolean;
|
|
15
19
|
}
|
|
16
20
|
/**
|
|
17
21
|
* Result of parsing a requirements file with pip options.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { PyProjectToml } from './pyproject/types';
|
|
2
|
+
/**
|
|
3
|
+
* Serialize a PyProjectToml to TOML string format.
|
|
4
|
+
*/
|
|
5
|
+
export declare function stringifyManifest(data: PyProjectToml): string;
|
|
6
|
+
/**
|
|
7
|
+
* Options for creating a minimal pyproject.toml structure.
|
|
8
|
+
*/
|
|
9
|
+
export interface CreateMinimalManifestOptions {
|
|
10
|
+
/** Project name (defaults to 'app'). */
|
|
11
|
+
name?: string;
|
|
12
|
+
/** Project version (defaults to '0.1.0'). */
|
|
13
|
+
version?: string;
|
|
14
|
+
/** Python version constraint (e.g., '>=3.12' or '~=3.12.0'). */
|
|
15
|
+
requiresPython?: string;
|
|
16
|
+
/** Initial dependencies. */
|
|
17
|
+
dependencies?: string[];
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Create a minimal PyProjectToml structure for projects without a manifest.
|
|
21
|
+
*/
|
|
22
|
+
export declare function createMinimalManifest(options?: CreateMinimalManifestOptions): PyProjectToml;
|
|
@@ -14,16 +14,19 @@ export declare const uvIndexEntrySchema: z.ZodObject<{
|
|
|
14
14
|
url: z.ZodString;
|
|
15
15
|
default: z.ZodOptional<z.ZodBoolean>;
|
|
16
16
|
explicit: z.ZodOptional<z.ZodBoolean>;
|
|
17
|
+
format: z.ZodOptional<z.ZodString>;
|
|
17
18
|
}, "strip", z.ZodTypeAny, {
|
|
18
19
|
name: string;
|
|
19
20
|
url: string;
|
|
20
21
|
default?: boolean | undefined;
|
|
21
22
|
explicit?: boolean | undefined;
|
|
23
|
+
format?: string | undefined;
|
|
22
24
|
}, {
|
|
23
25
|
name: string;
|
|
24
26
|
url: string;
|
|
25
27
|
default?: boolean | undefined;
|
|
26
28
|
explicit?: boolean | undefined;
|
|
29
|
+
format?: string | undefined;
|
|
27
30
|
}>;
|
|
28
31
|
export declare const uvConfigSchema: z.ZodObject<{
|
|
29
32
|
sources: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
|
|
@@ -68,16 +71,19 @@ export declare const uvConfigSchema: z.ZodObject<{
|
|
|
68
71
|
url: z.ZodString;
|
|
69
72
|
default: z.ZodOptional<z.ZodBoolean>;
|
|
70
73
|
explicit: z.ZodOptional<z.ZodBoolean>;
|
|
74
|
+
format: z.ZodOptional<z.ZodString>;
|
|
71
75
|
}, "strip", z.ZodTypeAny, {
|
|
72
76
|
name: string;
|
|
73
77
|
url: string;
|
|
74
78
|
default?: boolean | undefined;
|
|
75
79
|
explicit?: boolean | undefined;
|
|
80
|
+
format?: string | undefined;
|
|
76
81
|
}, {
|
|
77
82
|
name: string;
|
|
78
83
|
url: string;
|
|
79
84
|
default?: boolean | undefined;
|
|
80
85
|
explicit?: boolean | undefined;
|
|
86
|
+
format?: string | undefined;
|
|
81
87
|
}>, "many">>;
|
|
82
88
|
workspace: z.ZodOptional<z.ZodObject<{
|
|
83
89
|
members: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
@@ -108,6 +114,7 @@ export declare const uvConfigSchema: z.ZodObject<{
|
|
|
108
114
|
url: string;
|
|
109
115
|
default?: boolean | undefined;
|
|
110
116
|
explicit?: boolean | undefined;
|
|
117
|
+
format?: string | undefined;
|
|
111
118
|
}[] | undefined;
|
|
112
119
|
workspace?: {
|
|
113
120
|
members?: string[] | undefined;
|
|
@@ -132,6 +139,7 @@ export declare const uvConfigSchema: z.ZodObject<{
|
|
|
132
139
|
url: string;
|
|
133
140
|
default?: boolean | undefined;
|
|
134
141
|
explicit?: boolean | undefined;
|
|
142
|
+
format?: string | undefined;
|
|
135
143
|
}[] | undefined;
|
|
136
144
|
workspace?: {
|
|
137
145
|
members?: string[] | undefined;
|
|
@@ -26,6 +26,8 @@ export interface UvIndexEntry {
|
|
|
26
26
|
default?: boolean;
|
|
27
27
|
/** Mark this index as explicit (must be explicitly referenced per-package) */
|
|
28
28
|
explicit?: boolean;
|
|
29
|
+
/** Index format: omit for standard (PEP 503), or "flat" for flat indexes (--find-links) */
|
|
30
|
+
format?: string;
|
|
29
31
|
}
|
|
30
32
|
/**
|
|
31
33
|
* [tool.uv] section in pyproject.toml or uv.toml.
|
package/dist/util/error.d.ts
CHANGED
|
@@ -22,6 +22,11 @@ interface PythonAnalysisErrorProps {
|
|
|
22
22
|
* Optional "action" to display before the `link`, such as "Learn More".
|
|
23
23
|
*/
|
|
24
24
|
action?: string;
|
|
25
|
+
/**
|
|
26
|
+
* The raw content of the file that failed to parse, if available.
|
|
27
|
+
* Useful for diagnostic logging by callers.
|
|
28
|
+
*/
|
|
29
|
+
fileContent?: string;
|
|
25
30
|
}
|
|
26
31
|
/**
|
|
27
32
|
* This error should be thrown from Python analysis functions
|
|
@@ -34,6 +39,7 @@ export declare class PythonAnalysisError extends Error {
|
|
|
34
39
|
path?: string;
|
|
35
40
|
link?: string;
|
|
36
41
|
action?: string;
|
|
37
|
-
|
|
42
|
+
fileContent?: string;
|
|
43
|
+
constructor({ message, code, path, link, action, fileContent, }: PythonAnalysisErrorProps);
|
|
38
44
|
}
|
|
39
45
|
export {};
|