Skip to content

Commit 27b0ea1

Browse files
dependabot[bot]NicolasT
authored andcommitted
chore(deps-dev): bump mypy from 1.1.1 to 1.4.1
This requires an explicit `cast` of `shutil.copyfileobj` to work-around a typeshed/Mypy issue. Bumps [mypy](https://github.com/python/mypy) from 1.1.1 to 1.4.1. - [Commits](python/mypy@v1.1.1...v1.4.1) --- updated-dependencies: - dependency-name: mypy dependency-type: direct:development update-type: version-update:semver-minor ... See: python/mypy#15031 See: https://github.com/python/mypy/pull/14902/files#diff-363460977156fcfda748f21565484fe1d5862edf2823e9784cbf34d1e52ff2f2 See: python/mypy#14975 Signed-off-by: dependabot[bot] <[email protected]> Signed-off-by: Nicolas Trangez <[email protected]>
1 parent f65cd4c commit 27b0ea1

File tree

3 files changed

+43
-32
lines changed

3 files changed

+43
-32
lines changed

poetry.lock

Lines changed: 29 additions & 29 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ python = "^3.7.15"
5555
importlib-metadata = {version = ">=3.7.3,<5.0.0", python = "< 3.8"}
5656

5757
[tool.poetry.dev-dependencies]
58-
mypy = "^1.1"
58+
mypy = "^1.4"
5959
flake8 = "^3.9.2"
6060
flake8-bandit = "^3.0.0"
6161
flake8-bugbear = "^23.3.12"

tests/conftest.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
"""Global definitions for pytest tests."""
22

3+
import io
34
import shutil
45
import tempfile
56
import uuid
67
from pathlib import Path
7-
from typing import Iterator
8+
from typing import Callable, Iterator, TYPE_CHECKING, cast
89

910
import pytest
1011

@@ -20,6 +21,16 @@ def disk_image(tmp_path: Path) -> Iterator[Path]:
2021
"""Yield the path to a copy of `TESTDATA_DISK`."""
2122
with tempfile.NamedTemporaryFile(dir=tmp_path) as tmp:
2223
with open(TESTDATA_DISK, "rb") as disk:
23-
shutil.copyfileobj(disk, tmp)
24+
if TYPE_CHECKING: # pragma: no cover
25+
copyfileobj = cast(
26+
Callable[
27+
[io.BufferedReader, tempfile._TemporaryFileWrapper[bytes]], None
28+
],
29+
shutil.copyfileobj,
30+
)
31+
else:
32+
copyfileobj = shutil.copyfileobj
33+
34+
copyfileobj(disk, tmp)
2435

2536
yield Path(tmp.name)

0 commit comments

Comments
 (0)