rich-london-7486009/16/2022, 7:58 PM
) and within that library, a file imports another module from the same library plus some 3rd party dependencies like:
from extras.foo import bar
from pyspark.sql import functions as F
correctly identifies this as
since 3rd party libraries should come first, but if we manually change the import order,
incorrectly identifies both as 3rd party libraries and puts
. It seems like
does not know when something is a local import.
happy-kitchen-8948209/16/2022, 9:01 PM
rich-london-7486009/16/2022, 9:26 PM
cannot tell that
is a local dependency?
happy-kitchen-8948209/17/2022, 12:45 AM
rich-london-7486009/20/2022, 2:36 PM
is not able to properly identify the root paths. I was able to fix my problem by adding
, but it seems extremely cumbersome that
does not do this automatically so that every time I add another project, I need to add it to
happy-kitchen-8948209/20/2022, 5:02 PM
is supposed to be set to what pants calls “source roots” - package root dirs (see https://github.com/PyCQA/isort/blob/main/isort/place.py#L76-L87) , e.g., in your case the parent of extras, whereas for you
is the top-level package itself?
rich-london-7486009/20/2022, 6:21 PM
in your case the parent of extras, whereas for youNot quite, the structure is more like:is the top-level package itself?
Perhaps this is all a misunderstanding of how the directory structure should be setup?
root_patterns = [
happy-kitchen-8948209/20/2022, 7:12 PM