mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 04:34:28 +08:00
check_consistent.py: Add a check guarding against typos for the new platforms key (#9203)
This commit is contained in:
@@ -20,6 +20,7 @@ from utils import VERSIONS_RE, get_all_testcase_directories, get_gitignore_spec,
|
||||
metadata_keys = {"version", "requires", "extra_description", "obsolete_since", "no_longer_updated", "tool"}
|
||||
tool_keys = {"stubtest": {"skip", "apt_dependencies", "extras", "ignore_missing_stub", "platforms"}}
|
||||
extension_descriptions = {".pyi": "stub", ".py": ".py"}
|
||||
supported_stubtest_platforms = {"win32", "darwin", "linux"}
|
||||
|
||||
|
||||
def assert_consistent_filetypes(directory: Path, *, kind: str, allowed: set[str]) -> None:
|
||||
@@ -151,6 +152,11 @@ def check_metadata() -> None:
|
||||
for key in data.get("tool", {}).get(tool, {}):
|
||||
assert key in tk, f"Unrecognised {tool} key {key} for {distribution}"
|
||||
|
||||
specified_stubtest_platforms = set(data.get("tool", {}).get("stubtest", {}).get("platforms", []))
|
||||
assert (
|
||||
specified_stubtest_platforms <= supported_stubtest_platforms
|
||||
), f"Unrecognised platforms specified: {supported_stubtest_platforms - specified_stubtest_platforms}"
|
||||
|
||||
|
||||
def get_txt_requirements() -> dict[str, SpecifierSet]:
|
||||
with open("requirements-tests.txt", encoding="UTF-8") as requirements_file:
|
||||
|
||||
Reference in New Issue
Block a user