feat: add schema and validate-pyproject support (#1622)
* feat: add schema and validate-pyproject support Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> * fix: address review comments, fix bug, add tests Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> * fix: add test of examples in docs and fix Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> * fix: nicer titles Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> --------- Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
from pathlib import Path
|
||||
from typing import Any
|
||||
|
||||
DIR = Path(__file__).parent.resolve()
|
||||
|
||||
|
||||
def get_schema(tool_name: str = "cibuildwheel") -> dict[str, Any]:
|
||||
"Get the stored complete schema for cibuildwheel settings."
|
||||
assert tool_name == "cibuildwheel", "Only cibuildwheel is supported."
|
||||
|
||||
with DIR.joinpath("resources/cibuildwheel.schema.json").open(encoding="utf-8") as f:
|
||||
return json.load(f) # type: ignore[no-any-return]
|
||||
Reference in New Issue
Block a user