Skip to content

Commit 2854679

Browse files
blueyedtomchristie
authored andcommitted
Upgrade isort (#5817)
* Fix isort * runtests: add --diff to ISORT_ARGS * requirements-codestyle: bump isort to 4.3.3 * isort: move config to setup.cfg
1 parent 2bc7cd1 commit 2854679

File tree

12 files changed

+18
-19
lines changed

12 files changed

+18
-19
lines changed

.isort.cfg

Lines changed: 0 additions & 7 deletions
This file was deleted.

requirements/requirements-codestyle.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ flake8-tidy-imports==1.1.0
44
pycodestyle==2.3.1
55

66
# Sort and lint imports
7-
isort==4.2.15
7+
isort==4.3.3

rest_framework/fields.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
from collections import OrderedDict
1212

1313
from django.conf import settings
14-
from django.core.exceptions import ValidationError as DjangoValidationError
1514
from django.core.exceptions import ObjectDoesNotExist
15+
from django.core.exceptions import ValidationError as DjangoValidationError
1616
from django.core.validators import (
1717
EmailValidator, RegexValidator, URLValidator, ip_address_validators
1818
)

rest_framework/pagination.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
from base64 import b64decode, b64encode
99
from collections import OrderedDict, namedtuple
1010

11-
from django.core.paginator import Paginator as DjangoPaginator
1211
from django.core.paginator import InvalidPage
12+
from django.core.paginator import Paginator as DjangoPaginator
1313
from django.template import loader
1414
from django.utils import six
1515
from django.utils.encoding import force_text

rest_framework/parsers.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,10 @@
1111
from django.conf import settings
1212
from django.core.files.uploadhandler import StopFutureHandlers
1313
from django.http import QueryDict
14+
from django.http.multipartparser import ChunkIter
1415
from django.http.multipartparser import \
1516
MultiPartParser as DjangoMultiPartParser
16-
from django.http.multipartparser import (
17-
ChunkIter, MultiPartParserError, parse_header
18-
)
17+
from django.http.multipartparser import MultiPartParserError, parse_header
1918
from django.utils import six
2019
from django.utils.encoding import force_text
2120
from django.utils.six.moves.urllib import parse as urlparse

rest_framework/reverse.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
"""
44
from __future__ import unicode_literals
55

6-
from django.urls import reverse as django_reverse
76
from django.urls import NoReverseMatch
7+
from django.urls import reverse as django_reverse
88
from django.utils import six
99
from django.utils.functional import lazy
1010

rest_framework/serializers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
import traceback
1818
from collections import Mapping, OrderedDict
1919

20-
from django.core.exceptions import ValidationError as DjangoValidationError
2120
from django.core.exceptions import ImproperlyConfigured
21+
from django.core.exceptions import ValidationError as DjangoValidationError
2222
from django.db import models
2323
from django.db.models import DurationField as ModelDurationField
2424
from django.db.models.fields import Field as DjangoModelField

rest_framework/test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
from django.core.handlers.wsgi import WSGIHandler
1313
from django.test import override_settings, testcases
1414
from django.test.client import Client as DjangoClient
15-
from django.test.client import RequestFactory as DjangoRequestFactory
1615
from django.test.client import ClientHandler
16+
from django.test.client import RequestFactory as DjangoRequestFactory
1717
from django.utils import six
1818
from django.utils.encoding import force_bytes
1919
from django.utils.http import urlencode

runtests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
FLAKE8_ARGS = ['rest_framework', 'tests']
1515

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

1818

1919
def exit_on_failure(ret, message=None):

setup.cfg

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,11 @@ license_file = LICENSE.md
77
[flake8]
88
ignore = E501
99
banned-modules = json = use from rest_framework.utils import json!
10+
11+
[isort]
12+
skip=.tox
13+
atomic=true
14+
multi_line_output=5
15+
known_standard_library=types
16+
known_third_party=pytest,_pytest,django
17+
known_first_party=rest_framework

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import sys
77
from io import open
88

9-
from setuptools import setup, find_packages
9+
from setuptools import find_packages, setup
1010

1111
try:
1212
from pypandoc import convert_file

tests/test_description.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
from rest_framework.utils.formatting import dedent
1010
from rest_framework.views import APIView
1111

12-
1312
# We check that docstrings get nicely un-indented.
1413
DESCRIPTION = """an example docstring
1514
====================

0 commit comments

Comments
 (0)