Skip to content

Commit

Permalink
import sorting
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelcolvin committed Aug 5, 2016
1 parent aab7b8c commit 0e13031
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 10 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ install:
- pip install -r tests/requirements.txt
script:
- flake8 arq/ tests/
- ./tests/isort_test.sh
- py.test --cov=arq
after_success:
- coverage combine
Expand Down
2 changes: 1 addition & 1 deletion arq/cli.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import logging.config

import click

from .version import VERSION
from .worker import RunWorkerProcess, import_string


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

Expand Down
3 changes: 1 addition & 2 deletions arq/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@

import msgpack

from .utils import RedisMixin, timestamp, ellipsis

from .utils import RedisMixin, ellipsis, timestamp

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

Expand Down
2 changes: 1 addition & 1 deletion arq/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import pytest
from aioredis import create_redis

from arq import RedisMixin, timestamp, BaseWorker
from arq import BaseWorker, RedisMixin, timestamp

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

Expand Down
2 changes: 1 addition & 1 deletion arq/utils.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import asyncio
import base64
from datetime import datetime
import os
from datetime import datetime

import aioredis

Expand Down
8 changes: 4 additions & 4 deletions arq/worker.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import asyncio
from importlib import import_module, reload
import logging
from multiprocessing import Process
import os
import signal
from signal import Signals
import sys
import time
from importlib import import_module, reload
from multiprocessing import Process
from signal import Signals

from .logs import default_log_config
from .main import Actor, Job
from .utils import RedisMixin, timestamp, cached_property, gen_random, ellipsis
from .utils import RedisMixin, cached_property, ellipsis, gen_random, timestamp

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

Expand Down
5 changes: 4 additions & 1 deletion runtests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@ if [ $pytest == 0 ] ; then
coverage combine
coverage html
fi
./tests/isort_test.sh
echo "pytest exit code: ${pytest}"
isort=$?
echo "isort exit code: ${isort}"
flake8 arq/ tests/
flake=$?
echo "flake8 exit code: ${flake}"
exit $((${flake} + ${pytest}))
exit $((${pytest} + ${flake} + ${isort}))
7 changes: 7 additions & 0 deletions tests/isort_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash
isort_result=$(isort -rc --wrap-length 120 --diff arq)
if [[ $isort_result == *"arq"* ]] ; then
printf "changes:\n $isort_result\n\nisort changed directory, therefore there's an import order problem\n"
exit 1
fi
exit 0
1 change: 1 addition & 0 deletions tests/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
codecov
coverage
flake8
isort
pep8
pytest
pytest-cov
Expand Down

0 comments on commit 0e13031

Please sign in to comment.