Skip to content
This repository was archived by the owner on Dec 16, 2022. It is now read-only.

Commit 2b2d141

Browse files
Bump mypy from 0.770 to 0.780 (#4316)
* Bump mypy from 0.770 to 0.780 Bumps [mypy](https://github.com/python/mypy) from 0.770 to 0.780. - [Release notes](https://github.com/python/mypy/releases) - [Commits](python/mypy@v0.770...v0.780) Signed-off-by: dependabot-preview[bot] <[email protected]> * mypy upgrade work-arounds Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> Co-authored-by: epwalsh <[email protected]>
1 parent a038c01 commit 2b2d141

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

allennlp/common/file_utils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ def get_from_cache(url: str, cache_dir: str = None) -> str:
321321

322322
logger.info("copying %s to cache at %s", temp_file.name, cache_path)
323323
with open(cache_path, "wb") as cache_file:
324-
shutil.copyfileobj(temp_file, cache_file)
324+
shutil.copyfileobj(temp_file, cache_file) # type: ignore
325325

326326
logger.info("creating metadata file for %s", cache_path)
327327
meta = {"url": url, "etag": etag}

allennlp/modules/token_embedders/embedding.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import tarfile
66
import warnings
77
import zipfile
8-
from typing import Any, cast, IO, Iterator, NamedTuple, Optional, Sequence, Tuple
8+
from typing import Any, cast, Iterator, NamedTuple, Optional, Sequence, Tuple, BinaryIO
99

1010
import numpy
1111
import torch
@@ -590,7 +590,7 @@ def _open_inside_zip(self, archive_path: str, member_path: Optional[str] = None)
590590
members_list = archive.namelist()
591591
member_path = self._get_the_only_file_in_the_archive(members_list, archive_path)
592592
member_path = cast(str, member_path)
593-
member_file = archive.open(member_path, "r")
593+
member_file = cast(BinaryIO, archive.open(member_path, "r"))
594594
self._handle = io.TextIOWrapper(member_file, encoding=self._encoding)
595595
self._archive_handle = archive
596596

@@ -602,7 +602,7 @@ def _open_inside_tar(self, archive_path: str, member_path: Optional[str] = None)
602602
member_path = self._get_the_only_file_in_the_archive(members_list, archive_path)
603603
member_path = cast(str, member_path)
604604
member = archive.getmember(member_path) # raises exception if not present
605-
member_file = cast(IO[bytes], archive.extractfile(member))
605+
member_file = cast(BinaryIO, archive.extractfile(member))
606606
self._handle = io.TextIOWrapper(member_file, encoding=self._encoding)
607607
self._archive_handle = archive
608608

dev-requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
flake8
55

66
# Static type checking
7-
mypy==0.770
7+
mypy==0.780
88

99
# Automatic code formatting
1010
black

0 commit comments

Comments
 (0)