diff --git a/bin/generate_schema.py b/bin/generate_schema.py index 64245c013..b5c1c60af 100755 --- a/bin/generate_schema.py +++ b/bin/generate_schema.py @@ -200,6 +200,7 @@ items: type: object required: ["select"] + minProperties: 2 additionalProperties: false properties: select: {} diff --git a/cibuildwheel/resources/cibuildwheel.schema.json b/cibuildwheel/resources/cibuildwheel.schema.json index 5930b4972..b9427c3ef 100644 --- a/cibuildwheel/resources/cibuildwheel.schema.json +++ b/cibuildwheel/resources/cibuildwheel.schema.json @@ -406,6 +406,7 @@ "required": [ "select" ], + "minProperties": 2, "additionalProperties": false, "properties": { "select": { diff --git a/unit_test/validate_schema_test.py b/unit_test/validate_schema_test.py index 742049346..66c95f25a 100644 --- a/unit_test/validate_schema_test.py +++ b/unit_test/validate_schema_test.py @@ -59,6 +59,19 @@ def test_overrides_no_select(): validator(example) +def test_overrides_only_select(): + example = tomllib.loads( + """ + [[tool.cibuildwheel.overrides]] + select = "somestring" + """ + ) + + validator = validate_pyproject.api.Validator() + with pytest.raises(validate_pyproject.error_reporting.ValidationError): + validator(example) + + def test_docs_examples(): """ Parse out all the configuration examples, build valid TOML out of them, and