diff --git a/requirements/requirements-codestyle.txt b/requirements/requirements-codestyle.txt index 1a51179f8..8cbd41c50 100644 --- a/requirements/requirements-codestyle.txt +++ b/requirements/requirements-codestyle.txt @@ -4,4 +4,4 @@ flake8-tidy-imports==1.1.0 pycodestyle==2.3.1 # Sort and lint imports -isort==4.2.15 +isort==4.3.3 diff --git a/rest_framework/fields.py b/rest_framework/fields.py index a336528e8..51b216787 100644 --- a/rest_framework/fields.py +++ b/rest_framework/fields.py @@ -11,8 +11,8 @@ import uuid from collections import OrderedDict from django.conf import settings -from django.core.exceptions import ValidationError as DjangoValidationError from django.core.exceptions import ObjectDoesNotExist +from django.core.exceptions import ValidationError as DjangoValidationError from django.core.validators import ( EmailValidator, RegexValidator, URLValidator, ip_address_validators ) diff --git a/rest_framework/pagination.py b/rest_framework/pagination.py index 861e8cf2a..4a74b6ed5 100644 --- a/rest_framework/pagination.py +++ b/rest_framework/pagination.py @@ -8,8 +8,8 @@ from __future__ import unicode_literals from base64 import b64decode, b64encode from collections import OrderedDict, namedtuple -from django.core.paginator import Paginator as DjangoPaginator from django.core.paginator import InvalidPage +from django.core.paginator import Paginator as DjangoPaginator from django.template import loader from django.utils import six from django.utils.encoding import force_text diff --git a/rest_framework/parsers.py b/rest_framework/parsers.py index d9dd5f252..35d0d1aa7 100644 --- a/rest_framework/parsers.py +++ b/rest_framework/parsers.py @@ -11,11 +11,10 @@ import codecs from django.conf import settings from django.core.files.uploadhandler import StopFutureHandlers from django.http import QueryDict +from django.http.multipartparser import ChunkIter from django.http.multipartparser import \ MultiPartParser as DjangoMultiPartParser -from django.http.multipartparser import ( - ChunkIter, MultiPartParserError, parse_header -) +from django.http.multipartparser import MultiPartParserError, parse_header from django.utils import six from django.utils.encoding import force_text from django.utils.six.moves.urllib import parse as urlparse diff --git a/rest_framework/reverse.py b/rest_framework/reverse.py index 54c463553..e9cf737f1 100644 --- a/rest_framework/reverse.py +++ b/rest_framework/reverse.py @@ -3,8 +3,8 @@ Provide urlresolver functions that return fully qualified URLs or view names """ from __future__ import unicode_literals -from django.urls import reverse as django_reverse from django.urls import NoReverseMatch +from django.urls import reverse as django_reverse from django.utils import six from django.utils.functional import lazy diff --git a/rest_framework/serializers.py b/rest_framework/serializers.py index 33da0bad0..0dce352e1 100644 --- a/rest_framework/serializers.py +++ b/rest_framework/serializers.py @@ -17,8 +17,8 @@ import inspect import traceback from collections import Mapping, OrderedDict -from django.core.exceptions import ValidationError as DjangoValidationError from django.core.exceptions import ImproperlyConfigured +from django.core.exceptions import ValidationError as DjangoValidationError from django.db import models from django.db.models import DurationField as ModelDurationField from django.db.models.fields import Field as DjangoModelField diff --git a/rest_framework/test.py b/rest_framework/test.py index c58df34c6..edacf0066 100644 --- a/rest_framework/test.py +++ b/rest_framework/test.py @@ -12,8 +12,8 @@ from django.core.exceptions import ImproperlyConfigured from django.core.handlers.wsgi import WSGIHandler from django.test import override_settings, testcases from django.test.client import Client as DjangoClient -from django.test.client import RequestFactory as DjangoRequestFactory from django.test.client import ClientHandler +from django.test.client import RequestFactory as DjangoRequestFactory from django.utils import six from django.utils.encoding import force_bytes from django.utils.http import urlencode diff --git a/tests/test_description.py b/tests/test_description.py index 6ccbec882..ffd2636f2 100644 --- a/tests/test_description.py +++ b/tests/test_description.py @@ -9,7 +9,6 @@ from rest_framework.compat import apply_markdown from rest_framework.utils.formatting import dedent from rest_framework.views import APIView - # We check that docstrings get nicely un-indented. DESCRIPTION = """an example docstring ====================