Skip to content

Commit 355afcf

Browse files
authored
isort v5 (encode#7484)
1 parent 3d708ac commit 355afcf

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

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==4.1.0
44
pycodestyle==2.5.0
55

66
# Sort and lint imports
7-
isort==4.3.21
7+
isort==5.4.2

rest_framework/compat.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ def apply_markdown(text):
9696

9797
try:
9898
import pygments
99-
from pygments.lexers import get_lexer_by_name, TextLexer
10099
from pygments.formatters import HtmlFormatter
100+
from pygments.lexers import TextLexer, get_lexer_by_name
101101

102102
def pygments_highlight(text, lang, style):
103103
lexer = get_lexer_by_name(lang, stripall=False)
@@ -121,9 +121,10 @@ def pygments_css(style):
121121
# starting from this blogpost and modified to support current markdown extensions API
122122
# https://zerokspot.com/weblog/2008/06/18/syntax-highlighting-in-markdown-with-pygments/
123123

124-
from markdown.preprocessors import Preprocessor
125124
import re
126125

126+
from markdown.preprocessors import Preprocessor
127+
127128
class CodeBlockPreprocessor(Preprocessor):
128129
pattern = re.compile(
129130
r'^\s*``` *([^\n]+)\n(.+?)^\s*```', re.M | re.S)

runtests.py

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

1212
FLAKE8_ARGS = ['rest_framework', 'tests']
1313

14-
ISORT_ARGS = ['--recursive', '--check-only', '--diff', 'rest_framework', 'tests']
14+
ISORT_ARGS = ['--check-only', '--diff', 'rest_framework', 'tests']
1515

1616

1717
def exit_on_failure(ret, message=None):

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ banned-modules = json = use from rest_framework.utils import json!
1313
skip=.tox
1414
atomic=true
1515
multi_line_output=5
16-
known_standard_library=types
16+
extra_standard_library=types
1717
known_third_party=pytest,_pytest,django,pytz,uritemplate
1818
known_first_party=rest_framework,tests
1919

0 commit comments

Comments
 (0)