Skip to content

Commit

Permalink
build(deps): bump mypy from 1.10.1 to 1.11.1 (#10495)
Browse files Browse the repository at this point in the history
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Saugat Pachhai (सौगात) <[email protected]>
  • Loading branch information
dependabot[bot] and skshetry authored Aug 15, 2024
1 parent fd3b43d commit d494126
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
5 changes: 3 additions & 2 deletions dvc/lock.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import os
from abc import ABC, abstractmethod
from datetime import timedelta
from typing import Optional, Union

import flufl.lock
import zc.lockfile
Expand Down Expand Up @@ -174,9 +175,9 @@ def __init__(self, lockfile, tmp_dir=None, **kwargs):
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

Expand Down
2 changes: 1 addition & 1 deletion dvc/repo/datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def value_serializer(_inst, _field, v):
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)
Expand Down
4 changes: 2 additions & 2 deletions dvc/testing/path_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,13 @@ def isin(self, other):
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)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit d494126

Please sign in to comment.