diff --git a/parkings/api/public/parking_area.py b/parkings/api/public/parking_area.py index e9a93cb5..fe9c5a8f 100644 --- a/parkings/api/public/parking_area.py +++ b/parkings/api/public/parking_area.py @@ -1,6 +1,7 @@ from rest_framework import viewsets from rest_framework_gis.pagination import GeoJsonPagination -from rest_framework_gis.serializers import GeoFeatureModelSerializer, GeometrySerializerMethodField +from rest_framework_gis.serializers import ( + GeoFeatureModelSerializer, GeometrySerializerMethodField) from parkings.models import ParkingArea diff --git a/parkings/tests/api/enforcement/test_operator.py b/parkings/tests/api/enforcement/test_operator.py index 033accf3..7fa11bf9 100644 --- a/parkings/tests/api/enforcement/test_operator.py +++ b/parkings/tests/api/enforcement/test_operator.py @@ -4,7 +4,9 @@ from parkings.models import Operator -from ..utils import ALL_METHODS, check_list_endpoint_base_fields, check_method_status_codes, get +from ..utils import ( + ALL_METHODS, check_list_endpoint_base_fields, check_method_status_codes, + get) list_url = reverse('enforcement:v1:operator-list') diff --git a/parkings/tests/api/enforcement/test_valid_parking.py b/parkings/tests/api/enforcement/test_valid_parking.py index 5cde65a2..28658792 100644 --- a/parkings/tests/api/enforcement/test_valid_parking.py +++ b/parkings/tests/api/enforcement/test_valid_parking.py @@ -3,12 +3,12 @@ import pytest from django.core.urlresolvers import reverse from django.utils.timezone import utc -from rest_framework.status import HTTP_400_BAD_REQUEST, HTTP_401_UNAUTHORIZED, HTTP_403_FORBIDDEN +from rest_framework.status import ( + HTTP_400_BAD_REQUEST, HTTP_401_UNAUTHORIZED, HTTP_403_FORBIDDEN) from ..utils import ( - ALL_METHODS, check_list_endpoint_base_fields, check_method_status_codes, check_response_objects, get, - get_ids_from_results -) + ALL_METHODS, check_list_endpoint_base_fields, check_method_status_codes, + check_response_objects, get, get_ids_from_results) list_url = reverse('enforcement:v1:valid_parking-list') diff --git a/parkings/tests/api/operator/test_parking.py b/parkings/tests/api/operator/test_parking.py index f130bcff..5e0fbb67 100644 --- a/parkings/tests/api/operator/test_parking.py +++ b/parkings/tests/api/operator/test_parking.py @@ -8,7 +8,9 @@ from parkings.models import Parking -from ..utils import ALL_METHODS, check_method_status_codes, check_required_fields, delete, patch, post, put +from ..utils import ( + ALL_METHODS, check_method_status_codes, check_required_fields, delete, + patch, post, put) list_url = reverse('operator:v1:parking-list') diff --git a/parkings/tests/api/public/test_parking_area_statistics.py b/parkings/tests/api/public/test_parking_area_statistics.py index f653e1bc..ecc19c78 100644 --- a/parkings/tests/api/public/test_parking_area_statistics.py +++ b/parkings/tests/api/public/test_parking_area_statistics.py @@ -5,7 +5,9 @@ from parkings.models import Parking -from ..utils import check_list_endpoint_base_fields, check_method_status_codes, get, get_ids_from_results +from ..utils import ( + check_list_endpoint_base_fields, check_method_status_codes, get, + get_ids_from_results) list_url = reverse('public:v1:parkingareastatistics-list') diff --git a/parkings/tests/conftest.py b/parkings/tests/conftest.py index 2e4b6b2a..c676bc46 100644 --- a/parkings/tests/conftest.py +++ b/parkings/tests/conftest.py @@ -2,9 +2,8 @@ from pytest_factoryboy import register from parkings.factories import ( - AdminUserFactory, HistoryParkingFactory, OperatorFactory, ParkingAreaFactory, ParkingFactory, StaffUserFactory, - UserFactory -) + AdminUserFactory, HistoryParkingFactory, OperatorFactory, + ParkingAreaFactory, ParkingFactory, StaffUserFactory, UserFactory) register(OperatorFactory) register(ParkingFactory, 'parking') diff --git a/parkkihubi/settings.py b/parkkihubi/settings.py index 365f874a..4703d3e5 100644 --- a/parkkihubi/settings.py +++ b/parkkihubi/settings.py @@ -32,7 +32,6 @@ # Create var root if it doesn't exist if not os.path.isdir(VAR_ROOT): - print('Creating var root %s' % VAR_ROOT) os.makedirs(VAR_ROOT) MEDIA_ROOT = os.path.join(VAR_ROOT, 'media') diff --git a/requirements-style.in b/requirements-style.in index 39304807..b19b7d37 100644 --- a/requirements-style.in +++ b/requirements-style.in @@ -1 +1,4 @@ flake8 +flake8-isort +flake8-print +pep8-naming diff --git a/requirements-style.txt b/requirements-style.txt index da70b1cf..743bba12 100644 --- a/requirements-style.txt +++ b/requirements-style.txt @@ -3,6 +3,13 @@ # prequ update # flake8==3.5.0 +flake8-isort==2.3 +flake8-polyfill==1.0.2 # via flake8-isort, pep8-naming +flake8-print==3.0.1 +isort==4.2.15 # via flake8-isort mccabe==0.6.1 # via flake8 -pycodestyle==2.3.1 # via flake8 +pep8-naming==0.5.0 +pycodestyle==2.3.1 # via flake8, flake8-print pyflakes==1.6.0 # via flake8 +six==1.11.0 # via flake8-print +testfixtures==5.4.0 # via flake8-isort diff --git a/setup.cfg b/setup.cfg index eb04976a..73a7c0ad 100644 --- a/setup.cfg +++ b/setup.cfg @@ -17,18 +17,12 @@ norecursedirs = bower_components node_modules .git .idea doctest_optionflags = NORMALIZE_WHITESPACE IGNORE_EXCEPTION_DETAIL ALLOW_UNICODE [isort] -atomic=true -combine_as_imports=false -indent=4 -known_standard_library=token,tokenize,enum,importlib -known_third_party=django,six -length_sort=false -line_length=120 -multi_line_output=5 +default_section=THIRDPARTY +known_first_party=parkkihubi,parkings +line_length=79 +multi_line_output=4 not_skip=__init__.py -order_by_type=false skip=migrations,.tox -wrap_length=120 [pydocstyle] ignore=D100,D104,D105,D200,D203,D400 diff --git a/tox.ini b/tox.ini index b4befcb6..761e52db 100644 --- a/tox.ini +++ b/tox.ini @@ -15,9 +15,9 @@ commands = py.test -ra -vvv --strict --cov {posargs} [testenv:requirements] basepython = python3.4 deps = prequ==1.3.1 -commands = prequ check -v +commands = prequ {posargs:check -v} [testenv:style] basepython = python3.4 deps = -rrequirements-style.txt -commands = flake8 {posargs} +commands = flake8 {posargs:--enable=T}