Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ensure 2+ items in each override in schema #1628

Merged
merged 1 commit into from
Sep 28, 2023
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions bin/generate_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@
items:
type: object
required: ["select"]
minProperties: 2
additionalProperties: false
properties:
select: {}
Expand Down
1 change: 1 addition & 0 deletions cibuildwheel/resources/cibuildwheel.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,7 @@
"required": [
"select"
],
"minProperties": 2,
"additionalProperties": false,
"properties": {
"select": {
Expand Down
13 changes: 13 additions & 0 deletions unit_test/validate_schema_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down