Skip to content

Commit 3b87dde

Browse files
committed
Make imports consistent with isort
1 parent 2ed7787 commit 3b87dde

18 files changed

+50
-28
lines changed

diskcache/__init__.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,28 @@
77
"""
88

99
from .core import (
10+
DEFAULT_SETTINGS,
11+
ENOVAL,
12+
EVICTION_POLICY,
13+
UNKNOWN,
1014
Cache,
1115
Disk,
1216
EmptyDirWarning,
1317
JSONDisk,
14-
UnknownFileWarning,
1518
Timeout,
19+
UnknownFileWarning,
1620
)
17-
from .core import DEFAULT_SETTINGS, ENOVAL, EVICTION_POLICY, UNKNOWN
1821
from .fanout import FanoutCache
1922
from .persistent import Deque, Index
20-
from .recipes import Averager, BoundedSemaphore, Lock, RLock
21-
from .recipes import barrier, memoize_stampede, throttle
23+
from .recipes import (
24+
Averager,
25+
BoundedSemaphore,
26+
Lock,
27+
RLock,
28+
barrier,
29+
memoize_stampede,
30+
throttle,
31+
)
2232

2333
__all__ = [
2434
'Averager',

diskcache/djangocache.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"Django-compatible disk and file backed cache."
22

33
from functools import wraps
4+
45
from django.core.cache.backends.base import BaseCache
56

67
try:

diskcache/fanout.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import tempfile
1010
import time
1111

12-
from .core import ENOVAL, DEFAULT_SETTINGS, Cache, Disk, Timeout
12+
from .core import DEFAULT_SETTINGS, ENOVAL, Cache, Disk, Timeout
1313
from .persistent import Deque, Index
1414

1515

diskcache/persistent.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,18 @@
33
"""
44

55
import operator as op
6-
76
from collections import OrderedDict
8-
from collections.abc import MutableMapping, Sequence
9-
from collections.abc import KeysView, ValuesView, ItemsView
7+
from collections.abc import (
8+
ItemsView,
9+
KeysView,
10+
MutableMapping,
11+
Sequence,
12+
ValuesView,
13+
)
1014
from contextlib import contextmanager
1115
from shutil import rmtree
1216

13-
from .core import Cache, ENOVAL
17+
from .core import ENOVAL, Cache
1418

1519

1620
def _make_compare(seq_op, doc):

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from io import open
2+
23
from setuptools import setup
34
from setuptools.command.test import test as TestCommand
45

tests/benchmark_kv_store.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
55
"""
66

7-
import diskcache
8-
97
from IPython import get_ipython
108

9+
import diskcache
10+
1111
ipython = get_ipython()
1212
assert ipython is not None, 'No IPython! Run with $ ipython ...'
1313

tests/issue_109.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"""
44

55
import time
6+
67
import diskcache as dc
78

89

tests/issue_85.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,15 @@
66
"""
77

88
import collections
9-
import django
109
import os
1110
import random
1211
import shutil
1312
import sqlite3
1413
import threading
1514
import time
1615

16+
import django
17+
1718

1819
def remove_cache_dir():
1920
print('REMOVING CACHE DIRECTORY')

tests/plot.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@
77

88
import argparse
99
import collections as co
10-
import matplotlib.pyplot as plt
1110
import re
1211
import sys
1312

13+
import matplotlib.pyplot as plt
14+
1415

1516
def parse_timing(timing, limit):
1617
"Parse timing."

tests/plot_early_recompute.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@
22
33
"""
44

5-
import diskcache as dc
65
import functools as ft
76
import multiprocessing.pool
87
import shutil
98
import threading
109
import time
1110

11+
import diskcache as dc
12+
1213

1314
def make_timer(times):
1415
"""Make a decorator which accumulates (start, end) in `times` for function

0 commit comments

Comments
 (0)