mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-06 20:24:30 +08:00
check_distutils test: Make the file path of missing setuptools distutils files more obvious (#13037)
This commit is contained in:
@@ -93,11 +93,13 @@ def check_distutils() -> None:
|
||||
def all_relative_paths_in_directory(path: Path) -> set[Path]:
|
||||
return {pyi.relative_to(path) for pyi in path.rglob("*.pyi")}
|
||||
|
||||
all_setuptools_files = all_relative_paths_in_directory(STUBS_PATH / "setuptools" / "setuptools" / "_distutils")
|
||||
all_distutils_files = all_relative_paths_in_directory(STUBS_PATH / "setuptools" / "distutils")
|
||||
setuptools_path = STUBS_PATH / "setuptools" / "setuptools" / "_distutils"
|
||||
distutils_path = STUBS_PATH / "setuptools" / "distutils"
|
||||
all_setuptools_files = all_relative_paths_in_directory(setuptools_path)
|
||||
all_distutils_files = all_relative_paths_in_directory(distutils_path)
|
||||
assert all_setuptools_files and all_distutils_files, "Looks like this test might be out of date!"
|
||||
extra_files = all_setuptools_files - all_distutils_files
|
||||
joined = "\n".join(f" * {f}" for f in extra_files)
|
||||
joined = "\n".join(f" * {distutils_path / f}" for f in extra_files)
|
||||
assert not extra_files, f"Files missing from distutils:\n{joined}"
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user