mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-03 10:03:32 +08:00
stubtest: per project --ignore-missing-stub (#8122)
This commit is contained in:
@@ -1 +1,4 @@
|
||||
version = "3.0.*"
|
||||
|
||||
[tool.stubtest]
|
||||
ignore_missing_stub = false
|
||||
|
||||
@@ -4,6 +4,9 @@ from typing_extensions import SupportsIndex, final
|
||||
|
||||
VERSION: str
|
||||
XXHASH_VERSION: str
|
||||
VERSION_TUPLE: tuple[int, ...]
|
||||
|
||||
algorithms_available: set[str]
|
||||
|
||||
class _IntDigestHash(_Hash):
|
||||
@property
|
||||
|
||||
@@ -20,7 +20,7 @@ import tomli
|
||||
|
||||
consistent_files = [{"stdlib/@python2/builtins.pyi", "stdlib/@python2/__builtin__.pyi"}]
|
||||
metadata_keys = {"version", "requires", "extra_description", "obsolete_since", "no_longer_updated", "tool"}
|
||||
tool_keys = {"stubtest": {"skip", "apt_dependencies"}}
|
||||
tool_keys = {"stubtest": {"skip", "apt_dependencies", "ignore_missing_stub"}}
|
||||
allowed_files = {"README.md"}
|
||||
|
||||
|
||||
|
||||
@@ -66,19 +66,17 @@ def run_stubtest(dist: Path, *, verbose: bool = False) -> bool:
|
||||
print_command_failure("Failed to install", e)
|
||||
return False
|
||||
|
||||
ignore_missing_stub = ["--ignore-missing-stub"] if stubtest_meta.get("ignore_missing_stub", True) else []
|
||||
packages_to_check = [d.name for d in dist.iterdir() if d.is_dir() and d.name.isidentifier()]
|
||||
modules_to_check = [d.stem for d in dist.iterdir() if d.is_file() and d.suffix == ".pyi"]
|
||||
stubtest_cmd = [
|
||||
python_exe,
|
||||
"-m",
|
||||
"mypy.stubtest",
|
||||
# Use --ignore-missing-stub, because if someone makes a correct addition, they'll need to
|
||||
# also make a allowlist change and if someone makes an incorrect addition, they'll run into
|
||||
# false negatives.
|
||||
"--ignore-missing-stub",
|
||||
# Use --custom-typeshed-dir in case we make linked changes to stdlib or _typeshed
|
||||
"--custom-typeshed-dir",
|
||||
str(dist.parent.parent),
|
||||
*ignore_missing_stub,
|
||||
*packages_to_check,
|
||||
*modules_to_check,
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user