Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
MaxGhenis opened this issue Aug 25, 2020 · 5 comments
Open

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

MaxGhenis opened this issue Aug 25, 2020 · 5 comments

Comments

@MaxGhenis
Copy link

MaxGhenis commented Aug 25, 2020

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
Copy link
Member

pgjones commented Aug 26, 2020

It is for the cryptography style, see this example

@MaxGhenis
Copy link
Author

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

@dima-kov
Copy link

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

@dima-kov
Copy link

How can I disable this style?

@dejvidq
Copy link

dejvidq commented Feb 14, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants