From 19beaba9e70bd552c5cb00223324c773efef47a8 Mon Sep 17 00:00:00 2001 From: Shantanu <12621235+hauntsaninja@users.noreply.github.com> Date: Sat, 20 Aug 2022 15:44:17 -0700 Subject: [PATCH] Disallow adding stubs for types- packages (#8579) This would lead to confusion. The types prefix is special cased in various ways in stub_uploader --- tests/check_consistent.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/check_consistent.py b/tests/check_consistent.py index dbf1e70f9..f2f8d0254 100755 --- a/tests/check_consistent.py +++ b/tests/check_consistent.py @@ -46,6 +46,7 @@ def check_stdlib() -> None: def check_stubs() -> None: for distribution in os.listdir("stubs"): + assert not distribution.startswith("types-"), f"Distribution not allowed to start with 'types-': {distribution}" assert not os.path.isfile(distribution), f"Only directories allowed in stubs, got {distribution}" for entry in os.listdir(os.path.join("stubs", distribution)): if os.path.isfile(os.path.join("stubs", distribution, entry)): @@ -61,7 +62,7 @@ def check_stubs() -> None: def check_same_files() -> None: - files = [os.path.join(root, file) for root, dir, files in os.walk(".") for file in files] + files = [os.path.join(root, file) for root, _, files in os.walk(".") for file in files] no_symlink = "You cannot use symlinks in typeshed, please copy {} to its link." for file in files: _, ext = os.path.splitext(file)