Skip to content

False order of local imports relative to standard library imports  #2257

@JohnBioinf

Description

@JohnBioinf

I am using the isort library to automatically sort my Python imports, but I'm experiencing an issue with the ordering of the imports. Specifically, isort is grouping my local imports (e.g., from test.my_module import MyClass) with the standard library imports (e.g., import os) instead of with the other local imports (e.g., from my_app.my_module import MyOtherClass).

For example, the current ordering produced by isort is:

import os
from test.my_module import MyClass

from flask import Flask

from my_app.my_module import MyOtherClass

But as far as I understand the order should be like so:

import os

from flask import Flask

from my_app.my_module import MyOtherClass
from test.my_module import MyClass

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions