-
-
Notifications
You must be signed in to change notification settings - Fork 310
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
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
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.
The CI fails:
File "scripts/t.vect.import", line 113, in main
tgis.import_stds(
File "etc/python/grass/temporal/stds_import.py", line 250, in import_stds
old_state = gs.raise_on_error
AttributeError: module 'grass.script' has no attribute 'raise_on_error'. Did you mean: 'get_raise_on_error'?
because there is missing raise_on_error from core.py. But I would say in this case it should use the getter anyway:
old_state = gs.get_raise_on_error()
So the variable probably should not be exposed.
So in this case CI will probably always fail unless we expose 'raise_on_error()` which we shouldn't. Is there another way to manage this? |
I was suggesting to do the change in stds_import.py |
The .flake8 changes mentioned in the PR description were lost in one of the commits. I tried cleaning it back locally, iterating by using |
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