build(deps): bump mypy from 1.10.1 to 1.11.1 (#10495)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Saugat Pachhai (सौगात) <[email protected]>
This commit is contained in:
dependabot[bot]
2024-08-15 19:59:05 +05:45
committed by GitHub
co-authored by Saugat Pachhai
parent fd3b43df05
commit d494126cc5
4 changed files with 7 additions and 6 deletions
+3 -2
View File
@@ -4,6 +4,7 @@ import hashlib
import os
from abc import ABC, abstractmethod
from datetime import timedelta
from typing import Optional, Union
import flufl.lock
import zc.lockfile
@@ -174,9 +175,9 @@ class HardlinkLock(flufl.lock.Lock, LockBase):
self._owned = True
self._retry_errnos = []
def lock(self):
def lock(self, timeout: Optional[Union[timedelta, int]] = None):
try:
super().lock(timedelta(seconds=DEFAULT_TIMEOUT))
super().lock(timeout or timedelta(seconds=DEFAULT_TIMEOUT))
except flufl.lock.TimeOutError:
raise LockError(FAILED_TO_LOCK_MESSAGE) # noqa: B904
+1 -1
View File
@@ -76,7 +76,7 @@ class SerDe:
return asdict(self, filter=filter_defaults, value_serializer=value_serializer)
@classmethod
def from_dict(cls: type["Self"], d: dict[str, Any]) -> "Self":
def from_dict(cls, d: dict[str, Any]) -> "Self":
_fields = fields(cast("type[AttrsInstance]", cls))
kwargs = {f.name: d[f.name] for f in _fields if f.name in d}
return cls(**kwargs)
+2 -2
View File
@@ -79,13 +79,13 @@ class PathInfo(pathlib.PurePath, _BasePath):
and self._cparts[:n] == other._cparts # type: ignore[attr-defined]
)
def relative_to(self, other):
def relative_to(self, other, *args, **kwargs):
# pathlib relative_to raises exception when one path is not a direct
# descendant of the other when os.path.relpath would return abspath.
# For DVC PathInfo we only need the relpath behavior.
# See: https://bugs.python.org/issue40358
try:
path = super().relative_to(other)
path = super().relative_to(other, *args, **kwargs)
except ValueError:
path = relpath(self, other)
return self.__class__(path)
+1 -1
View File
@@ -83,7 +83,7 @@ gdrive = ["dvc-gdrive>=3,<4"]
gs = ["dvc-gs>=3,<4"]
hdfs = ["dvc-hdfs>=3,<4"]
lint = [
"mypy==1.10.1",
"mypy==1.11.1",
"pandas-stubs",
"types-colorama",
"types-psutil",