PyCQA / flake8-import-order

Flake8 plugin that checks import order against various Python Style Guides
GNU Lesser General Public License v3.0
278 stars 72 forks source link

Two Third Party imports in the same block throws I201 error #174

Open MaxGhenis opened 4 years ago

MaxGhenis commented 4 years ago

When running flake8, with flake8-import-order installed, on this script:

import numpy as np
import pandas as pd

def test():
    return pd.DataFrame(np.arange(10))

I get this error:

test.py:2:1: I201 Missing newline between import groups. 'import pandas' is identified as Third Party and 'import numpy' is identified as Third Party.

Is this expected behavior?

I'm on the latest packages from conda. flake8 --version shows 3.8.3 (import-order: 0.18.1, mccabe: 0.6.1, pycodestyle: 2.6.0, pyflakes: 2.2.0) CPython 3.7.7 on Linux.

pgjones commented 4 years ago

It is for the cryptography style, see this example

MaxGhenis commented 4 years ago

So every third party package needs to be separated by an empty line? This is not clear from the error message.

dima-kov commented 2 years ago

Hi, @pgjones, could you please elaborate a bit more? Is it expected behavior?

dima-kov commented 2 years ago

How can I disable this style?

dejvidq commented 1 year ago

Set import-order-style option to desired style. List of available styles is defined in this project's README