Replies: 2 comments 3 replies
-
Can you try disabling |
Beta Was this translation helpful? Give feedback.
3 replies
-
Just for completeness: This is the same issue reported in #12984 and the fix waits to be merged in #12987. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
At our company, we have all our packages in the same namespace (let's assume
foo
). The packages each contain one module and are developed in separate repos (let's call thembar
andbaz
).When using stuff from
foo.baz
insidefoo.bar
, all imports fromfoo.baz
were sorted into the third-party category by isort. Which makes sense in our context, as those are libraries we consider third-party in the current package because they are developed elsewhere.Now, we want to let ruff do the import sorting and it sorts everything in the
foo
namespace to first-party.In our repo the code lives in
src/foo/bar
, withfoo
being a namespace package (no__init__.py
).I fiddled with all the different ruff config parameters but could not find the right combination to behave like isort does.
This came closest to the desired result:
But the above solution requires us that we list ALL our packages explicitly as third-party which is not feasible.
Instead, ruff should treat everything in
src/foo/bar
as first-party, and everything else in thefoo
namespace as third-party.Could anyone help me finding the right configuration?
Beta Was this translation helpful? Give feedback.
All reactions