Skip to content

Commit 20d1254

Browse files
committed
upgrade to mypy 0.790
1 parent 5cc8ccb commit 20d1254

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

cwltool/provenance.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,10 @@
3030
cast,
3131
)
3232

33-
from schema_salad.utils import json_dumps
34-
from typing_extensions import TYPE_CHECKING, TypedDict
35-
3633
import prov.model as provM
3734
from prov.model import PROV, ProvDocument
35+
from schema_salad.utils import json_dumps
36+
from typing_extensions import TYPE_CHECKING, TypedDict
3837

3938
from .loghandler import _logger
4039
from .provenance_constants import (
@@ -78,10 +77,10 @@
7877
pass
7978

8079
if TYPE_CHECKING:
81-
from .command_line_tool import (
80+
from .command_line_tool import ( # pylint: disable=unused-import
8281
CommandLineTool,
8382
ExpressionTool,
84-
) # pylint: disable=unused-import
83+
)
8584
from .workflow import Workflow # pylint: disable=unused-import
8685

8786

@@ -128,8 +127,8 @@ def __init__(self, research_object: "ResearchObject", rel_path: str) -> None:
128127
_logger.debug("[provenance] Creating WritableBagFile at %s.", path)
129128
super(WritableBagFile, self).__init__(path, mode="w")
130129

131-
def write(self, b: Union[bytes, str]) -> int:
132-
real_b = b if isinstance(b, bytes) else b.encode("utf-8")
130+
def write(self, b: Any) -> int:
131+
real_b = b if isinstance(b, (bytes, mmap, array)) else b.encode("utf-8")
133132
total = 0
134133
length = len(real_b)
135134
while total < length:

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ deps =
3939
py{36,37,38,39}-lint: flake8-bugbear
4040
py{36,37,38,39}-lint: black
4141
py{36,37,38,39}-bandit: bandit
42-
py{36,37,38}-mypy: mypy==0.780
42+
py{36,37,38}-mypy: mypy==0.790
4343

4444
setenv =
4545
py{36,37,38,39}-unit: LC_ALL = C

0 commit comments

Comments
 (0)