From a33773182e9dab5d963274eb75ee2d5fd7313398 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 10 Jan 2022 20:21:20 +0000 Subject: [PATCH 1/2] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/mirrors-mypy: v0.930 → v0.931](https://github.com/pre-commit/mirrors-mypy/compare/v0.930...v0.931) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 48d9b106..49eab3fa 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -44,7 +44,7 @@ repos: hooks: - id: setup-cfg-fmt - repo: https://github.com/pre-commit/mirrors-mypy - rev: v0.930 + rev: v0.931 hooks: - id: mypy additional_dependencies: [types-all] From bba6cf4296c7cb9c9ce0234aadf901de5210841f Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Mon, 10 Jan 2022 15:35:33 -0500 Subject: [PATCH 2/2] Revert "work around python/mypy#11852" This reverts commit 83675fe7687def4b5a673fd794c9472c31fe69e4. --- pre_commit/xargs.py | 3 +-- tests/xargs_test.py | 6 ++---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/pre_commit/xargs.py b/pre_commit/xargs.py index 9a397234..6b0fa208 100644 --- a/pre_commit/xargs.py +++ b/pre_commit/xargs.py @@ -159,8 +159,7 @@ def xargs( ) threads = min(len(partitions), target_concurrency) - # https://github.com/python/mypy/issues/11852 - with _thread_mapper(threads) as thread_map: # type: ignore + with _thread_mapper(threads) as thread_map: results = thread_map(run_cmd_partition, partitions) for proc_retcode, proc_out, _ in results: diff --git a/tests/xargs_test.py b/tests/xargs_test.py index 80bcd268..7e83ef59 100644 --- a/tests/xargs_test.py +++ b/tests/xargs_test.py @@ -166,15 +166,13 @@ def test_xargs_concurrency(): def test_thread_mapper_concurrency_uses_threadpoolexecutor_map(): - # https://github.com/python/mypy/issues/11852 - with xargs._thread_mapper(10) as thread_map: # type: ignore + with xargs._thread_mapper(10) as thread_map: _self = thread_map.__self__ # type: ignore assert isinstance(_self, concurrent.futures.ThreadPoolExecutor) def test_thread_mapper_concurrency_uses_regular_map(): - # https://github.com/python/mypy/issues/11852 - with xargs._thread_mapper(1) as thread_map: # type: ignore + with xargs._thread_mapper(1) as thread_map: assert thread_map is map