diff --git a/conda_recipe_v2_schema/model.py b/conda_recipe_v2_schema/model.py index 1711d74..142172f 100644 --- a/conda_recipe_v2_schema/model.py +++ b/conda_recipe_v2_schema/model.py @@ -92,6 +92,10 @@ class BaseSource(StrictBaseModel): target_directory: NonEmptyStr | None = Field( None, description="The location in the working directory to place the source" ) + filter: Glob = Field( + None, + description="Glob patterns to include or exclude files from the extracted source.", + ) class AttestationConfig(StrictBaseModel): @@ -165,9 +169,6 @@ class LocalSource(BaseSource): None, description="A file name to rename the file to (does not apply to archives).", ) - filter: Glob = Field( - None, description="Glob patterns to include or exclude files from the package." - ) Source = UrlSource | GitSource | LocalSource diff --git a/schema.json b/schema.json index 2a6e16d..d113b3f 100644 --- a/schema.json +++ b/schema.json @@ -220,6 +220,37 @@ "description": "The location in the working directory to place the source", "title": "Target Directory" }, + "filter": { + "anyOf": [ + { + "minLength": 1, + "type": "string" + }, + { + "$ref": "#/$defs/IfStatement" + }, + { + "items": { + "anyOf": [ + { + "minLength": 1, + "type": "string" + }, + { + "$ref": "#/$defs/IfStatement" + } + ] + }, + "type": "array" + }, + { + "$ref": "#/$defs/GlobDict" + } + ], + "default": null, + "description": "Glob patterns to include or exclude files from the extracted source.", + "title": "Filter" + }, "git": { "anyOf": [ { @@ -1719,6 +1750,37 @@ "description": "The location in the working directory to place the source", "title": "Target Directory" }, + "filter": { + "anyOf": [ + { + "minLength": 1, + "type": "string" + }, + { + "$ref": "#/$defs/IfStatement" + }, + { + "items": { + "anyOf": [ + { + "minLength": 1, + "type": "string" + }, + { + "$ref": "#/$defs/IfStatement" + } + ] + }, + "type": "array" + }, + { + "$ref": "#/$defs/GlobDict" + } + ], + "default": null, + "description": "Glob patterns to include or exclude files from the extracted source.", + "title": "Filter" + }, "git": { "anyOf": [ { @@ -1836,6 +1898,37 @@ "description": "The location in the working directory to place the source", "title": "Target Directory" }, + "filter": { + "anyOf": [ + { + "minLength": 1, + "type": "string" + }, + { + "$ref": "#/$defs/IfStatement" + }, + { + "items": { + "anyOf": [ + { + "minLength": 1, + "type": "string" + }, + { + "$ref": "#/$defs/IfStatement" + } + ] + }, + "type": "array" + }, + { + "$ref": "#/$defs/GlobDict" + } + ], + "default": null, + "description": "Glob patterns to include or exclude files from the extracted source.", + "title": "Filter" + }, "git": { "anyOf": [ { @@ -1953,6 +2046,37 @@ "description": "The location in the working directory to place the source", "title": "Target Directory" }, + "filter": { + "anyOf": [ + { + "minLength": 1, + "type": "string" + }, + { + "$ref": "#/$defs/IfStatement" + }, + { + "items": { + "anyOf": [ + { + "minLength": 1, + "type": "string" + }, + { + "$ref": "#/$defs/IfStatement" + } + ] + }, + "type": "array" + }, + { + "$ref": "#/$defs/GlobDict" + } + ], + "default": null, + "description": "Glob patterns to include or exclude files from the extracted source.", + "title": "Filter" + }, "git": { "anyOf": [ { @@ -2528,6 +2652,37 @@ "description": "The location in the working directory to place the source", "title": "Target Directory" }, + "filter": { + "anyOf": [ + { + "minLength": 1, + "type": "string" + }, + { + "$ref": "#/$defs/IfStatement" + }, + { + "items": { + "anyOf": [ + { + "minLength": 1, + "type": "string" + }, + { + "$ref": "#/$defs/IfStatement" + } + ] + }, + "type": "array" + }, + { + "$ref": "#/$defs/GlobDict" + } + ], + "default": null, + "description": "Glob patterns to include or exclude files from the extracted source.", + "title": "Filter" + }, "path": { "description": "A path on the local machine that contains the source.", "title": "Path", @@ -2592,37 +2747,6 @@ "default": null, "description": "A file name to rename the file to (does not apply to archives).", "title": "File Name" - }, - "filter": { - "anyOf": [ - { - "minLength": 1, - "type": "string" - }, - { - "$ref": "#/$defs/IfStatement" - }, - { - "items": { - "anyOf": [ - { - "minLength": 1, - "type": "string" - }, - { - "$ref": "#/$defs/IfStatement" - } - ] - }, - "type": "array" - }, - { - "$ref": "#/$defs/GlobDict" - } - ], - "default": null, - "description": "Glob patterns to include or exclude files from the package.", - "title": "Filter" } }, "required": [ @@ -4594,6 +4718,37 @@ "description": "The location in the working directory to place the source", "title": "Target Directory" }, + "filter": { + "anyOf": [ + { + "minLength": 1, + "type": "string" + }, + { + "$ref": "#/$defs/IfStatement" + }, + { + "items": { + "anyOf": [ + { + "minLength": 1, + "type": "string" + }, + { + "$ref": "#/$defs/IfStatement" + } + ] + }, + "type": "array" + }, + { + "$ref": "#/$defs/GlobDict" + } + ], + "default": null, + "description": "Glob patterns to include or exclude files from the extracted source.", + "title": "Filter" + }, "url": { "anyOf": [ {