Skip to content

Commit 5bef10d

Browse files
authored
feat: add cache output (#45)
This was currently not in the schema, as it's experimental.
1 parent ca491cd commit 5bef10d

File tree

2 files changed

+121
-0
lines changed

2 files changed

+121
-0
lines changed

conda_recipe_v2_schema/model.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -617,9 +617,28 @@ class BaseRecipe(StrictBaseModel):
617617
)
618618

619619

620+
class Cache(StrictBaseModel):
621+
source: ConditionalList[Source] | None = Field(
622+
None,
623+
description="The source items to be downloaded and used for the cache build and subsequent outputs.",
624+
)
625+
626+
requirements: Requirements | None = Field(
627+
None, description="The dependencies needed at cache-build time."
628+
)
629+
630+
build: OutputBuild | None = Field(
631+
None, description="Describes how the package should be build."
632+
)
633+
634+
620635
class ComplexRecipe(BaseRecipe):
621636
recipe: ComplexPackage | None = Field(None, description="The package version.")
622637

638+
cache: Cache | None = Field(
639+
None, description="The cache build that can be used as a common build step for all output."
640+
)
641+
623642
outputs: ConditionalList[Output] = Field(
624643
..., description="A list of outputs that are generated for this recipe."
625644
)

schema.json

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -562,6 +562,96 @@
562562
"title": "Build",
563563
"type": "object"
564564
},
565+
"Cache": {
566+
"additionalProperties": false,
567+
"properties": {
568+
"source": {
569+
"anyOf": [
570+
{
571+
"$ref": "#/$defs/UrlSource"
572+
},
573+
{
574+
"$ref": "#/$defs/GitRev"
575+
},
576+
{
577+
"$ref": "#/$defs/GitTag"
578+
},
579+
{
580+
"$ref": "#/$defs/GitBranch"
581+
},
582+
{
583+
"$ref": "#/$defs/BaseGitSource"
584+
},
585+
{
586+
"$ref": "#/$defs/LocalSource"
587+
},
588+
{
589+
"$ref": "#/$defs/IfStatement"
590+
},
591+
{
592+
"items": {
593+
"anyOf": [
594+
{
595+
"$ref": "#/$defs/UrlSource"
596+
},
597+
{
598+
"$ref": "#/$defs/GitRev"
599+
},
600+
{
601+
"$ref": "#/$defs/GitTag"
602+
},
603+
{
604+
"$ref": "#/$defs/GitBranch"
605+
},
606+
{
607+
"$ref": "#/$defs/BaseGitSource"
608+
},
609+
{
610+
"$ref": "#/$defs/LocalSource"
611+
},
612+
{
613+
"$ref": "#/$defs/IfStatement"
614+
}
615+
]
616+
},
617+
"type": "array"
618+
},
619+
{
620+
"type": "null"
621+
}
622+
],
623+
"default": null,
624+
"description": "The source items to be downloaded and used for the cache build and subsequent outputs.",
625+
"title": "Source"
626+
},
627+
"requirements": {
628+
"anyOf": [
629+
{
630+
"$ref": "#/$defs/Requirements"
631+
},
632+
{
633+
"type": "null"
634+
}
635+
],
636+
"default": null,
637+
"description": "The dependencies needed at cache-build time."
638+
},
639+
"build": {
640+
"anyOf": [
641+
{
642+
"$ref": "#/$defs/OutputBuild"
643+
},
644+
{
645+
"type": "null"
646+
}
647+
],
648+
"default": null,
649+
"description": "Describes how the package should be build."
650+
}
651+
},
652+
"title": "Cache",
653+
"type": "object"
654+
},
565655
"ComplexPackage": {
566656
"additionalProperties": false,
567657
"properties": {
@@ -729,6 +819,18 @@
729819
"default": null,
730820
"description": "The package version."
731821
},
822+
"cache": {
823+
"anyOf": [
824+
{
825+
"$ref": "#/$defs/Cache"
826+
},
827+
{
828+
"type": "null"
829+
}
830+
],
831+
"default": null,
832+
"description": "The cache build that can be used as a common build step for all output."
833+
},
732834
"outputs": {
733835
"anyOf": [
734836
{

0 commit comments

Comments
 (0)