Hi! I'm running isort 8.0.1 with Python 3.10.20. It appears that the sort re-exports (__all__) configuration does not recognize the # isort: skip action comment:
# reproduction.py
my_list = ["bee", "Albatross", "Dinosaur", "cat"]
__all__ = my_list # isort: skip
$ isort --sort-reexports reproduction.py
ERROR: isort failed to parse the given literal __all__ = my_list # isort: skip
. It's important to note that isort literal sorting only supports simple literals parsable by ast.literal_eval which gave the exception of malformed node or string on line 1: <ast.Name object at 0x107927640>.
I expected isort to skip over the __all__ line and not give an error. I was able to work around the issue using # isort: off, but I would prefer to use # isort: skip if possible:
# workaround.py
my_list = ["bee", "Albatross", "Dinosaur", "cat"]
# isort: off
__all__ = my_list
# isort: on
Hi! I'm running
isort8.0.1 with Python 3.10.20. It appears that the sort re-exports (__all__) configuration does not recognize the# isort: skipaction comment:I expected
isortto skip over the__all__line and not give an error. I was able to work around the issue using# isort: off, but I would prefer to use# isort: skipif possible: