Skip to content
Snippets Groups Projects
Unverified Commit ea09532f authored by Mathieu Kniewallner's avatar Mathieu Kniewallner Committed by GitHub
Browse files

refactor(manager/pep621): extract custom managers (#31280)

parent 89b76373
No related branches found
No related tags found
No related merge requests found
...@@ -8,6 +8,37 @@ const DependencyRecordSchema = z ...@@ -8,6 +8,37 @@ const DependencyRecordSchema = z
.record(z.string(), z.array(z.string())) .record(z.string(), z.array(z.string()))
.optional(); .optional();
const PdmSchema = z.object({
'dev-dependencies': DependencyRecordSchema,
source: z
.array(
z.object({
url: z.string(),
name: z.string(),
verify_ssl: z.boolean().optional(),
}),
)
.optional(),
});
const HatchSchema = z.object({
envs: z
.record(
z.string(),
z
.object({
dependencies: DependencyListSchema,
'extra-dependencies': DependencyListSchema,
})
.optional(),
)
.optional(),
});
const UvSchema = z.object({
'dev-dependencies': DependencyListSchema,
});
export const PyProjectSchema = z.object({ export const PyProjectSchema = z.object({
project: z project: z
.object({ .object({
...@@ -25,40 +56,9 @@ export const PyProjectSchema = z.object({ ...@@ -25,40 +56,9 @@ export const PyProjectSchema = z.object({
.optional(), .optional(),
tool: z tool: z
.object({ .object({
pdm: z pdm: PdmSchema.optional(),
.object({ hatch: HatchSchema.optional(),
'dev-dependencies': DependencyRecordSchema, uv: UvSchema.optional(),
source: z
.array(
z.object({
url: z.string(),
name: z.string(),
verify_ssl: z.boolean().optional(),
}),
)
.optional(),
})
.optional(),
hatch: z
.object({
envs: z
.record(
z.string(),
z
.object({
dependencies: DependencyListSchema,
'extra-dependencies': DependencyListSchema,
})
.optional(),
)
.optional(),
})
.optional(),
uv: z
.object({
'dev-dependencies': DependencyListSchema,
})
.optional(),
}) })
.optional(), .optional(),
}); });
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment