Skip to content

Commit

Permalink
Move stdlib allowlists to stdlib/@tests (#11982)
Browse files Browse the repository at this point in the history
Rename py3_common.txt to common.txt
  • Loading branch information
srittau authored May 20, 2024
1 parent 3cb7451 commit e2e3750
Show file tree
Hide file tree
Showing 23 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,4 @@ analyze.py
.python-version

# deliberately local test configuration files
tests/stubtest_allowlists/*.local
stdlib/@tests/stubtest_allowlists/*.local
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,15 +137,15 @@ 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,
[pyenv](https://github.com/pyenv/pyenv) can also help.

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
Expand Down
4 changes: 2 additions & 2 deletions tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]

Expand Down

0 comments on commit e2e3750

Please sign in to comment.