From 620989bac572f30349b95590ebe81a73ce0fe862 Mon Sep 17 00:00:00 2001 From: Shantanu <12621235+hauntsaninja@users.noreply.github.com> Date: Sun, 1 Nov 2020 03:35:21 -0800 Subject: [PATCH] typeshed: update stubtest version (#4739) * typeshed: update stubtest version Includes changes from https://github.com/python/mypy/pull/9680 I've already fixed all the true positives on typeshed. * attempt to fix windows' _WarnFunction Co-authored-by: hauntsaninja <> --- .github/workflows/stubtest-unused-whitelist.yml | 2 +- .github/workflows/tests.yml | 2 +- stdlib/3/asyncio/windows_utils.pyi | 2 +- tests/stubtest_whitelists/py3_common.txt | 2 ++ 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/stubtest-unused-whitelist.yml b/.github/workflows/stubtest-unused-whitelist.yml index f2ca2473d..7a1282c76 100644 --- a/.github/workflows/stubtest-unused-whitelist.yml +++ b/.github/workflows/stubtest-unused-whitelist.yml @@ -24,7 +24,7 @@ jobs: - name: Install dependencies run: | python -m pip install -U pip - pip install -U git+git://github.com/python/mypy@af3c8be98f + pip install -U git+git://github.com/python/mypy@24fdf343 - name: Run stubtest shell: bash run: ./tests/stubtest_unused.py | tee stubtest-output-${{ matrix.os }}-${{ matrix.python-version }} || true diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 203e49fd6..0c16d232f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -101,6 +101,6 @@ jobs: - name: Install dependencies run: | python -m pip install -U pip - pip install -U git+git://github.com/python/mypy@af3c8be98f + pip install -U git+git://github.com/python/mypy@24fdf343 - name: Run stubtest run: python tests/stubtest_test.py --ignore-unused-whitelist diff --git a/stdlib/3/asyncio/windows_utils.pyi b/stdlib/3/asyncio/windows_utils.pyi index 459bb7845..e6009d58e 100644 --- a/stdlib/3/asyncio/windows_utils.pyi +++ b/stdlib/3/asyncio/windows_utils.pyi @@ -3,7 +3,7 @@ from types import TracebackType from typing import Callable, Optional, Protocol, Tuple, Type class _WarnFunction(Protocol): - def __call__(self, message: str, category: Type[Warning], source: PipeHandle) -> None: ... + def __call__(self, message: str, category: Type[Warning] = ..., stacklevel: int = ..., source: PipeHandle = ...) -> None: ... BUFSIZE: int PIPE: int diff --git a/tests/stubtest_whitelists/py3_common.txt b/tests/stubtest_whitelists/py3_common.txt index eabf02a01..fb308b370 100644 --- a/tests/stubtest_whitelists/py3_common.txt +++ b/tests/stubtest_whitelists/py3_common.txt @@ -364,6 +364,7 @@ threading.Thread.__init__ timeit.main tkinter.Misc.grid_propagate tkinter.Misc.pack_propagate +tkinter.Tk.report_callback_exception # A bit of a lie, since it's actually a method, but typing it as an attribute allows it to be assigned to trace.CoverageResults.__init__ traceback.FrameSummary.__init__ traceback.TracebackException.__init__ @@ -380,6 +381,7 @@ typing.AwaitableGenerator typing.IO.__iter__ typing.IO.__next__ typing.type_check_only +unittest.mock.patch # It's a complicated overload and I haven't been able to figure out why stubtest doesn't like it urllib.error.ContentTooShortError.__init__ urllib.error.URLError.__init__ urllib.parse._DefragResultBase.__new__