-
-
Notifications
You must be signed in to change notification settings - Fork 626
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
isort with multiple config files does not work correctly #17327
Comments
In this case I believe the solution would be to partition the inputs (files) based on config such that no two files passed to isort would disagree on config.
|
On discussion with @Eric-Arellano This issue does not seem to be present with isort4 I tried:
|
From Slack:
@AbdealiJK can this be closed, then? Is that working? |
Yep - closing.
But when I run: But I assume this is because So, I think that is because of the sandbox not having all the files - maybe same as: #15069 |
Yeah, that last issue sounds like #15069, and the workaround is to explicitly list your 1stparty packages in isort config. |
Describe the bug
I have a project like:
And I am using pyproject.toml for the isort configs:
And the pyproject.toml for every lib changes the
known_first_party = ["lib1", "lib1_test"]
to treat only the library as a first party import.When I run:
./pants fmt ::
- it was using the wrong first party importsOn @benjyw 's suggestio - tried:
./pants fmt libs/lib1/::
And it seemed to workAfter a lot of digging, I realized that isort finds the config file based on the 1st file provided to it
https://pycqa.github.io/isort/docs/configuration/config_files.html
And order of files that pants is sending into isort is mosst likely the culprit here.
Pants version: 2.13.0
OS: Windows 10 + Ubuntu 18.04 LTS
Additional info
Slack conversation: link
Another issue related to isort I checked: #15069
The batch ID concept in this issue may have been a workaround here: #14941
The text was updated successfully, but these errors were encountered: