Skip to content

Commit

Permalink
refactor(manager/pep621): extract custom managers
Browse files Browse the repository at this point in the history
  • Loading branch information
mkniewallner committed Sep 9, 2024
1 parent 89b7637 commit 877dbb3
Showing 1 changed file with 34 additions and 34 deletions.
68 changes: 34 additions & 34 deletions lib/modules/manager/pep621/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,37 @@ const DependencyRecordSchema = z
.record(z.string(), z.array(z.string()))
.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({
project: z
.object({
Expand All @@ -25,40 +56,9 @@ export const PyProjectSchema = z.object({
.optional(),
tool: z
.object({
pdm: z
.object({
'dev-dependencies': DependencyRecordSchema,
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(),
pdm: PdmSchema.optional(),
hatch: HatchSchema.optional(),
uv: UvSchema.optional(),
})
.optional(),
});
Expand Down

0 comments on commit 877dbb3

Please sign in to comment.