Merge pull request #2177 from pre-commit/pre-commit-ci-update-config

[pre-commit.ci] pre-commit autoupdate
This commit is contained in:
Anthony Sottile 2021-12-27 19:08:23 -05:00 committed by GitHub
commit 16f68254a8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 5 deletions

View file

@ -1,6 +1,6 @@
repos: repos:
- repo: https://github.com/pre-commit/pre-commit-hooks - repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1 rev: v4.1.0
hooks: hooks:
- id: trailing-whitespace - id: trailing-whitespace
- id: end-of-file-fixer - id: end-of-file-fixer
@ -44,7 +44,7 @@ repos:
hooks: hooks:
- id: setup-cfg-fmt - id: setup-cfg-fmt
- repo: https://github.com/pre-commit/mirrors-mypy - repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.920 rev: v0.930
hooks: hooks:
- id: mypy - id: mypy
additional_dependencies: [types-all] additional_dependencies: [types-all]

View file

@ -159,7 +159,8 @@ def xargs(
) )
threads = min(len(partitions), target_concurrency) threads = min(len(partitions), target_concurrency)
with _thread_mapper(threads) as thread_map: # https://github.com/python/mypy/issues/11852
with _thread_mapper(threads) as thread_map: # type: ignore
results = thread_map(run_cmd_partition, partitions) results = thread_map(run_cmd_partition, partitions)
for proc_retcode, proc_out, _ in results: for proc_retcode, proc_out, _ in results:

View file

@ -166,13 +166,15 @@ def test_xargs_concurrency():
def test_thread_mapper_concurrency_uses_threadpoolexecutor_map(): def test_thread_mapper_concurrency_uses_threadpoolexecutor_map():
with xargs._thread_mapper(10) as thread_map: # https://github.com/python/mypy/issues/11852
with xargs._thread_mapper(10) as thread_map: # type: ignore
_self = thread_map.__self__ # type: ignore _self = thread_map.__self__ # type: ignore
assert isinstance(_self, concurrent.futures.ThreadPoolExecutor) assert isinstance(_self, concurrent.futures.ThreadPoolExecutor)
def test_thread_mapper_concurrency_uses_regular_map(): def test_thread_mapper_concurrency_uses_regular_map():
with xargs._thread_mapper(1) as thread_map: # https://github.com/python/mypy/issues/11852
with xargs._thread_mapper(1) as thread_map: # type: ignore
assert thread_map is map assert thread_map is map