Skip to content
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

style(gui): [DRAFT] Sort and group imports for gui/wxpython #3969

Closed
wants to merge 2 commits into from

Conversation

echoix
Copy link
Member

@echoix echoix commented Jul 1, 2024

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 and black .

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.

Uses a combination of `ruff check --output-format=concise --select I --fix gui`, `isort --profile=black gui` and `black .`

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.
Uses a combination of `ruff check --output-format=concise --select I --fix doc/gui`, `isort --profile=black doc/gui` and `black .`
@echoix echoix added this to the 8.5.0 milestone Jul 1, 2024
@echoix echoix marked this pull request as draft July 1, 2024 19:31
@github-actions github-actions bot added GUI wxGUI related Python Related code is in Python docs labels Jul 1, 2024

import sys
import textwrap
import xml.etree.ElementTree as etree

Check notice

Code scanning / Bandit

Using xml.etree.ElementTree to parse untrusted XML data is known to be vulnerable to XML attacks. Replace xml.etree.ElementTree with the equivalent defusedxml package, or make sure defusedxml.defuse_stdlib() is called. Note

Using xml.etree.ElementTree to parse untrusted XML data is known to be vulnerable to XML attacks. Replace xml.etree.ElementTree with the equivalent defusedxml package, or make sure defusedxml.defuse_stdlib() is called.
@echoix echoix closed this Jul 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs GUI wxGUI related Python Related code is in Python
1 participant