style(gui): [DRAFT] Sort and group imports for gui/wxpython #3969
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
NOTE: This is the follow-up PR for #3964. Once #3964 is merged, we need to rebase this PR, as it is too big to review properly.
Uses a combination of
ruff check --output-format=concise --select I --fix gui
,isort --profile=black gui
andblack .
Some files had an
# isort: split
comment added either inline or above/below to have isort not swap imports past this barrier when a comment explaining that an import has to be made first.See https://pycqa.github.io/isort/docs/configuration/action_comments.html#isort-split
This instruction hasn't been added when a comment indicating that requirement wasn't present.
Once ready to review
Once ready to review, a special attention must be made to know if there are other places not indicated by a comment where import of another package (like grass) is required before others due to side effects. In an ideal world, there shouldn't be any side effects, and a file must import what it needs and not rely on the order, nor other files.