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
I've noticed you've written a thing that iterates prefix entries. imp.find_module is potentially a better / more-accurate source of truth (especially when .pth shenanigans are involved). I've also noticed that your module seems to prefer "application" classification when running in an isolated virtualenv, not sure if that's related or not.
Similar code from my implementation before finding yours (ugh google why do you fail me):
Thanks so much for providing your input. I like that implementation, but unfortunately cannot use it as it goes against one of isort's current design goals (portability), currently a lot of users install isort as a binary tool once running on Python2 or 3 and then run it against code using both versions, if imp.find_module is used it will fail in several cases because isort is running against Python 2 code but itself running on Python 3 or vice versa.
I've noticed you've written a thing that iterates prefix entries.
imp.find_module
is potentially a better / more-accurate source of truth (especially when .pth shenanigans are involved). I've also noticed that your module seems to prefer "application" classification when running in an isolated virtualenv, not sure if that's related or not.Similar code from my implementation before finding yours (ugh google why do you fail me):
https://github.com/asottile/aspy.refactor_imports/blob/master/aspy/refactor_imports/classify.py#L29-L62
The text was updated successfully, but these errors were encountered: