PyCQA / isort

A Python utility / library to sort imports.

Home Page:https://pycqa.github.io/isort/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

isort open_stack profile not working properly

lricardo opened this issue · comments

Description: When using isort command with profile open_stack it won't sort the imports correctly
Example:

Sample code

import abc
from abc import abstractmethod
import random

isort should return

from abc import abstractmethod
import abc
import random

.isort.cfg

[settings]
force_single_line = True
force_sort_within_sections = True
lexicographical = True

or

.isort.cfg

[settings]
profile = open_stack

It seems like lexicographical = true is not working

Version: isort = "5.12.0", isort = "3.11"

Same issue here 🙋‍♂️

There isn't a bug with isort but the documentation on the profiles might be misleading for some, like me.

When we run test_open_stack.py it will call isort_test with a config with the following values

{'known_first_party': ['nova'], 'order_by_type': False, 'profile': 'open_stack', 'py_version': '2'}

I thought, reading the docs that using open_stack per-se would be enough but I found that I was missing the definition of the known_first_party and 'order_by_type': False.

I will now close it. Thanks.