Skip to content

Commit fbeb1be

Browse files
committed
Update isort to 5.x release
1 parent 925f483 commit fbeb1be

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

codegen/main.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import astor
66
import astunparse
77
import black
8-
from isort import SortImports
8+
import isort.api
99

1010
from codegen.generate_schema import SchemaModuleGenerator
1111
from codegen.generate_services import ServiceModuleGenerator
@@ -100,7 +100,9 @@ def write_module(filename, ast):
100100

101101

102102
def reformat_code(filename):
103-
SortImports(filename)
103+
104+
config = isort.api.Config()
105+
isort.api.sort_file(filename, config=config)
104106

105107
src = Path(filename)
106108
report = black.Report()

pyproject.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,3 @@ balanced_wrapping = true
1414
default_section = "THIRDPARTY"
1515
known_first_party = ["commercetools", "tests", "codegen"]
1616
use_parentheses = true
17-
indent_style = "space"
18-
indent_size = 4
19-
tab_width = 4

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"astor==0.8.1",
2121
"attrs>=18.2.0",
2222
"black==18.9b0",
23-
"isort[pyproject]==4.3.21",
23+
"isort[pyproject]==5.2.2",
2424
"PyYAML==3.13",
2525
]
2626

0 commit comments

Comments
 (0)