isort --atomic fails for any Cython .pyx file containing a cimport statement, claiming it has an existing syntax error. A minimal example is:
cimport numpy
cimport ctime
isort buggy.pyx --diff runs fine:
$ isort buggy.pyx --diff
--- .../buggy.pyx:before 2021-05-06 10:19:09.495635
+++ .../buggy.pyx:after 2021-05-06 10:19:19.479452
@@ -1,2 +1,2 @@
+cimport ctime
cimport numpy
-cimport ctime
Fixing .../buggy.pyx
However, isort buggy.pyx --diff --atomic fails:
$ isort buggy.pyx --diff --atomic
.../lib/python3.6/site-packages/isort/api.py:306: UserWarning: {file_path} unable to sort due to existing syntax errors
Bug found on isort v5.8.0, but the bug exists as far back as isort v5.0.0, when Cython support was added.
I presume the same issue will occur for any other Cython-specific syntax, too.
isort --atomicfails for any Cython .pyx file containing acimportstatement, claiming it has an existing syntax error. A minimal example is:isort buggy.pyx --diffruns fine:However,
isort buggy.pyx --diff --atomicfails:Bug found on isort v5.8.0, but the bug exists as far back as isort v5.0.0, when Cython support was added.
I presume the same issue will occur for any other Cython-specific syntax, too.