mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 21:14:48 +08:00
Unify stubtest allowlist handling more (#11986)
This makes it trivial to consistently extend supported allowlists in the future.
This commit is contained in:
@@ -17,11 +17,6 @@ from utils import allowlist_stubtest_arguments, allowlists_path
|
||||
|
||||
|
||||
def run_stubtest(typeshed_dir: Path) -> int:
|
||||
version_allowlist = f"py{sys.version_info.major}{sys.version_info.minor}.txt"
|
||||
combined_allowlist = f"{sys.platform}-py{sys.version_info.major}{sys.version_info.minor}.txt"
|
||||
local_version_allowlist = version_allowlist + ".local"
|
||||
extra_allowlists = [version_allowlist, combined_allowlist, local_version_allowlist]
|
||||
|
||||
# Note when stubtest imports distutils, it will likely actually import setuptools._distutils
|
||||
# This is fine because we don't care about distutils and allowlist all errors from it
|
||||
# https://github.com/python/typeshed/pull/10253#discussion_r1216712404
|
||||
@@ -33,7 +28,7 @@ def run_stubtest(typeshed_dir: Path) -> int:
|
||||
"--check-typeshed",
|
||||
"--custom-typeshed-dir",
|
||||
str(typeshed_dir),
|
||||
*allowlist_stubtest_arguments("stdlib", extra_allowlists),
|
||||
*allowlist_stubtest_arguments("stdlib"),
|
||||
]
|
||||
if sys.version_info < (3, 10):
|
||||
# As discussed in https://github.com/python/typeshed/issues/3693, we only aim for
|
||||
|
||||
Reference in New Issue
Block a user