Skip to content

Commit

Permalink
ensure compatibility with isort==4.3.21
Browse files Browse the repository at this point in the history
as suggested by #251 (comment)
  • Loading branch information
Chilipp committed Nov 9, 2020
1 parent 311a628 commit cc25f69
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 4 additions & 1 deletion datamodel_code_generator/format.py
Expand Up @@ -49,4 +49,7 @@ def apply_black(code: str, python_version: PythonVersion) -> str:


def apply_isort(code: str) -> str:
return isort.code(code)
if isort.__version__.startswith('4.'):
return isort.SortImports(file_contents=code).output # type: ignore
else:
return isort.code(code)
3 changes: 1 addition & 2 deletions setup.cfg
Expand Up @@ -32,8 +32,7 @@ install_requires =
jinja2>=2.10.1,<3.0
inflect>=4.1.0,<5.0
pydantic[email]>=1.5.1,<2.0
black>=19.10b0
isort>=5.0
isort>=4.3.21,<6.0
PySnooper>=0.4.1,<1.0.0
toml>=0.10.0,<1.0.0
genson>=1.2.1,<2.0
Expand Down

0 comments on commit cc25f69

Please sign in to comment.