Skip to content

Commit

Permalink
ioPath - fix isort lints
Browse files Browse the repository at this point in the history
Summary: Fixes `isort` lint errors for OSS files and FB files.

Reviewed By: sujitoc

Differential Revision: D27242078

fbshipit-source-id: ab3f3d01eb0d4910e0f66c054663d6bc40774e30
  • Loading branch information
EricZLou authored and facebook-github-bot committed Mar 24, 2021
1 parent 4c0fb27 commit 6247b06
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 25 deletions.
14 changes: 3 additions & 11 deletions iopath/__init__.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,11 @@
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.

from iopath.common import (
LazyPath,
PathManager,
get_cache_dir,
file_lock,
)

from iopath.tabular.tabular_io import (
TabularPathHandler,
TabularUriParser,
)
from iopath.common import LazyPath, PathManager, file_lock, get_cache_dir
from iopath.tabular.tabular_io import TabularPathHandler, TabularUriParser

from .version import __version__


__all__ = [
"LazyPath",
"PathManager",
Expand Down
8 changes: 2 additions & 6 deletions iopath/common/__init__.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.

from iopath.common.file_io import (
LazyPath,
PathManager,
get_cache_dir,
file_lock,
)
from iopath.common.file_io import LazyPath, PathManager, file_lock, get_cache_dir


__all__ = [
"LazyPath",
Expand Down
14 changes: 11 additions & 3 deletions iopath/common/file_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,25 @@
import errno
import logging
import os
import portalocker # type: ignore
import shutil
import tempfile
import traceback
from collections import OrderedDict
from typing import (
Any, Callable, Dict, Iterable, IO, List, MutableMapping, Optional,
Set, Union,
IO,
Any,
Callable,
Dict,
Iterable,
List,
MutableMapping,
Optional,
Set,
Union,
)
from urllib.parse import urlparse

import portalocker # type: ignore
from iopath.common.download import download
from iopath.common.non_blocking_io import NonBlockingIOManager

Expand Down
2 changes: 1 addition & 1 deletion iopath/common/non_blocking_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from dataclasses import dataclass
from queue import Queue
from threading import Thread
from typing import Callable, IO, Optional, Union
from typing import IO, Callable, Optional, Union


"""
Expand Down
1 change: 1 addition & 0 deletions iopath/tabular/tabular_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

from iopath.common.file_io import PathHandler


class TabularUriParser:
def parse_uri(self, uri: str) ->None:
pass
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.

from os import path
import runpy

from setuptools import find_packages, setup


version = runpy.run_path("iopath/version.py")["__version__"]

setup(
Expand Down
2 changes: 1 addition & 1 deletion tests/async_torch_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
import torch
import torch.nn as nn
import torch.optim as optim

from iopath.common.file_io import PathManager


class Model(nn.Module):
def __init__(self):
super(Model, self).__init__()
Expand Down
2 changes: 2 additions & 0 deletions tests/async_writes_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@
import os
import tempfile
import time

from iopath.common.file_io import PathManager


logger = logging.getLogger(__name__)

def printx(str):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_file_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
OneDrivePathHandler,
PathManager,
PathManagerFactory,
get_cache_dir,
g_pathmgr,
get_cache_dir,
)


Expand Down
4 changes: 3 additions & 1 deletion tests/test_non_blocking_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@

from iopath.common.file_io import NativePathHandler, PathManager
from iopath.common.non_blocking_io import (
NonBlockingBufferedIO, NonBlockingIO, NonBlockingIOManager
NonBlockingBufferedIO,
NonBlockingIO,
NonBlockingIOManager,
)


Expand Down

0 comments on commit 6247b06

Please sign in to comment.