You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using isort to sort imports, it fails to move all import statements to the top of the file. This issue occurs when there are import statements placed after other code blocks. Below is a minimal example demonstrating the issue:
fromtkinterimportButton, Label, messagebox, StringVar, Text, Tk, ttkfromdummy_module_1importDummyClass1fromdummy_module_2importDummyClass2fromdummy_module_3importDummyClass3fromdummy_module_4importDummyClass4# Some configuration variableconfig_flag=True# Create an instance of tkinter frameapp=Tk()
ifconfig_flag:
app.title("Live - Dummy App")
else:
app.title("Test - Dummy App")
app.geometry("350x450")
app.resizable(False, False)
fromdummy_module_5importDummyClass5
Steps to Reproduce
Save the example code to src/some_file.py.
Run isort on the file:
python -m isort src/some_file.py
Observe that the import statement from dummy_module_5 import DummyClass5 remains at the bottom of the file, below other code.
Expected Behavior
All import statements should be moved to the top of the file, sorted according to the configuration.
Actual Behavior
The import statement from dummy_module_5 import DummyClass5 is not moved to the top of the file and remains below other code.
The text was updated successfully, but these errors were encountered:
When using isort to sort imports, it fails to move all import statements to the top of the file. This issue occurs when there are import statements placed after other code blocks. Below is a minimal example demonstrating the issue:
Steps to Reproduce
Save the example code to src/some_file.py.
Run isort on the file:
Observe that the import statement from dummy_module_5 import DummyClass5 remains at the bottom of the file, below other code.
Expected Behavior
All import statements should be moved to the top of the file, sorted according to the configuration.
Actual Behavior
The import statement from dummy_module_5 import DummyClass5 is not moved to the top of the file and remains below other code.
The text was updated successfully, but these errors were encountered: