Skip to content

Conversation

@DimitriPapadopoulos
Copy link
Contributor

No description provided.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 19, 2025

Unit Test Results

See test report for an extended history of previous test failures. This is useful for diagnosing flaky tests.

    27 files  ±0      27 suites  ±0   9h 47m 59s ⏱️ - 14m 39s
 4 112 tests ±0   4 006 ✅ +4    104 💤 ±0  2 ❌  - 4 
51 516 runs  ±0  49 330 ✅ +4  2 184 💤 ±0  2 ❌  - 4 

For more details on these failures, see this check.

Results for commit e824312. ± Comparison against base commit d8e3fd2.

♻️ This comment has been updated with latest results.

"distributed/utils.py" = ["F821"]

[tool.isort]
sections = ["FUTURE", "STDLIB", "THIRDPARTY", "DISTRIBUTED", "FIRSTPARTY", "LOCALFOLDER"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like ruff supports sections, can you make sure we are configuring things the same way? We use these sections specifically to improve readability.

I would suggest going through each setting we had with isort and checking if you can replicate the same setting with ruff.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like for dask, I focused on actual changes in the source code instead of reviewing individual options in detail. It seems to work well in both repositories.

I can review the options more in detail. I seem to recall that most of them are identical to the defaults, which is why I removed them. I'll have a look.

Copy link
Contributor Author

@DimitriPapadopoulos DimitriPapadopoulos Nov 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tool.isort.sections defines all sections isort uses by default:

from typing import Tuple

FUTURE: str = "FUTURE"

STDLIB: str = "STDLIB"

THIRDPARTY: str = "THIRDPARTY"

FIRSTPARTY: str = "FIRSTPARTY"

LOCALFOLDER: str = "LOCALFOLDER"

DEFAULT: Tuple[str, ...] = (FUTURE, STDLIB, THIRDPARTY, FIRSTPARTY, LOCALFOLDER)

The main difference with the default value is the addition of DISTRIBUTED.

- "FUTURE", "STDLIB", "THIRDPARTY", "DISTRIBUTED", "FIRSTPARTY", "LOCALFOLDER"
+ "FUTURE", "STDLIB", "THIRDPARTY", "FIRSTPARTY", "LOCALFOLDER"

where DISTRIBUTED is defined as:

known_distributed = ["dask", "zict"]

which I guess forces to identify dask, distributed and zict as being part of the current python project. This avoids the empty line between dask and distributed imports puts dask and zict imports in a section of their own, between third-party and first-party distributed.

My thoughts about it:

  • Why care about such details and not use the defaults?
  • Actually, why avoid the line between dask and distributed imports? I don't see how that's a good idea.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nevertheless, I have added this section in ruff settings:

"distributed" = ["dask", "zict"]

I'll have a fresh look at dask taking into account this change.

Comment on lines -106 to -109
profile = "black"
skip_gitignore = true
force_to_top = ["true"]
default_section = "THIRDPARTY"
Copy link
Contributor Author

@DimitriPapadopoulos DimitriPapadopoulos Nov 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Obviously, profile = "black" is not needed any more.

I think that skip_gitignore has no ruff equivalent, and that it's basically a non-issue.

Option force_to_top seems misused here.

Copy link
Member

@jacobtomlinson jacobtomlinson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good many thanks!

@jacobtomlinson jacobtomlinson merged commit 73e68fd into dask:main Nov 25, 2025
28 of 32 checks passed
@DimitriPapadopoulos DimitriPapadopoulos deleted the isort branch November 25, 2025 12:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants