mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-10 19:56:59 +03:00
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
This commit is contained in:
parent
2bc7cd19a3
commit
2854679f56
|
@ -1,7 +0,0 @@
|
|||
[settings]
|
||||
skip=.tox
|
||||
atomic=true
|
||||
multi_line_output=5
|
||||
known_standard_library=types
|
||||
known_third_party=pytest,_pytest,django
|
||||
known_first_party=rest_framework
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -13,7 +13,7 @@ PYTEST_ARGS = {
|
|||
|
||||
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):
|
||||
|
|
|
@ -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
setup.py
2
setup.py
|
@ -6,7 +6,7 @@ import shutil
|
|||
import sys
|
||||
from io import open
|
||||
|
||||
from setuptools import setup, find_packages
|
||||
from setuptools import find_packages, setup
|
||||
|
||||
try:
|
||||
from pypandoc import convert_file
|
||||
|
|
|
@ -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
|
||||
====================
|
||||
|
|
Loading…
Reference in New Issue
Block a user