lint: isort pre-commit & misc improvements (#3749)

* test: clean flake8 config root clutter

* test: pre-commit: add isort

Compatible with black (see https://github.com/timothycrosley/isort/issues/694)

* lint: reorder imports

* lint: more complex imports

* lint: fix deepsource

* config: isort: add first party dvc

* tests: restyled: add isort

* temp commit to revert before merge

* Revert "temp commit to revert before merge"

This reverts commit 11db0fd8e95fe891597cbb9bf804480909b19e24.
This commit is contained in:
Casper da Costa-Luis
2020-05-06 23:56:07 +03:00
committed by GitHub
parent e3831066de
commit 2bb7257a06
190 changed files with 452 additions and 525 deletions
-7
View File
@@ -1,7 +0,0 @@
[flake8]
ignore =
E203, # Whitespace before ':'
E266, # Too many leading '#' for block comment
W503, # Line break occurred before a binary operator
max-line-length = 79
select = B,C,E,F,W,T4,B9
+5
View File
@@ -4,6 +4,11 @@ repos:
language_version: python3
repo: https://github.com/ambv/black
rev: 19.10b0
- hooks:
- id: isort
language_version: python3
repo: https://github.com/timothycrosley/isort
rev: 4.3.21
- hooks:
- id: flake8
language_version: python3
+9
View File
@@ -9,3 +9,12 @@ restylers:
- "**/*.py"
interpreters:
- python
- name: isort
image: restyled/restyler-isort:v4.3.21
command:
- isort
arguments: []
include:
- "**/*.py"
interpreters:
- python
-1
View File
@@ -6,5 +6,4 @@ Make your data science projects reproducible and shareable.
import dvc.logger
from dvc.version import __version__ # noqa: F401
dvc.logger.setup()
+1 -2
View File
@@ -2,12 +2,12 @@ import json
import logging
import os
import platform
import requests
import sys
import tempfile
import uuid
import distro
import requests
from dvc import __version__
from dvc.config import Config, to_bool
@@ -20,7 +20,6 @@ from dvc.scm.base import SCMError
from dvc.utils import env2bool, is_binary
from dvc.utils.fs import makedirs
logger = logging.getLogger(__name__)
+3 -2
View File
@@ -1,9 +1,10 @@
import os
from contextlib import contextmanager, _GeneratorContextManager as GCM
from contextlib import _GeneratorContextManager as GCM
from contextlib import contextmanager
from dvc.repo import Repo
from dvc.exceptions import DvcException, NotDvcRepoError
from dvc.external_repo import external_repo
from dvc.repo import Repo
class UrlNotDvcRepoError(DvcException):
+4 -5
View File
@@ -16,16 +16,18 @@ from .command import (
gc,
get,
get_url,
git_hook,
imp,
imp_url,
init,
install,
ls,
lock,
ls,
metrics,
params,
move,
params,
pipeline,
plot,
remote,
remove,
repro,
@@ -34,13 +36,10 @@ from .command import (
unprotect,
update,
version,
git_hook,
plot,
)
from .command.base import fix_subparsers
from .exceptions import DvcParserError
logger = logging.getLogger(__name__)
COMMANDS = [
+1 -1
View File
@@ -1,7 +1,7 @@
import argparse
import logging
from dvc.command.base import append_doc_link, CmdBase
from dvc.command.base import CmdBase, append_doc_link
from dvc.exceptions import DvcException, RecursiveAddingWhileUsingFilename
logger = logging.getLogger(__name__)
-1
View File
@@ -1,6 +1,5 @@
import logging
logger = logging.getLogger(__name__)
+1 -2
View File
@@ -4,8 +4,7 @@ import operator
import colorama
from dvc.command.base import append_doc_link
from dvc.command.base import CmdBase
from dvc.command.base import CmdBase, append_doc_link
from dvc.exceptions import CheckoutError
from dvc.utils.humanize import get_summary
+1 -3
View File
@@ -1,11 +1,9 @@
import argparse
import logging
from dvc.command.base import append_doc_link
from dvc.command.base import CmdBase
from dvc.command.base import CmdBase, append_doc_link
from dvc.exceptions import DvcException
logger = logging.getLogger(__name__)
+1 -1
View File
@@ -1,7 +1,7 @@
import argparse
import logging
from dvc.command.base import append_doc_link, CmdBaseNoRepo
from dvc.command.base import CmdBaseNoRepo, append_doc_link
from dvc.config import Config, ConfigError
logger = logging.getLogger(__name__)
+1 -2
View File
@@ -1,5 +1,4 @@
from dvc.command.base import CmdBaseNoRepo
from dvc.command.base import fix_subparsers
from dvc.command.base import CmdBaseNoRepo, fix_subparsers
class CmdDaemonBase(CmdBaseNoRepo):
+6 -8
View File
@@ -1,12 +1,10 @@
import argparse
import logging
from dvc.command.base import append_doc_link
from dvc.command.base import CmdBase
from dvc.command.base import CmdBase, append_doc_link
from dvc.command.checkout import log_changes
from dvc.exceptions import CheckoutError, DvcException
from dvc.utils.humanize import get_summary
from dvc.exceptions import DvcException, CheckoutError
logger = logging.getLogger(__name__)
@@ -88,24 +86,24 @@ def shared_parent_parser():
from dvc.cli import get_parent_parser
# Parent parser used in pull/push/status
shared_parent_parser = argparse.ArgumentParser(
parent_parser = argparse.ArgumentParser(
add_help=False, parents=[get_parent_parser()]
)
shared_parent_parser.add_argument(
parent_parser.add_argument(
"-j",
"--jobs",
type=int,
help="Number of jobs to run simultaneously.",
metavar="<number>",
)
shared_parent_parser.add_argument(
parent_parser.add_argument(
"targets",
nargs="*",
help="Limit command scope to these DVC-files. "
"Using -R, directories to search DVC-files in can also be given.",
)
return shared_parent_parser
return parent_parser
def add_parser(subparsers, _parent_parser):
+1 -3
View File
@@ -2,11 +2,9 @@ import argparse
import logging
import dvc.prompt as prompt
from dvc.command.base import append_doc_link
from dvc.command.base import CmdBase
from dvc.command.base import CmdBase, append_doc_link
from dvc.exceptions import DvcException
logger = logging.getLogger(__name__)
-1
View File
@@ -8,7 +8,6 @@ import colorama
from dvc.command.base import CmdBase, append_doc_link
from dvc.exceptions import DvcException
logger = logging.getLogger(__name__)
+1 -3
View File
@@ -3,9 +3,7 @@ import logging
import os
import dvc.prompt as prompt
from dvc.command.base import append_doc_link
from dvc.command.base import CmdBase
from dvc.command.base import CmdBase, append_doc_link
logger = logging.getLogger(__name__)
+1 -2
View File
@@ -1,10 +1,9 @@
import argparse
import logging
from .base import append_doc_link
from .base import CmdBaseNoRepo
from dvc.exceptions import DvcException
from .base import CmdBaseNoRepo, append_doc_link
logger = logging.getLogger(__name__)
+1 -2
View File
@@ -1,10 +1,9 @@
import argparse
import logging
from .base import append_doc_link
from .base import CmdBaseNoRepo
from dvc.exceptions import DvcException
from .base import CmdBaseNoRepo, append_doc_link
logger = logging.getLogger(__name__)
+1 -3
View File
@@ -1,11 +1,9 @@
import argparse
import logging
from dvc.command.base import append_doc_link
from dvc.command.base import CmdBase
from dvc.command.base import CmdBase, append_doc_link
from dvc.exceptions import DvcException
logger = logging.getLogger(__name__)
+1 -3
View File
@@ -1,11 +1,9 @@
import argparse
import logging
from dvc.command.base import append_doc_link
from dvc.command.base import CmdBase
from dvc.command.base import CmdBase, append_doc_link
from dvc.exceptions import DvcException
logger = logging.getLogger(__name__)
+1 -3
View File
@@ -1,9 +1,7 @@
import argparse
import logging
from dvc.command.base import append_doc_link
from dvc.command.base import CmdBaseNoRepo
from dvc.command.base import CmdBaseNoRepo, append_doc_link
logger = logging.getLogger(__name__)
+1 -3
View File
@@ -1,9 +1,7 @@
import argparse
import logging
from dvc.command.base import append_doc_link
from dvc.command.base import CmdBase
from dvc.command.base import CmdBase, append_doc_link
logger = logging.getLogger(__name__)
+1 -3
View File
@@ -1,11 +1,9 @@
import argparse
import logging
from dvc.command.base import append_doc_link
from dvc.command.base import CmdBase
from dvc.command.base import CmdBase, append_doc_link
from dvc.exceptions import DvcException
logger = logging.getLogger(__name__)
+1 -3
View File
@@ -2,12 +2,10 @@ import argparse
import logging
import sys
from dvc.command.base import append_doc_link
from dvc.command.base import CmdBaseNoRepo
from dvc.command.base import CmdBaseNoRepo, append_doc_link
from dvc.command.ls.ls_colors import LsColors
from dvc.exceptions import DvcException
logger = logging.getLogger(__name__)
+2 -6
View File
@@ -1,12 +1,8 @@
import argparse
import logging
from dvc.command.base import append_doc_link
from dvc.command.base import CmdBase
from dvc.command.base import fix_subparsers
from dvc.exceptions import BadMetricError
from dvc.exceptions import DvcException
from dvc.command.base import CmdBase, append_doc_link, fix_subparsers
from dvc.exceptions import BadMetricError, DvcException
logger = logging.getLogger(__name__)
+1 -3
View File
@@ -1,11 +1,9 @@
import argparse
import logging
from dvc.command.base import append_doc_link
from dvc.command.base import CmdBase
from dvc.command.base import CmdBase, append_doc_link
from dvc.exceptions import DvcException
logger = logging.getLogger(__name__)
+1 -5
View File
@@ -1,14 +1,10 @@
import argparse
import logging
from collections import OrderedDict
from dvc.command.base import append_doc_link
from dvc.command.base import CmdBase
from dvc.command.base import fix_subparsers
from dvc.command.base import CmdBase, append_doc_link, fix_subparsers
from dvc.exceptions import DvcException
logger = logging.getLogger(__name__)
-1
View File
@@ -4,7 +4,6 @@ import logging
from dvc.command.base import CmdBase, append_doc_link, fix_subparsers
from dvc.exceptions import DvcException
logger = logging.getLogger(__name__)
+1 -1
View File
@@ -2,7 +2,7 @@ import argparse
import logging
import os
from dvc.command.base import append_doc_link, CmdBase, fix_subparsers
from dvc.command.base import CmdBase, append_doc_link, fix_subparsers
from dvc.exceptions import DvcException
from dvc.repo.plot.data import WORKSPACE_REVISION_NAME
+1 -1
View File
@@ -1,9 +1,9 @@
import argparse
import logging
from dvc.config import ConfigError
from dvc.command.base import append_doc_link, fix_subparsers
from dvc.command.config import CmdConfig
from dvc.config import ConfigError
from dvc.utils import format_link
logger = logging.getLogger(__name__)
+1 -3
View File
@@ -2,11 +2,9 @@ import argparse
import logging
import dvc.prompt as prompt
from dvc.command.base import append_doc_link
from dvc.command.base import CmdBase
from dvc.command.base import CmdBase, append_doc_link
from dvc.exceptions import DvcException
logger = logging.getLogger(__name__)
+1 -3
View File
@@ -2,13 +2,11 @@ import argparse
import logging
import os
from dvc.command.base import append_doc_link
from dvc.command.base import CmdBase
from dvc.command.base import CmdBase, append_doc_link
from dvc.command.metrics import show_metrics
from dvc.command.status import CmdDataStatus
from dvc.exceptions import DvcException
logger = logging.getLogger(__name__)
+1 -2
View File
@@ -1,8 +1,7 @@
import argparse
import logging
from dvc.command.base import append_doc_link
from dvc.command.base import CmdBaseNoRepo
from dvc.command.base import CmdBaseNoRepo, append_doc_link
from dvc.utils import relpath
logger = logging.getLogger(__name__)
+1 -3
View File
@@ -1,11 +1,9 @@
import argparse
import logging
from dvc.command.base import append_doc_link
from dvc.command.base import CmdBase
from dvc.command.base import CmdBase, append_doc_link
from dvc.exceptions import DvcException
logger = logging.getLogger(__name__)
-1
View File
@@ -2,7 +2,6 @@ import logging
from dvc.command.data_sync import CmdDataBase
logger = logging.getLogger(__name__)
+1 -3
View File
@@ -1,11 +1,9 @@
import argparse
import logging
from dvc.command.base import append_doc_link
from dvc.command.base import CmdBase
from dvc.command.base import CmdBase, append_doc_link
from dvc.exceptions import DvcException
logger = logging.getLogger(__name__)
+1 -3
View File
@@ -1,11 +1,9 @@
import argparse
import logging
from dvc.command.base import append_doc_link
from dvc.command.base import CmdBase
from dvc.command.base import CmdBase, append_doc_link
from dvc.exceptions import DvcException
logger = logging.getLogger(__name__)
+9 -8
View File
@@ -2,22 +2,23 @@ import argparse
import itertools
import logging
import os
import pathlib
import platform
import uuid
import pathlib
from dvc.command.base import CmdBaseNoRepo, append_doc_link
from dvc.exceptions import DvcException, NotDvcRepoError
from dvc.scm.base import SCMError
from dvc.system import System
from dvc.utils import is_binary, relpath
from dvc.utils.pkg import PKG
from dvc.version import __version__
try:
import psutil
except ImportError:
psutil = None
from dvc.utils import is_binary, relpath
from dvc.command.base import CmdBaseNoRepo, append_doc_link
from dvc.version import __version__
from dvc.exceptions import DvcException, NotDvcRepoError
from dvc.scm.base import SCMError
from dvc.system import System
from dvc.utils.pkg import PKG
logger = logging.getLogger(__name__)
+1 -3
View File
@@ -7,9 +7,7 @@ import sys
from subprocess import Popen
from dvc.env import DVC_DAEMON
from dvc.utils import fix_env
from dvc.utils import is_binary
from dvc.utils import fix_env, is_binary
logger = logging.getLogger(__name__)
+2 -5
View File
@@ -6,12 +6,9 @@ import os
import pydoc
import sys
from grandalf.graphs import Edge
from grandalf.graphs import Graph
from grandalf.graphs import Vertex
from grandalf.graphs import Edge, Graph, Vertex
from grandalf.layouts import SugiyamaLayout
from grandalf.routing import EdgeViewer
from grandalf.routing import route_with_lines
from grandalf.routing import EdgeViewer, route_with_lines
from dvc.env import DVC_PAGER
from dvc.utils import format_link
-1
View File
@@ -5,7 +5,6 @@ import logging
from dvc.config import NoRemoteError
from dvc.remote import Remote
logger = logging.getLogger(__name__)
+3 -3
View File
@@ -1,5 +1,5 @@
from urllib.parse import urlparse
from collections import defaultdict
from urllib.parse import urlparse
import dvc.output as output
from dvc.dependency.gs import GSDependency
@@ -7,14 +7,14 @@ from dvc.dependency.hdfs import HDFSDependency
from dvc.dependency.http import HTTPDependency
from dvc.dependency.https import HTTPSDependency
from dvc.dependency.local import LocalDependency
from dvc.dependency.param import ParamsDependency
from dvc.dependency.s3 import S3Dependency
from dvc.dependency.ssh import SSHDependency
from dvc.dependency.param import ParamsDependency
from dvc.output.base import BaseOutput
from dvc.remote import Remote
from dvc.scheme import Schemes
from .repo import RepoDependency
from .repo import RepoDependency
DEPS = [
GSDependency,
+2 -1
View File
@@ -1,6 +1,7 @@
from .http import HTTPDependency
from dvc.remote.https import HTTPSRemote
from .http import HTTPDependency
class HTTPSDependency(HTTPDependency):
REMOTE = HTTPSRemote
+1 -1
View File
@@ -1,8 +1,8 @@
import os
import yaml
from collections import defaultdict
import dpath.util
import yaml
from voluptuous import Any
from dvc.compat import fspath_py35
+2 -1
View File
@@ -2,10 +2,11 @@ import os
from voluptuous import Required
from .local import LocalDependency
from dvc.exceptions import OutputNotFoundError
from dvc.path_info import PathInfo
from .local import LocalDependency
class RepoDependency(LocalDependency):
PARAM_REPO = "repo"
+6 -6
View File
@@ -1,20 +1,20 @@
import contextlib
import os
import logging
import dvc.prompt as prompt
import os
from voluptuous import MultipleInvalid
import dvc.prompt as prompt
from dvc import serialize
from dvc.exceptions import DvcException
from dvc.stage.loader import SingleStageLoader, StageLoader
from dvc.stage.exceptions import (
StageFileAlreadyExistsError,
StageFileBadNameError,
StageFileDoesNotExistError,
StageFileIsNotDvcFileError,
StageFileFormatError,
StageFileAlreadyExistsError,
StageFileIsNotDvcFileError,
)
from dvc.stage.loader import SingleStageLoader, StageLoader
from dvc.utils import relpath
from dvc.utils.collections import apply_diff
from dvc.utils.stage import (
+1 -1
View File
@@ -1,7 +1,7 @@
"""Exceptions raised by the dvc."""
from funcy import first
from dvc.utils import relpath, format_link
from dvc.utils import format_link, relpath
class DvcException(Exception):
+14 -10
View File
@@ -1,23 +1,27 @@
import logging
import os
import tempfile
import threading
from contextlib import contextmanager
from distutils.dir_util import copy_tree
import threading
from funcy import retry, suppress, wrap_with, cached_property
from funcy import cached_property, retry, suppress, wrap_with
from dvc.path_info import PathInfo
from dvc.compat import fspath
from dvc.repo import Repo
from dvc.config import NoRemoteError, NotDvcRepoError
from dvc.exceptions import NoRemoteInExternalRepoError, CheckoutError
from dvc.exceptions import OutputNotFoundError, NoOutputInExternalRepoError
from dvc.exceptions import FileMissingError, PathMissingError
from dvc.utils.fs import remove, fs_copy, move
from dvc.utils import tmp_fname
from dvc.exceptions import (
CheckoutError,
FileMissingError,
NoOutputInExternalRepoError,
NoRemoteInExternalRepoError,
OutputNotFoundError,
PathMissingError,
)
from dvc.path_info import PathInfo
from dvc.repo import Repo
from dvc.scm.git import Git
from dvc.utils import tmp_fname
from dvc.utils.fs import fs_copy, move, remove
logger = logging.getLogger(__name__)
+2 -2
View File
@@ -5,12 +5,12 @@ import os
import time
from datetime import timedelta
import zc.lockfile
import flufl.lock
import zc.lockfile
from dvc.exceptions import DvcException
from dvc.utils import format_link
from dvc.progress import Tqdm
from dvc.utils import format_link
DEFAULT_TIMEOUT = 5
-1
View File
@@ -7,7 +7,6 @@ import colorama
from dvc.progress import Tqdm
FOOTER = (
"\n{yellow}Having any troubles?{nc}"
" Hit us up at {blue}https://dvc.org/support{nc},"
+3 -4
View File
@@ -6,12 +6,11 @@ import logging
from dvc import analytics
from dvc.cli import parse_args
from dvc.config import ConfigError
from dvc.exceptions import DvcParserError, DvcException
from dvc.exceptions import NotDvcRepoError
from dvc.exceptions import DvcException, DvcParserError, NotDvcRepoError
from dvc.external_repo import clean_repos
from dvc.logger import disable_other_loggers, FOOTER
from dvc.utils import format_link
from dvc.logger import FOOTER, disable_other_loggers
from dvc.remote.pool import close_pools
from dvc.utils import format_link
# Workaround for CPython bug. See [1] and [2] for more info.
# [1] https://github.com/aws/aws-cli/blob/1.16.277/awscli/clidriver.py#L55
+2 -1
View File
@@ -1,5 +1,6 @@
from urllib.parse import urlparse
from voluptuous import Any, Required, Lower, Length, Coerce, And, SetTo
from voluptuous import And, Any, Coerce, Length, Lower, Required, SetTo
from dvc.output.base import BaseOutput
from dvc.output.gs import GSOutput
+6 -4
View File
@@ -1,17 +1,19 @@
import logging
import os
from urllib.parse import urlparse
from copy import copy
from urllib.parse import urlparse
from voluptuous import Any
import dvc.prompt as prompt
from dvc.cache import NamedCache
from dvc.exceptions import CollectCacheError, RemoteCacheRequiredError
from dvc.exceptions import DvcException
from dvc.exceptions import (
CollectCacheError,
DvcException,
RemoteCacheRequiredError,
)
from dvc.remote.base import BaseRemote
logger = logging.getLogger(__name__)
+1 -2
View File
@@ -2,15 +2,14 @@ import logging
import os
from urllib.parse import urlparse
from dvc.compat import fspath_py35
from dvc.exceptions import DvcException
from dvc.istextfile import istextfile
from dvc.output.base import BaseOutput
from dvc.remote.local import LocalRemote
from dvc.utils import relpath
from dvc.compat import fspath_py35
from dvc.utils.fs import path_isin
logger = logging.getLogger(__name__)
+1 -1
View File
@@ -1,6 +1,6 @@
import os
import posixpath
import pathlib
import posixpath
from urllib.parse import urlparse
from funcy import cached_property
-1
View File
@@ -12,7 +12,6 @@ from dvc.remote.oss import OSSRemote
from dvc.remote.s3 import S3Remote
from dvc.remote.ssh import SSHRemote
REMOTES = [
AzureRemote,
GDriveRemote,
+1 -2
View File
@@ -2,9 +2,9 @@ import logging
import os
import posixpath
import re
import threading
from datetime import datetime, timedelta
from urllib.parse import urlparse
import threading
from funcy import cached_property, wrap_prop
@@ -13,7 +13,6 @@ from dvc.progress import Tqdm
from dvc.remote.base import BaseRemote
from dvc.scheme import Schemes
logger = logging.getLogger(__name__)
+3 -3
View File
@@ -4,20 +4,20 @@ import itertools
import json
import logging
import tempfile
from urllib.parse import urlparse
from concurrent.futures import ThreadPoolExecutor
from copy import copy
from functools import partial, wraps
from multiprocessing import cpu_count
from operator import itemgetter
from urllib.parse import urlparse
from shortuuid import uuid
import dvc.prompt as prompt
from dvc.exceptions import (
CheckoutError,
DvcException,
ConfirmRemoveError,
DvcException,
DvcIgnoreInCollectedDirError,
RemoteCacheRequiredError,
)
@@ -28,7 +28,7 @@ from dvc.remote.index import RemoteIndex, RemoteIndexNoop
from dvc.remote.slow_link_detection import slow_link_guard
from dvc.state import StateNoop
from dvc.utils import tmp_fname
from dvc.utils.fs import move, makedirs
from dvc.utils.fs import makedirs, move
from dvc.utils.http import open_url
logger = logging.getLogger(__name__)
+8 -8
View File
@@ -1,20 +1,20 @@
from collections import defaultdict
import logging
import os
import posixpath
import logging
import re
import threading
from collections import defaultdict
from urllib.parse import urlparse
from funcy import retry, wrap_with, wrap_prop, cached_property
from funcy import cached_property, retry, wrap_prop, wrap_with
from funcy.py3 import cat
from dvc.progress import Tqdm
from dvc.scheme import Schemes
from dvc.path_info import CloudURLInfo
from dvc.remote.base import BaseRemote
from dvc.exceptions import DvcException
from dvc.utils import tmp_fname, format_link
from dvc.path_info import CloudURLInfo
from dvc.progress import Tqdm
from dvc.remote.base import BaseRemote
from dvc.scheme import Schemes
from dvc.utils import format_link, tmp_fname
logger = logging.getLogger(__name__)
FOLDER_MIME_TYPE = "application/vnd.google-apps.folder"
+3 -3
View File
@@ -1,10 +1,10 @@
import logging
from datetime import timedelta
from functools import wraps
import io
import logging
import os.path
import posixpath
import threading
from datetime import timedelta
from functools import wraps
from funcy import cached_property, wrap_prop
+3 -2
View File
@@ -8,11 +8,12 @@ from collections import deque
from contextlib import closing, contextmanager
from urllib.parse import urlparse
from .base import BaseRemote, RemoteCmdError
from .pool import get_connection
from dvc.scheme import Schemes
from dvc.utils import fix_env, tmp_fname
from .base import BaseRemote, RemoteCmdError
from .pool import get_connection
logger = logging.getLogger(__name__)
+1 -1
View File
@@ -4,9 +4,9 @@ import threading
from funcy import cached_property, memoize, wrap_prop, wrap_with
from dvc.path_info import HTTPURLInfo
import dvc.prompt as prompt
from dvc.exceptions import DvcException, HTTPError
from dvc.path_info import HTTPURLInfo
from dvc.progress import Tqdm
from dvc.remote.base import BaseRemote
from dvc.scheme import Schemes
+2 -1
View File
@@ -1,6 +1,7 @@
from .http import HTTPRemote
from dvc.scheme import Schemes
from .http import HTTPRemote
class HTTPSRemote(HTTPRemote):
scheme = Schemes.HTTPS
+6 -7
View File
@@ -2,31 +2,30 @@ import errno
import logging
import os
import stat
from concurrent.futures import as_completed, ThreadPoolExecutor
from concurrent.futures import ThreadPoolExecutor, as_completed
from functools import partial
from funcy import cached_property, concat
from shortuuid import uuid
from dvc.compat import fspath_py35
from dvc.exceptions import DvcException, DownloadError, UploadError
from dvc.exceptions import DownloadError, DvcException, UploadError
from dvc.path_info import PathInfo
from dvc.progress import Tqdm
from dvc.remote.base import (
index_locked,
BaseRemote,
STATUS_MAP,
STATUS_DELETED,
STATUS_MAP,
STATUS_MISSING,
STATUS_NEW,
BaseRemote,
index_locked,
)
from dvc.remote.index import RemoteIndexNoop
from dvc.scheme import Schemes
from dvc.scm.tree import is_working_tree
from dvc.system import System
from dvc.utils import file_md5, relpath, tmp_fname
from dvc.utils.fs import copyfile, move, makedirs, remove, walk_files
from dvc.utils.fs import copyfile, makedirs, move, remove, walk_files
logger = logging.getLogger(__name__)
-1
View File
@@ -10,7 +10,6 @@ from dvc.progress import Tqdm
from dvc.remote.base import BaseRemote
from dvc.scheme import Schemes
logger = logging.getLogger(__name__)
+1 -1
View File
@@ -1,6 +1,6 @@
import threading
from collections import deque
from contextlib import contextmanager
import threading
from funcy import memoize, wrap_with
+1 -2
View File
@@ -8,8 +8,7 @@ import threading
from funcy import cached_property, wrap_prop
from dvc.config import ConfigError
from dvc.exceptions import DvcException
from dvc.exceptions import ETagMismatchError
from dvc.exceptions import DvcException, ETagMismatchError
from dvc.path_info import CloudURLInfo
from dvc.progress import Tqdm
from dvc.remote.base import BaseRemote
+1 -2
View File
@@ -1,10 +1,9 @@
import logging
import sys
import time
from functools import wraps
import colorama
import colorama
logger = logging.getLogger(__name__)
this = sys.modules[__name__]
+1 -1
View File
@@ -10,7 +10,7 @@ from concurrent.futures import ThreadPoolExecutor
from contextlib import closing, contextmanager
from urllib.parse import urlparse
from funcy import memoize, wrap_with, silent, first
from funcy import first, memoize, silent, wrap_with
import dvc.prompt as prompt
from dvc.progress import Tqdm
+5 -5
View File
@@ -7,16 +7,16 @@ from contextlib import suppress
from funcy import cached_property
from dvc.exceptions import DvcException
from dvc.progress import Tqdm
from dvc.remote.base import RemoteCmdError
from dvc.utils import tmp_fname
try:
import paramiko
except ImportError:
paramiko = None
from dvc.utils import tmp_fname
from dvc.progress import Tqdm
from dvc.exceptions import DvcException
from dvc.remote.base import RemoteCmdError
logger = logging.getLogger(__name__)
+4 -4
View File
@@ -3,11 +3,9 @@ import os
from contextlib import contextmanager
from functools import wraps
from dvc.ignore import CleanTree
from dvc.compat import fspath_py35
from funcy import cached_property, cat, first
from dvc.compat import fspath_py35
from dvc.config import Config
from dvc.exceptions import (
FileMissingError,
@@ -15,11 +13,13 @@ from dvc.exceptions import (
NotDvcRepoError,
OutputNotFoundError,
)
from dvc.ignore import CleanTree
from dvc.path_info import PathInfo
from dvc.remote.base import RemoteActionNotImplemented
from dvc.utils.fs import path_isin
from .graph import check_acyclic, get_pipeline, get_pipelines
from ..utils import parse_target
from .graph import check_acyclic, get_pipeline, get_pipelines
def locked(f):
+4 -3
View File
@@ -3,17 +3,18 @@ import os
import colorama
from . import locked
from dvc.dvcfile import Dvcfile, is_dvc_file
from ..exceptions import (
RecursiveAddingWhileUsingFilename,
OverlappingOutputPathsError,
OutputDuplicationError,
OverlappingOutputPathsError,
RecursiveAddingWhileUsingFilename,
)
from ..output.base import OutputDoesNotExistError
from ..progress import Tqdm
from ..repo.scm_context import scm_context
from ..utils import LARGE_DIR_SIZE, resolve_paths
from . import locked
logger = logging.getLogger(__name__)
+2 -1
View File
@@ -1,6 +1,7 @@
from . import locked
from dvc.dvcfile import Dvcfile
from . import locked
@locked
def commit(self, target, with_deps=False, recursive=False, force=False):
+1
View File
@@ -1,4 +1,5 @@
from dvc.utils.fs import remove
from . import locked
+1 -1
View File
@@ -3,8 +3,8 @@ import logging
from dvc.cache import NamedCache
from dvc.config import NoRemoteError
from dvc.exceptions import DownloadError, OutputNotFoundError
from dvc.scm.base import CloneError
from dvc.path_info import PathInfo
from dvc.scm.base import CloneError
logger = logging.getLogger(__name__)
+1 -1
View File
@@ -1,9 +1,9 @@
import logging
from . import locked
from dvc.cache import NamedCache
from dvc.exceptions import InvalidArgumentError
from . import locked
logger = logging.getLogger(__name__)
+1 -1
View File
@@ -4,9 +4,9 @@ import os
import shortuuid
from dvc.exceptions import DvcException
from dvc.path_info import PathInfo
from dvc.utils import resolve_output
from dvc.utils.fs import remove
from dvc.path_info import PathInfo
logger = logging.getLogger(__name__)
+3 -2
View File
@@ -1,10 +1,11 @@
import os
from . import locked as locked_repo
from dvc.repo.scm_context import scm_context
from dvc.utils import resolve_output, resolve_paths, relpath
from dvc.utils import relpath, resolve_output, resolve_paths
from dvc.utils.fs import path_isin
from ..exceptions import OutputDuplicationError
from . import locked as locked_repo
@locked_repo
+1 -2
View File
@@ -9,8 +9,7 @@ from dvc.exceptions import InitError, InvalidArgumentError
from dvc.repo import Repo
from dvc.scm import SCM
from dvc.scm.base import SCMError
from dvc.utils import boxify
from dvc.utils import relpath
from dvc.utils import boxify, relpath
from dvc.utils.fs import remove
logger = logging.getLogger(__name__)
+1 -1
View File
@@ -1,5 +1,5 @@
from dvc.path_info import PathInfo
from dvc.exceptions import PathMissingError
from dvc.path_info import PathInfo
@staticmethod
+2 -1
View File
@@ -1,5 +1,6 @@
from dvc.utils.diff import format_dict, diff as _diff
from dvc.exceptions import NoMetricsError
from dvc.utils.diff import diff as _diff
from dvc.utils.diff import format_dict
def _get_metrics(repo, *args, rev=None, **kwargs):
+3 -3
View File
@@ -1,14 +1,14 @@
import yaml
import logging
import os
from dvc.path_info import PathInfo
import yaml
from dvc.compat import fspath_py35
from dvc.exceptions import NoMetricsError
from dvc.path_info import PathInfo
from dvc.repo import locked
from dvc.repo.tree import RepoTree
logger = logging.getLogger(__name__)
+2 -1
View File
@@ -1,9 +1,10 @@
import os
from . import locked
from dvc.exceptions import MoveNotDataSourceError
from dvc.repo.scm_context import scm_context
from . import locked
def _expand_target_path(from_path, to_path):
if os.path.isdir(to_path):
+3 -1
View File
@@ -1,4 +1,6 @@
from dvc.utils.diff import format_dict, diff as _diff
from dvc.utils.diff import diff as _diff
from dvc.utils.diff import format_dict
from .show import NoParamsError
+6 -6
View File
@@ -1,12 +1,12 @@
import yaml
import logging
from dvc.repo import locked
from dvc.path_info import PathInfo
from dvc.compat import fspath_py35
from dvc.exceptions import DvcException
from dvc.dependency.param import ParamsDependency
import yaml
from dvc.compat import fspath_py35
from dvc.dependency.param import ParamsDependency
from dvc.exceptions import DvcException
from dvc.path_info import PathInfo
from dvc.repo import locked
logger = logging.getLogger(__name__)
+2 -2
View File
@@ -4,9 +4,9 @@ import os
from funcy import first, last
from dvc.exceptions import DvcException
from dvc.repo.plot.data import PlotData
from dvc.repo.plot.template import Template, NoDataForTemplateError
from dvc.repo import locked
from dvc.repo.plot.data import PlotData
from dvc.repo.plot.template import NoDataForTemplateError, Template
logger = logging.getLogger(__name__)
-1
View File
@@ -12,7 +12,6 @@ from yaml import SafeLoader
from dvc.exceptions import DvcException, PathMissingError
logger = logging.getLogger(__name__)
WORKSPACE_REVISION_NAME = "workspace"
-1
View File
@@ -8,7 +8,6 @@ from funcy import cached_property
from dvc.exceptions import DvcException
from dvc.utils.fs import makedirs
logger = logging.getLogger(__name__)
-1
View File
@@ -2,7 +2,6 @@ import logging
from dvc.repo import locked
logger = logging.getLogger(__name__)
+1 -1
View File
@@ -1,7 +1,7 @@
import logging
from . import locked
from ..utils import parse_target
from . import locked
logger = logging.getLogger(__name__)
+2 -2
View File
@@ -1,11 +1,11 @@
import logging
from dvc.exceptions import ReproductionError, InvalidArgumentError
from dvc.exceptions import InvalidArgumentError, ReproductionError
from dvc.repo.scm_context import scm_context
from . import locked
from .graph import get_pipeline, get_pipelines
logger = logging.getLogger(__name__)
+4 -4
View File
@@ -1,13 +1,13 @@
import os
from . import locked
from .scm_context import scm_context
from funcy import concat, first
from dvc.exceptions import InvalidArgumentError
from dvc.stage.exceptions import DuplicateStageName, InvalidStageName
from funcy import first, concat
from ..exceptions import OutputDuplicationError
from . import locked
from .scm_context import scm_context
def is_valid_name(name: str):
+1 -1
View File
@@ -4,8 +4,8 @@ from itertools import compress
from funcy.py3 import cat
from dvc.exceptions import InvalidArgumentError
from . import locked
from . import locked
logger = logging.getLogger(__name__)
+3 -3
View File
@@ -1,9 +1,9 @@
import os
import errno
import os
from dvc.scm.tree import BaseTree, WorkingTree
from dvc.path_info import PathInfo
from dvc.exceptions import OutputNotFoundError
from dvc.path_info import PathInfo
from dvc.scm.tree import BaseTree, WorkingTree
class DvcTree(BaseTree):
+2 -3
View File
@@ -1,10 +1,9 @@
import os
import json
import os
from collections import defaultdict
from contextlib import contextmanager
from voluptuous import Schema, Invalid, Required, Optional
from voluptuous import Invalid, Optional, Required, Schema
from .exceptions import DvcException
from .lock import LockError
+4 -5
View File
@@ -1,9 +1,8 @@
from dvc.stage.params import StageParams, OutputParams
from dvc.output import CHECKSUMS_SCHEMA
from voluptuous import Any, Optional, Required, Schema
from dvc import dependency, output
from voluptuous import Any, Schema, Optional, Required
from dvc.output import CHECKSUMS_SCHEMA
from dvc.stage.params import OutputParams, StageParams
STAGES = "stages"
SINGLE_STAGE_SCHEMA = {
+8 -3
View File
@@ -2,16 +2,21 @@
import logging
import os
import yaml
import shlex
import yaml
from funcy import cached_property
from pathspec.patterns import GitWildMatchPattern
from dvc.exceptions import GitHookAlreadyExistsError
from dvc.progress import Tqdm
from dvc.scm.base import Base
from dvc.scm.base import CloneError, FileNotInRepoError, RevError, SCMError
from dvc.scm.base import (
Base,
CloneError,
FileNotInRepoError,
RevError,
SCMError,
)
from dvc.scm.git.tree import GitTree
from dvc.utils import fix_env, is_binary, relpath
from dvc.utils.fs import path_isin
+1 -2
View File
@@ -1,12 +1,11 @@
import io
import errno
import io
import os
from dvc.exceptions import DvcException
from dvc.scm.tree import BaseTree
from dvc.utils import relpath
# see git-fast-import(1)
GIT_MODE_DIR = 0o40000
GIT_MODE_FILE = 0o644
+2 -3
View File
@@ -1,14 +1,13 @@
from collections import OrderedDict
from functools import partial
from operator import attrgetter
from typing import TYPE_CHECKING
from typing import TYPE_CHECKING, List
from funcy import rpartial, lsplit
from funcy import lsplit, rpartial
from dvc.dependency import ParamsDependency
from dvc.utils.collections import apply_diff
from dvc.utils.stage import parse_stage_for_update
from typing import List
if TYPE_CHECKING:
from dvc.stage import PipelineStage, Stage

Some files were not shown because too many files have changed in this diff Show More