Skip to content

Commit

Permalink
dvc: automatically reorder imports
Browse files Browse the repository at this point in the history
  • Loading branch information
efiop committed Nov 5, 2019
1 parent 9af4b96 commit 95fe157
Show file tree
Hide file tree
Showing 191 changed files with 803 additions and 678 deletions.
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,8 @@ repos:
hooks:
- id: flake8
language_version: python3
- repo: https://github.com/asottile/reorder_python_imports
rev: v1.8.0
hooks:
- id: reorder-python-imports
language_version: python3
10 changes: 10 additions & 0 deletions .restyled.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,13 @@ restylers:
- "**/*.py"
interpreters:
- python
- name: reorder-python-imports
image: restyled/restyler-reorder-python-imports:v1.6.0
command:
- reorder-python-imports
- "--exit-zero-even-if-changed"
arguments: []
include:
- "**/*.py"
interpreters:
- python
2 changes: 0 additions & 2 deletions dvc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@
----
Make your data science projects reproducible and shareable.
"""

from __future__ import unicode_literals

import warnings

import dvc.logger

from dvc.version import __version__ # noqa: F401


Expand Down
1 change: 0 additions & 1 deletion dvc/__main__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Main entry point for dvc command line tool."""

from __future__ import unicode_literals

import sys
Expand Down
8 changes: 3 additions & 5 deletions dvc/analytics.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
"""Collect and send usage analytics"""

from __future__ import unicode_literals

from dvc.utils.compat import str

import os
import json
import errno
import json
import logging
import os

from dvc import __version__
from dvc.utils import env2bool
from dvc.utils.compat import str


logger = logging.getLogger(__name__)
Expand Down
2 changes: 1 addition & 1 deletion dvc/api.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from contextlib import contextmanager
import os
from contextlib import contextmanager

try:
from contextlib import _GeneratorContextManager as GCM
Expand Down
4 changes: 2 additions & 2 deletions dvc/cache.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
"""Manages cache of a dvc repo."""

from __future__ import unicode_literals

import os
from collections import defaultdict

from funcy import cached_property

from dvc.utils.compat import builtin_str
from dvc.config import Config
from dvc.utils.compat import builtin_str


class CacheConfig(object):
Expand Down
45 changes: 22 additions & 23 deletions dvc/cli.py
Original file line number Diff line number Diff line change
@@ -1,42 +1,41 @@
"""Command line interface for dvc."""

from __future__ import print_function
from __future__ import unicode_literals

import sys
import argparse
import logging
import sys

from dvc.command.base import fix_subparsers
import dvc.command.init as init
import dvc.command.get as get
import dvc.command.get_url as get_url
import dvc.command.destroy as destroy
import dvc.command.remove as remove
import dvc.command.move as move
import dvc.command.unprotect as unprotect
import dvc.command.run as run
import dvc.command.repro as repro
import dvc.command.add as add
import dvc.command.cache as cache
import dvc.command.checkout as checkout
import dvc.command.commit as commit
import dvc.command.config as config
import dvc.command.daemon as daemon
import dvc.command.data_sync as data_sync
import dvc.command.destroy as destroy
import dvc.command.diff as diff
import dvc.command.gc as gc
import dvc.command.add as add
import dvc.command.get as get
import dvc.command.get_url as get_url
import dvc.command.imp as imp
import dvc.command.imp_url as imp_url
import dvc.command.config as config
import dvc.command.checkout as checkout
import dvc.command.remote as remote
import dvc.command.cache as cache
import dvc.command.metrics as metrics
import dvc.command.init as init
import dvc.command.install as install
import dvc.command.root as root
import dvc.command.lock as lock
import dvc.command.metrics as metrics
import dvc.command.move as move
import dvc.command.pipeline as pipeline
import dvc.command.daemon as daemon
import dvc.command.commit as commit
import dvc.command.remote as remote
import dvc.command.remove as remove
import dvc.command.repro as repro
import dvc.command.root as root
import dvc.command.run as run
import dvc.command.tag as tag
import dvc.command.diff as diff
import dvc.command.version as version
import dvc.command.unprotect as unprotect
import dvc.command.update as update
import dvc.command.version as version
from dvc.command.base import fix_subparsers
from dvc.exceptions import DvcParserError


Expand Down
3 changes: 2 additions & 1 deletion dvc/command/add.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
import argparse
import logging

from dvc.command.base import append_doc_link
from dvc.command.base import CmdBase
from dvc.exceptions import DvcException
from dvc.command.base import CmdBase, append_doc_link
from dvc.exceptions import RecursiveAddingWhileUsingFilename


Expand Down
3 changes: 2 additions & 1 deletion dvc/command/base.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
from __future__ import unicode_literals

import colorama
import logging

import colorama


logger = logging.getLogger(__name__)

Expand Down
5 changes: 3 additions & 2 deletions dvc/command/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

import argparse

from dvc.command.base import fix_subparsers, append_doc_link
from dvc.command.config import CmdConfig
from dvc.cache import CacheConfig
from dvc.command.base import append_doc_link
from dvc.command.base import fix_subparsers
from dvc.command.config import CmdConfig


class CmdCacheDir(CmdConfig):
Expand Down
3 changes: 2 additions & 1 deletion dvc/command/checkout.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

import argparse

from dvc.command.base import CmdBase, append_doc_link
from dvc.command.base import append_doc_link
from dvc.command.base import CmdBase


class CmdCheckout(CmdBase):
Expand Down
3 changes: 2 additions & 1 deletion dvc/command/commit.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
import argparse
import logging

from dvc.command.base import append_doc_link
from dvc.command.base import CmdBase
from dvc.exceptions import DvcException
from dvc.command.base import CmdBase, append_doc_link


logger = logging.getLogger(__name__)
Expand Down
3 changes: 2 additions & 1 deletion dvc/command/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
import argparse
import logging

from dvc.command.base import CmdBaseNoRepo, append_doc_link
from dvc.command.base import append_doc_link
from dvc.command.base import CmdBaseNoRepo
from dvc.config import Config


Expand Down
3 changes: 2 additions & 1 deletion dvc/command/daemon.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from __future__ import unicode_literals

from dvc.command.base import CmdBaseNoRepo, fix_subparsers
from dvc.command.base import CmdBaseNoRepo
from dvc.command.base import fix_subparsers


class CmdDaemonBase(CmdBaseNoRepo):
Expand Down
3 changes: 2 additions & 1 deletion dvc/command/data_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
import argparse
import logging

from dvc.command.base import CmdBase, append_doc_link
from dvc.command.base import append_doc_link
from dvc.command.base import CmdBase
from dvc.exceptions import DvcException


Expand Down
3 changes: 2 additions & 1 deletion dvc/command/destroy.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
import logging

import dvc.prompt as prompt
from dvc.command.base import CmdBase, append_doc_link
from dvc.command.base import append_doc_link
from dvc.command.base import CmdBase
from dvc.exceptions import DvcException


Expand Down
5 changes: 3 additions & 2 deletions dvc/command/diff.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
from __future__ import unicode_literals

import argparse
import logging

import humanize
import inflect
import logging
from funcy import compact

from dvc.command.base import append_doc_link
from dvc.command.base import CmdBase
from dvc.exceptions import DvcException
from dvc.command.base import CmdBase, append_doc_link


logger = logging.getLogger(__name__)
Expand Down
7 changes: 4 additions & 3 deletions dvc/command/gc.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
from __future__ import unicode_literals

import argparse
import os
import dvc.prompt as prompt
import logging
import os

from dvc.command.base import CmdBase, append_doc_link
import dvc.prompt as prompt
from dvc.command.base import append_doc_link
from dvc.command.base import CmdBase


logger = logging.getLogger(__name__)
Expand Down
3 changes: 2 additions & 1 deletion dvc/command/get.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,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__)
Expand Down
3 changes: 2 additions & 1 deletion dvc/command/get_url.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,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__)
Expand Down
3 changes: 2 additions & 1 deletion dvc/command/imp.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
import argparse
import logging

from dvc.command.base import append_doc_link
from dvc.command.base import CmdBase
from dvc.exceptions import DvcException
from dvc.command.base import CmdBase, append_doc_link


logger = logging.getLogger(__name__)
Expand Down
3 changes: 2 additions & 1 deletion dvc/command/imp_url.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
import argparse
import logging

from dvc.command.base import append_doc_link
from dvc.command.base import CmdBase
from dvc.exceptions import DvcException
from dvc.command.base import CmdBase, append_doc_link


logger = logging.getLogger(__name__)
Expand Down
3 changes: 2 additions & 1 deletion dvc/command/init.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
import argparse
import logging

from dvc.command.base import CmdBaseNoRepo, append_doc_link
from dvc.command.base import append_doc_link
from dvc.command.base import CmdBaseNoRepo


logger = logging.getLogger(__name__)
Expand Down
3 changes: 2 additions & 1 deletion dvc/command/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
import argparse
import logging

from dvc.command.base import CmdBase, append_doc_link
from dvc.command.base import append_doc_link
from dvc.command.base import CmdBase


logger = logging.getLogger(__name__)
Expand Down
3 changes: 2 additions & 1 deletion dvc/command/lock.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
import argparse
import logging

from dvc.command.base import append_doc_link
from dvc.command.base import CmdBase
from dvc.exceptions import DvcException
from dvc.command.base import CmdBase, append_doc_link


logger = logging.getLogger(__name__)
Expand Down
7 changes: 5 additions & 2 deletions dvc/command/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@
import argparse
import logging

from dvc.exceptions import DvcException, BadMetricError
from dvc.command.base import CmdBase, fix_subparsers, append_doc_link
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


logger = logging.getLogger(__name__)
Expand Down
3 changes: 2 additions & 1 deletion dvc/command/move.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
import argparse
import logging

from dvc.command.base import append_doc_link
from dvc.command.base import CmdBase
from dvc.exceptions import DvcException
from dvc.command.base import CmdBase, append_doc_link


logger = logging.getLogger(__name__)
Expand Down
9 changes: 5 additions & 4 deletions dvc/command/pipeline.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
from __future__ import unicode_literals

from dvc.utils import relpath
from dvc.utils.compat import str

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 DvcException
from dvc.command.base import CmdBase, fix_subparsers, append_doc_link
from dvc.utils import relpath
from dvc.utils.compat import str


logger = logging.getLogger(__name__)
Expand Down
Loading

0 comments on commit 95fe157

Please sign in to comment.