-
-
Notifications
You must be signed in to change notification settings - Fork 308
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
init: Fix F401 Linter Warnings by Replacing Wildcard Imports with Explicit Imports in __init__.py #4647
base: main
Are you sure you want to change the base?
Conversation
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have several duplications in all...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to run isort and the CI fails because there is missing Popen class from core.py
python/grass/script/__init__.py
Outdated
@@ -1,12 +1,15 @@ | |||
"""Python interface to launch GRASS GIS modules in scripts | |||
""" | |||
|
|||
from . import setup # noqa: F401 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was already there so I didn't change it. I'm assuming for some dependencies since it's not used directly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was me like a couple weeks ago. Ruff, in preview mode, didn't do the right suggestion, or had a suggestion loop of some sort. Or maybe the fix was worse with another tool, like pyright, as the file is named setup.py, and it's not a setuptools setup.py file.
So, you might want to try again, it wasn't a big bug that justified the exclusion.
Addresses multiple
F401
linter warnings in the__init__.py
file by replacing wildcard imports with explicit imports and defining the__all__
variable to specify the public API of the module. Replaced Wildcard Imports: Removedfrom .data import *
and explicitly imported the necessary functions and classes. Also updated.flake8
since noF403
warnings were found