Skip to content

Upgrade isort #5817

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Feb 14, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions .isort.cfg

This file was deleted.

2 changes: 1 addition & 1 deletion requirements/requirements-codestyle.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion rest_framework/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
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
)
Expand Down
2 changes: 1 addition & 1 deletion rest_framework/pagination.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
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
Expand Down
5 changes: 2 additions & 3 deletions rest_framework/parsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@
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
Expand Down
2 changes: 1 addition & 1 deletion rest_framework/reverse.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"""
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

Expand Down
2 changes: 1 addition & 1 deletion rest_framework/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
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
Expand Down
2 changes: 1 addition & 1 deletion rest_framework/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
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
Expand Down
2 changes: 1 addition & 1 deletion runtests.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

FLAKE8_ARGS = ['rest_framework', 'tests']

ISORT_ARGS = ['--recursive', '--check-only', '-o' 'uritemplate', '-p', 'tests', 'rest_framework', 'tests']
ISORT_ARGS = ['--recursive', '--check-only', '--diff', '-o' 'uritemplate', '-p', 'tests', 'rest_framework', 'tests']


def exit_on_failure(ret, message=None):
Expand Down
8 changes: 8 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,11 @@ license_file = LICENSE.md
[flake8]
ignore = E501
banned-modules = json = use from rest_framework.utils import json!

[isort]
skip=.tox
atomic=true
multi_line_output=5
known_standard_library=types
known_third_party=pytest,_pytest,django
known_first_party=rest_framework
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import sys
from io import open

from setuptools import setup, find_packages
from setuptools import find_packages, setup

try:
from pypandoc import convert_file
Expand Down
1 change: 0 additions & 1 deletion tests/test_description.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
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
====================
Expand Down