-
-
Notifications
You must be signed in to change notification settings - Fork 584
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Option for LOCALFOLDER to recognize the top-level module of the current file #1020
Comments
@timothycrosley Before I tackle this, do you have a preference for the syntax used for variables like this? |
Here's another use case, if I understand what you want to do correctly: if you have many Python packages all related to the same bigger project. For example: # FIRSTPARTY (not the current project, but all known-first-party)
from myproject_a.foo import bar
from myproject_b.qwe import ewq
from myproject_c.abc import xyz
# LOCALFOLDER (this is the one we're currently testing, although it's not a relative import)
from myproject_d.module import something Unless I'm missing something, this can't be done with the current isort? |
@aldanor Precisely. I have a proof of concept working, but it makes a number of assumptions and wouldn't work with namespaced packages currently (though it's questionable whether this is desirable or not... I haven't worked with them much so I'm not 100%). I'll get a PR up in the next week or two. My use case is pretty much as you say: a bunch of django apps that coexist in a larger web application project. |
My use case is exactly with namespaced packages actually 😆 So if you could make it work with them too it would be totally awesome! |
starting in isort 5.2.0, isort will now accept a |
I'd like to see an option to accomplish this:
A possible work-around with some editors would be to use their variables and pass them through to
isort
. Unfortunately, this doesn't currently work because isort doesn't take aknown-localfolder
argument on the command line.Is there a way to accomplish this currently?
The text was updated successfully, but these errors were encountered: