Skip to content

Commit bdf906e

Browse files
stubtest_stdlib: fail if there are unused allowlist entries (#6424)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent deaa764 commit bdf906e

File tree

6 files changed

+4
-117
lines changed

6 files changed

+4
-117
lines changed

.github/workflows/stubtest-unused-allowlist.yml

Lines changed: 0 additions & 61 deletions
This file was deleted.

.github/workflows/stubtest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
- name: Install dependencies
3434
run: pip install $(grep tomli== requirements-tests-py3.txt) $(grep mypy== requirements-tests-py3.txt)
3535
- name: Run stubtest
36-
run: python tests/stubtest_stdlib.py --ignore-unused-allowlist
36+
run: python tests/stubtest_stdlib.py
3737

3838
stubtest-third-party:
3939
name: Check third party stubs with stubtest

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ jobs:
109109
- name: Install dependencies
110110
run: pip install $(grep tomli== requirements-tests-py3.txt) $(grep mypy== requirements-tests-py3.txt)
111111
- name: Run stubtest
112-
run: python tests/stubtest_stdlib.py --ignore-unused-allowlist
112+
run: python tests/stubtest_stdlib.py
113113

114114
stubtest-third-party:
115115
name: Check third party stubs with stubtest

tests/stubtest_allowlists/py310.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,6 @@ tkinter.EventType.__new__
124124
_markupbase.ParserBase.error
125125
asyncio.proactor_events._ProactorReadPipeTransport.__init__
126126
distutils.command.bdist_wininst
127-
logging.Formatter.__init__
128-
logging.LoggerAdapter.__init__
129-
logging.PercentStyle.__init__
130127
py_compile.main
131128
pyclbr.Class.__init__
132129
pyclbr.Function.__init__

tests/stubtest_stdlib.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ def run_stubtest(typeshed_dir: Path) -> int:
5757
"\nCommand run was: {}\n".format(" ".join(cmd)),
5858
file=sys.stderr,
5959
)
60-
print("stubtest failed", file=sys.stderr)
60+
print("\n\n", file=sys.stderr)
61+
print(f'To fix "unused allowlist" errors, remove the corresponding entries from {allowlist_dir}', file=sys.stderr)
6162
return e.returncode
6263
else:
6364
print("stubtest succeeded", file=sys.stderr)

tests/stubtest_unused.py

Lines changed: 0 additions & 50 deletions
This file was deleted.

0 commit comments

Comments
 (0)