mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-02 07:18:25 +01:00
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:
co-authored by
Saugat Pachhai
parent
fd3b43df05
commit
d494126cc5
+3
-2
@@ -4,6 +4,7 @@ import hashlib
|
|||||||
import os
|
import os
|
||||||
from abc import ABC, abstractmethod
|
from abc import ABC, abstractmethod
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
|
from typing import Optional, Union
|
||||||
|
|
||||||
import flufl.lock
|
import flufl.lock
|
||||||
import zc.lockfile
|
import zc.lockfile
|
||||||
@@ -174,9 +175,9 @@ class HardlinkLock(flufl.lock.Lock, LockBase):
|
|||||||
self._owned = True
|
self._owned = True
|
||||||
self._retry_errnos = []
|
self._retry_errnos = []
|
||||||
|
|
||||||
def lock(self):
|
def lock(self, timeout: Optional[Union[timedelta, int]] = None):
|
||||||
try:
|
try:
|
||||||
super().lock(timedelta(seconds=DEFAULT_TIMEOUT))
|
super().lock(timeout or timedelta(seconds=DEFAULT_TIMEOUT))
|
||||||
except flufl.lock.TimeOutError:
|
except flufl.lock.TimeOutError:
|
||||||
raise LockError(FAILED_TO_LOCK_MESSAGE) # noqa: B904
|
raise LockError(FAILED_TO_LOCK_MESSAGE) # noqa: B904
|
||||||
|
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ class SerDe:
|
|||||||
return asdict(self, filter=filter_defaults, value_serializer=value_serializer)
|
return asdict(self, filter=filter_defaults, value_serializer=value_serializer)
|
||||||
|
|
||||||
@classmethod
|
@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))
|
_fields = fields(cast("type[AttrsInstance]", cls))
|
||||||
kwargs = {f.name: d[f.name] for f in _fields if f.name in d}
|
kwargs = {f.name: d[f.name] for f in _fields if f.name in d}
|
||||||
return cls(**kwargs)
|
return cls(**kwargs)
|
||||||
|
|||||||
@@ -79,13 +79,13 @@ class PathInfo(pathlib.PurePath, _BasePath):
|
|||||||
and self._cparts[:n] == other._cparts # type: ignore[attr-defined]
|
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
|
# pathlib relative_to raises exception when one path is not a direct
|
||||||
# descendant of the other when os.path.relpath would return abspath.
|
# descendant of the other when os.path.relpath would return abspath.
|
||||||
# For DVC PathInfo we only need the relpath behavior.
|
# For DVC PathInfo we only need the relpath behavior.
|
||||||
# See: https://bugs.python.org/issue40358
|
# See: https://bugs.python.org/issue40358
|
||||||
try:
|
try:
|
||||||
path = super().relative_to(other)
|
path = super().relative_to(other, *args, **kwargs)
|
||||||
except ValueError:
|
except ValueError:
|
||||||
path = relpath(self, other)
|
path = relpath(self, other)
|
||||||
return self.__class__(path)
|
return self.__class__(path)
|
||||||
|
|||||||
+1
-1
@@ -83,7 +83,7 @@ gdrive = ["dvc-gdrive>=3,<4"]
|
|||||||
gs = ["dvc-gs>=3,<4"]
|
gs = ["dvc-gs>=3,<4"]
|
||||||
hdfs = ["dvc-hdfs>=3,<4"]
|
hdfs = ["dvc-hdfs>=3,<4"]
|
||||||
lint = [
|
lint = [
|
||||||
"mypy==1.10.1",
|
"mypy==1.11.1",
|
||||||
"pandas-stubs",
|
"pandas-stubs",
|
||||||
"types-colorama",
|
"types-colorama",
|
||||||
"types-psutil",
|
"types-psutil",
|
||||||
|
|||||||
Reference in New Issue
Block a user