我正在尝试为 django-rest-framework 做出贡献,我运行后身份验证文件中的导入isort
是这样的(我添加了导入六):
from __future__ import unicode_literals
import base64
import six
from django.contrib.auth import authenticate, get_user_model
from django.middleware.csrf import CsrfViewMiddleware
from django.utils.translation import ugettext_lazy as _
from rest_framework import HTTP_HEADER_ENCODING, exceptions
当我运行./runtests --lintonly
它时,它通过了所有测试,但是当我运行tox
它时,它给了我这个错误:
py27-lint runtests: commands[0] | ./runtests.py --lintonly
Running flake8 code linting
flake8 passed
Running isort code checking
ERROR: /home/nitesh/open_source/django-rest-framework/rest_framework/authentication.py Imports are incorrectly sorted.
isort failed: Some modules have incorrectly ordered imports. Fix by running `isort --recursive .`
ERROR: InvocationError: '/home/nitesh/open_source/django-rest-framework/runtests.py --lintonly'