Skip to content

Commit 7c25a13

Browse files
authored
feat: add support for python test requirements (#43)
Companion PR for prefix-dev/rattler-build#1170
1 parent be58bcc commit 7c25a13

File tree

4 files changed

+24
-1
lines changed

4 files changed

+24
-1
lines changed

3.11

Whitespace-only changes.

conda_recipe_v2_schema/model.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,10 @@ class PythonTestElementInner(StrictBaseModel):
448448
default=True,
449449
description="Whether or not to run `pip check` during the Python tests.",
450450
)
451+
python_version: str | list[str] | None = Field(
452+
None,
453+
description="Python version(s) to test against. If not specified, the default python version is used.",
454+
)
451455

452456

453457
class PythonTestElement(StrictBaseModel):

pixi.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jsonschema = ">=4.23.0,<5"
1515
pytest = ">=8.3.1,<9"
1616

1717
[tasks]
18-
generate = "python model.py > schema.json"
18+
generate = "python -m conda_recipe_v2_schema.model > schema.json"
1919
fmt = "ruff format ."
2020
lint = "ruff check . --fix"
2121
tests = "pytest tests"

schema.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3144,6 +3144,25 @@
31443144
"description": "Whether or not to run `pip check` during the Python tests.",
31453145
"title": "Pip Check",
31463146
"type": "boolean"
3147+
},
3148+
"python_version": {
3149+
"anyOf": [
3150+
{
3151+
"type": "string"
3152+
},
3153+
{
3154+
"items": {
3155+
"type": "string"
3156+
},
3157+
"type": "array"
3158+
},
3159+
{
3160+
"type": "null"
3161+
}
3162+
],
3163+
"default": null,
3164+
"description": "Python version(s) to test against. If not specified, the default python version is used.",
3165+
"title": "Python Version"
31473166
}
31483167
},
31493168
"required": [

0 commit comments

Comments
 (0)