docs: add missing cp314-pyodide_wasm32 to build-id table (#2947)
* docs: add missing cp314-pyodide_wasm32 to build-id table The build-id table in docs/options.md is hand-maintained, so a new identifier can be missed when build-platforms.toml changes. Add a unit test that checks every identifier appears in the table to guard against this. Assisted-by: ClaudeCode:claude-opus-4.8 * test: skip docs table check when docs/options.md is absent Assisted-by: ClaudeCode:claude-opus-4.8
This commit is contained in:
@@ -1,10 +1,14 @@
|
||||
import tomllib
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
from packaging.version import Version
|
||||
|
||||
from cibuildwheel.extra import Printable, dump_python_configurations
|
||||
from cibuildwheel.util import resources
|
||||
|
||||
OPTIONS_MD = Path(__file__).parents[1] / "docs" / "options.md"
|
||||
|
||||
|
||||
def test_compare_configs() -> None:
|
||||
txt = resources.BUILD_PLATFORMS.read_text()
|
||||
@@ -18,6 +22,20 @@ def test_compare_configs() -> None:
|
||||
assert new_txt == txt
|
||||
|
||||
|
||||
@pytest.mark.skipif(not OPTIONS_MD.is_file(), reason="docs/options.md not present")
|
||||
def test_all_identifiers_in_docs_table() -> None:
|
||||
# The build-id table in docs/options.md is hand-maintained; this guards
|
||||
# against forgetting an identifier when build-platforms.toml changes.
|
||||
docs = OPTIONS_MD.read_text()
|
||||
identifiers = [
|
||||
config["identifier"]
|
||||
for configs in resources.read_all_configs().values()
|
||||
for config in configs
|
||||
]
|
||||
missing = [i for i in identifiers if i not in docs]
|
||||
assert not missing, f"Missing from docs/options.md build-id table: {missing}"
|
||||
|
||||
|
||||
def test_dump_with_Version() -> None:
|
||||
# MyPy doesn't understand deeply nested dicts correctly
|
||||
example: dict[str, dict[str, list[dict[str, Printable]]]] = {
|
||||
|
||||
Reference in New Issue
Block a user