Using the files in ufoLib2/tests,
Run
isort --skip-gitignore --check-only --diff tests
Code snippet
import ufoLib2.objects
# isort: off
pytest.importorskip("cattrs")
import ufoLib2.serde.json # noqa: E402
Code snippet
import ufoLib2.objects
# isort: off
pytest.importorskip("cattrs")
pytest.importorskip("msgpack")
import msgpack # type: ignore # noqa
import ufoLib2.serde.msgpack # noqa: E402
Code snippet
from ufoLib2.objects.info import (
GaspBehavior,
...
WoffMetadataVendor,
)
# isort: off
cattrs = pytest.importorskip("cattrs")
from ufoLib2.converters import register_hooks, structure, unstructure # noqa: E402
~ ast.Import vs ast.ImportFrom
It seems that the command comment affects objects that would be parsed as ast.ImportFrom objects, but does not affect objects that would be parsed as ast.Import objects.
We stumbled across this while updating multiple files in this PR.
#2239 has some discussions about # isort: off, but I think it's a different issue.
Using the files in ufoLib2/tests,
Run
# isort: offnot applied serde/test_json.pyCode snippet
# isort: offnot applied serde/test_msgpack.pyCode snippet
# isort: offis applied test_converters.pyCode snippet
~ ast.Import vs ast.ImportFrom
It seems that the command comment affects objects that would be parsed as
ast.ImportFromobjects, but does not affect objects that would be parsed asast.Importobjects.We stumbled across this while updating multiple files in this PR.
#2239 has some discussions about
# isort: off, but I think it's a different issue.