From 5f4aac4822c50389b487d085a1fe08af7f8203a3 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Fri, 7 Dec 2018 20:44:31 +0000 Subject: [PATCH] Add flake8 and isort --- dev-requirements.txt | 2 ++ ipc_unix/client.py | 3 ++- ipc_unix/server.py | 1 + scripts/test.sh | 4 +++- setup.cfg | 5 +++++ tests/test_server.py | 7 ++++--- 6 files changed, 17 insertions(+), 5 deletions(-) create mode 100644 setup.cfg diff --git a/dev-requirements.txt b/dev-requirements.txt index 455f115..60f636d 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -1,2 +1,4 @@ black==18.9b0 +flake8==3.6.0 +isort==4.3.4 nose2==0.8.0 diff --git a/ipc_unix/client.py b/ipc_unix/client.py index 8325380..fc9eaee 100644 --- a/ipc_unix/client.py +++ b/ipc_unix/client.py @@ -1,6 +1,7 @@ import socket -from ipc_unix.utils import read_payload + import ujson +from ipc_unix.utils import read_payload def send_to(socket_path, data): diff --git a/ipc_unix/server.py b/ipc_unix/server.py index 55807e9..6343988 100644 --- a/ipc_unix/server.py +++ b/ipc_unix/server.py @@ -1,5 +1,6 @@ import socketserver import threading + import ujson from ipc_unix.utils import read_payload diff --git a/scripts/test.sh b/scripts/test.sh index 1296d24..af2203f 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -6,4 +6,6 @@ export PATH=env/bin:${PATH} python setup.py test -black tests ipc_unix +black tests ipc_unix --check +flake8 ipc_unix tests --ignore=E128,E501 +isort -rc -c ipc_unix tests diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..f50d665 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,5 @@ +[isort] +multi_line_output=3 +include_trailing_comma=True +force_grid_wrap=0 +use_parentheses=True diff --git a/tests/test_server.py b/tests/test_server.py index c1882a6..d7054fa 100644 --- a/tests/test_server.py +++ b/tests/test_server.py @@ -1,7 +1,8 @@ -from unittest import TestCase -from tests import EchoServer, get_random_path -from ipc_unix import client from functools import partial +from unittest import TestCase + +from ipc_unix import client +from tests import EchoServer, get_random_path class BasicServerTestCase(TestCase):