Problem: It appears that setting up flake8 with PyCharm is not so easy and perhaps the same goes for some other editors. Additionally flake8-import-order, even when flake8 is properly integrated withing an editor, will not fix the import orders but simply flag them as being not ok.
Solution: Automate the ordering of the imports with a tool. Using isort can automate the task of sorting the import order, in a similar way than black formats the code and flake8-isort can detect ordering "errors". See https://github.com/psf/black/issues/333 for black/isort interop.
Problem: It appears that setting up
flake8
with PyCharm is not so easy and perhaps the same goes for some other editors. Additionallyflake8-import-order
, even whenflake8
is properly integrated withing an editor, will not fix the import orders but simply flag them as being not ok.Solution: Automate the ordering of the imports with a tool. Using
isort
can automate the task of sorting the import order, in a similar way than black formats the code andflake8-isort
can detect ordering "errors". See https://github.com/psf/black/issues/333 forblack
/isort
interop.