-
-
Notifications
You must be signed in to change notification settings - Fork 578
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
Different third vs first party behaviour in isort 5 (vs isort 4) #1467
Comments
Hi @AlexandreYang thanks for reporting this issue! I believe for this exact issue in the datadog repository, you can achieve the behaviour you want simply by telling isort not to automatically try to detect based on src_path. This can be achieved by telling isort to use an empty set of src_paths in your config: [tool.isort]
force_grid_wrap = 0
include_trailing_comma = true
known_first_party = 'datadog_checks'
src_paths = '' Ideally, the improvements planned to module placement for 5.6.0 would enable this to mostly work automatically, but even so if you simply want everything under Side note: What is the best way to run isort across the repository to be consistent with how it is done in your CI? I would love to add this project to the isort integration test suite (https://github.com/PyCQA/isort/blob/develop/tests/integration/test_projects_using_isort.py#L1) so that the isort project can assure that as we make changes they don't introduce regressions. Thanks! ~Timothy |
Thanks @timothycrosley Nice using It's nice to test |
Add Datadog |
Hi,
It seems the behaviour changed for isort 5 related to first party, third party sections.
folder structure
code.py
output for isort 5.5.1:cmd
$ isort code.py
Notice the extra line between
import foo
andimport bar
code.py
output with isort 4.3.21:cmd
$ isort code.py
Real life case
This this diff linked here represent the code change before (isort 4) and after using isort 5:
DataDog/integrations-core@518d8b7
The text was updated successfully, but these errors were encountered: