From 5a7790dcd5e0070c040fadf0549825ac668864c3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 25 Mar 2022 12:25:43 +0000 Subject: [PATCH] build(deps-dev): Bump mypy from 0.931 to 0.942 Bumps [mypy](https://github.com/python/mypy) from 0.931 to 0.942. - [Release notes](https://github.com/python/mypy/releases) - [Commits](https://github.com/python/mypy/compare/v0.931...v0.942) --- updated-dependencies: - dependency-name: mypy dependency-type: direct:development update-type: version-update:semver-minor ... Bump mypy from 0.931 to 0.942 after mypy 0.940, it disabled all class scoped imports because it will cause crashes. 1. upgrade mypy from 0.931 to 0.942 2. Solve the error `class scoped import` in mypy 0.942 --- dvc/exceptions.py | 3 +-- dvc/repo/__init__.py | 14 +++++++------- setup.cfg | 2 +- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/dvc/exceptions.py b/dvc/exceptions.py index 435c11fa8..127d46362 100644 --- a/dvc/exceptions.py +++ b/dvc/exceptions.py @@ -1,4 +1,5 @@ """Exceptions raised by the dvc.""" +from dvc.utils import format_link class DvcException(Exception): @@ -287,7 +288,6 @@ class PathMissingError(DvcException): class RemoteCacheRequiredError(DvcException): def __init__(self, scheme, fs_path): - from dvc.utils import format_link super().__init__( ( @@ -323,7 +323,6 @@ class MergeError(DvcException): class CacheLinkError(DvcException): - from dvc.utils import format_link SUPPORT_LINK = "See {} for more information.".format( format_link( diff --git a/dvc/repo/__init__.py b/dvc/repo/__init__.py index fba275f09..bba3ce1b9 100644 --- a/dvc/repo/__init__.py +++ b/dvc/repo/__init__.py @@ -56,17 +56,17 @@ class Repo: from dvc.repo.add import add from dvc.repo.checkout import checkout from dvc.repo.commit import commit - from dvc.repo.destroy import destroy + from dvc.repo.destroy import destroy # type: ignore[misc] from dvc.repo.diff import diff from dvc.repo.fetch import fetch - from dvc.repo.freeze import freeze, unfreeze + from dvc.repo.freeze import freeze, unfreeze # type: ignore[misc] from dvc.repo.gc import gc - from dvc.repo.get import get as _get - from dvc.repo.get_url import get_url as _get_url - from dvc.repo.imp import imp + from dvc.repo.get import get as _get # type: ignore[misc] + from dvc.repo.get_url import get_url as _get_url # type: ignore[misc] + from dvc.repo.imp import imp # type: ignore[misc] from dvc.repo.imp_url import imp_url - from dvc.repo.install import install - from dvc.repo.ls import ls as _ls + from dvc.repo.install import install # type: ignore[misc] + from dvc.repo.ls import ls as _ls # type: ignore[misc] from dvc.repo.move import move from dvc.repo.pull import pull from dvc.repo.push import push diff --git a/setup.cfg b/setup.cfg index 69339ce29..ff7ec2613 100644 --- a/setup.cfg +++ b/setup.cfg @@ -158,7 +158,7 @@ tests = # and, protected method calls in our tests pylint-plugin-utils==0.7 # type-checking - mypy==0.931 + mypy==0.942 types-requests==2.27.15 types-tabulate==0.8.6 types-toml==0.10.4