diff --git a/.gitattributes b/.gitattributes index 17a1d7ab9..f2de17522 100644 --- a/.gitattributes +++ b/.gitattributes @@ -3,7 +3,7 @@ * eol=lf # Set linguist-language to support comments syntax highlight **/stubtest_allowlist*.txt linguist-language=ini -tests/stubtest_allowlists/*.txt linguist-language=ini +**/stubtest_allowlists/*.txt linguist-language=ini tests/pytype_exclude_list.txt linguist-language=ini pyrightconfig*.json linguist-language=jsonc .vscode/*.json linguist-language=jsonc diff --git a/.gitignore b/.gitignore index 0da65a4e4..da712d4c3 100644 --- a/.gitignore +++ b/.gitignore @@ -73,4 +73,4 @@ analyze.py .python-version # deliberately local test configuration files -tests/stubtest_allowlists/*.local +stdlib/@tests/stubtest_allowlists/*.local diff --git a/tests/stubtest_allowlists/py3_common.txt b/stdlib/@tests/stubtest_allowlists/common.txt similarity index 100% rename from tests/stubtest_allowlists/py3_common.txt rename to stdlib/@tests/stubtest_allowlists/common.txt diff --git a/tests/stubtest_allowlists/darwin-py311.txt b/stdlib/@tests/stubtest_allowlists/darwin-py311.txt similarity index 100% rename from tests/stubtest_allowlists/darwin-py311.txt rename to stdlib/@tests/stubtest_allowlists/darwin-py311.txt diff --git a/tests/stubtest_allowlists/darwin-py312.txt b/stdlib/@tests/stubtest_allowlists/darwin-py312.txt similarity index 100% rename from tests/stubtest_allowlists/darwin-py312.txt rename to stdlib/@tests/stubtest_allowlists/darwin-py312.txt diff --git a/tests/stubtest_allowlists/darwin.txt b/stdlib/@tests/stubtest_allowlists/darwin.txt similarity index 100% rename from tests/stubtest_allowlists/darwin.txt rename to stdlib/@tests/stubtest_allowlists/darwin.txt diff --git a/tests/stubtest_allowlists/linux-py312.txt b/stdlib/@tests/stubtest_allowlists/linux-py312.txt similarity index 100% rename from tests/stubtest_allowlists/linux-py312.txt rename to stdlib/@tests/stubtest_allowlists/linux-py312.txt diff --git a/tests/stubtest_allowlists/linux-py38.txt b/stdlib/@tests/stubtest_allowlists/linux-py38.txt similarity index 100% rename from tests/stubtest_allowlists/linux-py38.txt rename to stdlib/@tests/stubtest_allowlists/linux-py38.txt diff --git a/tests/stubtest_allowlists/linux-py39.txt b/stdlib/@tests/stubtest_allowlists/linux-py39.txt similarity index 100% rename from tests/stubtest_allowlists/linux-py39.txt rename to stdlib/@tests/stubtest_allowlists/linux-py39.txt diff --git a/tests/stubtest_allowlists/linux.txt b/stdlib/@tests/stubtest_allowlists/linux.txt similarity index 100% rename from tests/stubtest_allowlists/linux.txt rename to stdlib/@tests/stubtest_allowlists/linux.txt diff --git a/tests/stubtest_allowlists/py310.txt b/stdlib/@tests/stubtest_allowlists/py310.txt similarity index 100% rename from tests/stubtest_allowlists/py310.txt rename to stdlib/@tests/stubtest_allowlists/py310.txt diff --git a/tests/stubtest_allowlists/py311.txt b/stdlib/@tests/stubtest_allowlists/py311.txt similarity index 100% rename from tests/stubtest_allowlists/py311.txt rename to stdlib/@tests/stubtest_allowlists/py311.txt diff --git a/tests/stubtest_allowlists/py312.txt b/stdlib/@tests/stubtest_allowlists/py312.txt similarity index 100% rename from tests/stubtest_allowlists/py312.txt rename to stdlib/@tests/stubtest_allowlists/py312.txt diff --git a/tests/stubtest_allowlists/py38.txt b/stdlib/@tests/stubtest_allowlists/py38.txt similarity index 100% rename from tests/stubtest_allowlists/py38.txt rename to stdlib/@tests/stubtest_allowlists/py38.txt diff --git a/tests/stubtest_allowlists/py39.txt b/stdlib/@tests/stubtest_allowlists/py39.txt similarity index 100% rename from tests/stubtest_allowlists/py39.txt rename to stdlib/@tests/stubtest_allowlists/py39.txt diff --git a/tests/stubtest_allowlists/win32-py310.txt b/stdlib/@tests/stubtest_allowlists/win32-py310.txt similarity index 100% rename from tests/stubtest_allowlists/win32-py310.txt rename to stdlib/@tests/stubtest_allowlists/win32-py310.txt diff --git a/tests/stubtest_allowlists/win32-py311.txt b/stdlib/@tests/stubtest_allowlists/win32-py311.txt similarity index 100% rename from tests/stubtest_allowlists/win32-py311.txt rename to stdlib/@tests/stubtest_allowlists/win32-py311.txt diff --git a/tests/stubtest_allowlists/win32-py312.txt b/stdlib/@tests/stubtest_allowlists/win32-py312.txt similarity index 100% rename from tests/stubtest_allowlists/win32-py312.txt rename to stdlib/@tests/stubtest_allowlists/win32-py312.txt diff --git a/tests/stubtest_allowlists/win32-py38.txt b/stdlib/@tests/stubtest_allowlists/win32-py38.txt similarity index 100% rename from tests/stubtest_allowlists/win32-py38.txt rename to stdlib/@tests/stubtest_allowlists/win32-py38.txt diff --git a/tests/stubtest_allowlists/win32-py39.txt b/stdlib/@tests/stubtest_allowlists/win32-py39.txt similarity index 100% rename from tests/stubtest_allowlists/win32-py39.txt rename to stdlib/@tests/stubtest_allowlists/win32-py39.txt diff --git a/tests/stubtest_allowlists/win32.txt b/stdlib/@tests/stubtest_allowlists/win32.txt similarity index 100% rename from tests/stubtest_allowlists/win32.txt rename to stdlib/@tests/stubtest_allowlists/win32.txt diff --git a/tests/README.md b/tests/README.md index 8a8cf8083..6503b989b 100644 --- a/tests/README.md +++ b/tests/README.md @@ -137,7 +137,7 @@ on your typeshed fork). As a convenience, stubtest\_stdlib.py will look for local-only allowlist files and use those if they are present. Only version-specific local allowlists are supported. An example local allowlist file is -`tests/stubtest_allowlists/py312.txt.local`. Use caution when taking advantage of this feature; +`stdlib/@tests/stubtest_allowlists/py312.txt.local`. Use caution when taking advantage of this feature; the CI run of stubtest remains canonical. If you need a specific version of Python to repro a CI failure, @@ -145,7 +145,7 @@ If you need a specific version of Python to repro a CI failure, Due to its dynamic nature, you may run into false positives. In this case, you can add to the allowlists for each affected Python version in -`tests/stubtest_allowlists`. Please file issues for stubtest false positives +`stdlib/@tests/stubtest_allowlists`. Please file issues for stubtest false positives at [mypy](https://github.com/python/mypy/issues). ## stubtest\_third\_party.py diff --git a/tests/utils.py b/tests/utils.py index b339dac96..b832533c0 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -163,14 +163,14 @@ def get_all_testcase_directories() -> list[DistributionTests]: def allowlists_path(distribution_name: str) -> Path: if distribution_name == "stdlib": - return Path("tests", "stubtest_allowlists") + return tests_path("stdlib") / "stubtest_allowlists" else: return tests_path(distribution_name) def common_allowlists(distribution_name: str) -> list[str]: if distribution_name == "stdlib": - return ["py3_common.txt", f"{sys.platform}.txt"] + return ["common.txt", f"{sys.platform}.txt"] else: return ["stubtest_allowlist.txt", f"stubtest_allowlist_{sys.platform}.txt"]