Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
252 changes: 252 additions & 0 deletions pixi.lock

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -324,9 +324,11 @@ test-slow = { cmd = """RUST_LOG="debug,resolvo=info" cargo nextest run --workspa
# Feature for JSON schema generation and testing
#
[feature.schema.dependencies]
jsonschema = ">=4.26.0,<5"
jsonschema-rs = ">=0.45,<1"
pydantic = ">=2.11.10,<3"
pydantic = ">=2.12.5,<3"
pytest = ">=9.0.2,<10"
python-fastjsonschema = ">=2.21.2,<3"
pyyaml = ">=6.0.3,<7"

[feature.schema.tasks]
Expand Down
5 changes: 4 additions & 1 deletion schema/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,10 @@ class ReservedTaskArgName(str, Enum):
pixi = "pixi"


TaskName = Annotated[str, Field(pattern=r"^[^\s\$]+$", description="A valid task name.")]
TaskName = Annotated[
NonEmptyStr,
Field(pattern=r"^[^\s\$]+$", description="A valid task name."),
]
NotReservedSchema: Any = {"not": {"enum": sorted(r.value for r in ReservedTaskArgName)}}
TaskArgName = Annotated[
str,
Expand Down
14 changes: 11 additions & 3 deletions schema/pyproject/partial-pixi.json
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,8 @@
}
},
"propertyNames": {
"description": "A valid task name."
"description": "A valid task name.",
"minLength": 1
}
},
"tool": {
Expand Down Expand Up @@ -636,6 +637,7 @@
"title": "Task",
"description": "the name of the task to depend on",
"type": "string",
"minLength": 1,
"pattern": "^[^\\s\\$]+$"
}
}
Expand Down Expand Up @@ -903,7 +905,8 @@
}
},
"propertyNames": {
"description": "A valid task name."
"description": "A valid task name.",
"minLength": 1
}
}
}
Expand Down Expand Up @@ -2156,7 +2159,8 @@
}
},
"propertyNames": {
"description": "A valid task name."
"description": "A valid task name.",
"minLength": 1
}
}
}
Expand Down Expand Up @@ -2298,6 +2302,7 @@
{
"description": "A valid task name.",
"type": "string",
"minLength": 1,
"pattern": "^[^\\s\\$]+$"
}
]
Expand All @@ -2309,6 +2314,7 @@
{
"description": "A valid task name.",
"type": "string",
"minLength": 1,
"pattern": "^[^\\s\\$]+$"
}
]
Expand All @@ -2322,12 +2328,14 @@
"items": {
"description": "A valid task name.",
"type": "string",
"minLength": 1,
"pattern": "^[^\\s\\$]+$"
}
},
{
"description": "A valid task name.",
"type": "string",
"minLength": 1,
"pattern": "^[^\\s\\$]+$"
}
]
Expand Down
14 changes: 11 additions & 3 deletions schema/pyproject/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,7 @@
"title": "Task",
"description": "the name of the task to depend on",
"type": "string",
"minLength": 1,
"pattern": "^[^\\s\\$]+$"
}
}
Expand Down Expand Up @@ -671,7 +672,8 @@
}
},
"propertyNames": {
"description": "A valid task name."
"description": "A valid task name.",
"minLength": 1
}
}
}
Expand Down Expand Up @@ -1752,7 +1754,8 @@
}
},
"propertyNames": {
"description": "A valid task name."
"description": "A valid task name.",
"minLength": 1
}
},
"tool": {
Expand Down Expand Up @@ -2194,7 +2197,8 @@
}
},
"propertyNames": {
"description": "A valid task name."
"description": "A valid task name.",
"minLength": 1
}
}
}
Expand Down Expand Up @@ -2336,6 +2340,7 @@
{
"description": "A valid task name.",
"type": "string",
"minLength": 1,
"pattern": "^[^\\s\\$]+$"
}
]
Expand All @@ -2347,6 +2352,7 @@
{
"description": "A valid task name.",
"type": "string",
"minLength": 1,
"pattern": "^[^\\s\\$]+$"
}
]
Expand All @@ -2360,12 +2366,14 @@
"items": {
"description": "A valid task name.",
"type": "string",
"minLength": 1,
"pattern": "^[^\\s\\$]+$"
}
},
{
"description": "A valid task name.",
"type": "string",
"minLength": 1,
"pattern": "^[^\\s\\$]+$"
}
]
Expand Down
14 changes: 11 additions & 3 deletions schema/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,8 @@
}
},
"propertyNames": {
"description": "A valid task name."
"description": "A valid task name.",
"minLength": 1
}
},
"tool": {
Expand Down Expand Up @@ -660,6 +661,7 @@
"title": "Task",
"description": "the name of the task to depend on",
"type": "string",
"minLength": 1,
"pattern": "^[^\\s\\$]+$"
}
}
Expand Down Expand Up @@ -927,7 +929,8 @@
}
},
"propertyNames": {
"description": "A valid task name."
"description": "A valid task name.",
"minLength": 1
}
}
}
Expand Down Expand Up @@ -2180,7 +2183,8 @@
}
},
"propertyNames": {
"description": "A valid task name."
"description": "A valid task name.",
"minLength": 1
}
}
}
Expand Down Expand Up @@ -2322,6 +2326,7 @@
{
"description": "A valid task name.",
"type": "string",
"minLength": 1,
"pattern": "^[^\\s\\$]+$"
}
]
Expand All @@ -2333,6 +2338,7 @@
{
"description": "A valid task name.",
"type": "string",
"minLength": 1,
"pattern": "^[^\\s\\$]+$"
}
]
Expand All @@ -2346,12 +2352,14 @@
"items": {
"description": "A valid task name.",
"type": "string",
"minLength": 1,
"pattern": "^[^\\s\\$]+$"
}
},
{
"description": "A valid task name.",
"type": "string",
"minLength": 1,
"pattern": "^[^\\s\\$]+$"
}
]
Expand Down
19 changes: 19 additions & 0 deletions schema/test_manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,3 +186,22 @@ def test_real_manifests(
if error_count:
pprint.pprint(all_errors)
assert not error_count


def test_gh_1089_fastjsonschema(manifest_schemata: TRawSchemata) -> None:
import fastjsonschema # pyright: ignore [reportMissingTypeStubs]

for manifest_name, schemata in manifest_schemata.items():
for schema_name, schema in schemata.items():
print(manifest_name, schema_name)
fastjsonschema.compile(schema) # pyright: ignore [reportUnknownMemberType]


def test_gh_1089_python_jsonschema(manifest_schemata: TRawSchemata) -> None:
import jsonschema.validators

for manifest_name, schemata in manifest_schemata.items():
for schema_name, schema in schemata.items():
print(manifest_name, schema_name)
cls = jsonschema.validators.validator_for(schema)
cls.check_schema(schema)
Loading