PyCQA / isort

A Python utility / library to sort imports.
https://pycqa.github.io/isort/
MIT License
6.45k stars 574 forks source link

Different order on same file depending on where you execute isort v5.13.2 #2246

Open EduMorenoJ opened 6 months ago

EduMorenoJ commented 6 months ago

There is a difference in the order that isort applies depending on where you execute isort.

Steps to reproduce:

Having this python file:

import json
from abc import abstractmethod
from pathlib import Path

from isort_issue.issue.other_file import MyAwesomeClass
from isort_issue.other_path.another_file import AnotherThing
from thirdparty_library import SuperUsefullClass

inside this folder structure ~/isort_issue/issue/test.py

the results are different if you execute isort from ~

isort ./isort_issue/issue/test.py

than if you execute from isort ~/isort_issue/issue

isort test.py
EduMorenoJ commented 5 months ago

Not sure If this issue is the same as https://github.com/PyCQA/isort/issues/2247 but looks related.