Skip to content

Commit 0e13031

Browse files
committed
import sorting
1 parent aab7b8c commit 0e13031

9 files changed

+21
-10
lines changed

.travis.yml

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ install:
99
- pip install -r tests/requirements.txt
1010
script:
1111
- flake8 arq/ tests/
12+
- ./tests/isort_test.sh
1213
- py.test --cov=arq
1314
after_success:
1415
- coverage combine

arq/cli.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import logging.config
2+
23
import click
34

45
from .version import VERSION
56
from .worker import RunWorkerProcess, import_string
67

7-
88
batch_help = 'Batch mode: exit once no jobs are found in any queue.'
99
verbose_help = 'Enable verbose output.'
1010

arq/main.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44

55
import msgpack
66

7-
from .utils import RedisMixin, timestamp, ellipsis
8-
7+
from .utils import RedisMixin, ellipsis, timestamp
98

109
__all__ = ['Actor', 'concurrent', 'Job']
1110

arq/testing.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import pytest
88
from aioredis import create_redis
99

10-
from arq import RedisMixin, timestamp, BaseWorker
10+
from arq import BaseWorker, RedisMixin, timestamp
1111

1212
logger = logging.getLogger('arq.mock')
1313

arq/utils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import asyncio
22
import base64
3-
from datetime import datetime
43
import os
4+
from datetime import datetime
55

66
import aioredis
77

arq/worker.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
import asyncio
2-
from importlib import import_module, reload
32
import logging
4-
from multiprocessing import Process
53
import os
64
import signal
7-
from signal import Signals
85
import sys
96
import time
7+
from importlib import import_module, reload
8+
from multiprocessing import Process
9+
from signal import Signals
1010

1111
from .logs import default_log_config
1212
from .main import Actor, Job
13-
from .utils import RedisMixin, timestamp, cached_property, gen_random, ellipsis
13+
from .utils import RedisMixin, cached_property, ellipsis, gen_random, timestamp
1414

1515
__all__ = ['BaseWorker', 'import_string', 'RunWorkerProcess']
1616

runtests.sh

+4-1
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,11 @@ if [ $pytest == 0 ] ; then
66
coverage combine
77
coverage html
88
fi
9+
./tests/isort_test.sh
910
echo "pytest exit code: ${pytest}"
11+
isort=$?
12+
echo "isort exit code: ${isort}"
1013
flake8 arq/ tests/
1114
flake=$?
1215
echo "flake8 exit code: ${flake}"
13-
exit $((${flake} + ${pytest}))
16+
exit $((${pytest} + ${flake} + ${isort}))

tests/isort_test.sh

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env bash
2+
isort_result=$(isort -rc --wrap-length 120 --diff arq)
3+
if [[ $isort_result == *"arq"* ]] ; then
4+
printf "changes:\n $isort_result\n\nisort changed directory, therefore there's an import order problem\n"
5+
exit 1
6+
fi
7+
exit 0

tests/requirements.txt

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
codecov
22
coverage
33
flake8
4+
isort
45
pep8
56
pytest
67
pytest-cov

0 commit comments

Comments
 (0)