-
-
Notifications
You must be signed in to change notification settings - Fork 582
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
--sort-reexports
is broken
#2037
Comments
I actually did notice this, though am not 100% sure why it's happening. It wasn't happening when I developed it, but that was over a year ago so anything could've happened in the meantime. I'll have another look tomorrow probably. (Sorry, only just saw this. I actually ignored the error when I saw it recently cos I thought isort had been abandoned and it was never gonna see this feature, but now it's not I've actually gotta do something about it lmao.) |
So I decided to look at it tonight, and both errors have been fixed @monosans @staticdev. I'm just gonna run through and double check stuff then create a PR. |
Seems like after the PR is merged, this still does not work as expected and breaks |
It's working fine for me. What version of isort are you using? |
@parafoxia Minimal example using 5.12.0: from x import (
y,
)
def z():
return y()
__all__ = [
"z",
"y",
] emits as from x import y
def z():
__all__ = ['y', 'z']
= [ Seems to be triggered by the multi-line |
Ah, I think I see what might be happening here. I'll try and have a look at it some point over the next few days. |
I decided to put two bugs in the same issue because I think
sort-reexports
is highly unstable and both bugs should be dealt with together.Bug 1
Running
isort --sort-reexports
on this code creates a new__all__
instead of replacing the existing one.Bug 2
If you make
__all__
a tuple without parentheses, then isort will just crash.Technical info
OS: Arch Linux
Python 3.10.8
isort 5.11.1
The text was updated successfully, but these errors were encountered: