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

init: Fix F401 Linter Warnings by Replacing Wildcard Imports with Explicit Imports in __init__.py #4647

Open
wants to merge 15 commits into
base: main
Choose a base branch
from

Conversation

arohanajit
Copy link
Contributor

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: Removed from .data import * and explicitly imported the necessary functions and classes. Also updated .flake8 since no F403 warnings were found

@github-actions github-actions bot added Python Related code is in Python libraries labels Nov 4, 2024
@arohanajit arohanajit changed the title app: Fix F401 Linter Warnings by Replacing Wildcard Imports with Explicit Imports in __init__.py init: Fix F401 Linter Warnings by Replacing Wildcard Imports with Explicit Imports in __init__.py Nov 4, 2024
@echoix

This comment has been minimized.

@petrasovaa petrasovaa added this to the 8.5.0 milestone Nov 5, 2024
Copy link
Contributor

@petrasovaa petrasovaa left a 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...

Copy link
Contributor

@petrasovaa petrasovaa left a 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

@@ -1,12 +1,15 @@
"""Python interface to launch GRASS GIS modules in scripts
"""

from . import setup # noqa: F401
Copy link
Contributor

Choose a reason for hiding this comment

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

Why this?

Copy link
Contributor Author

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

Copy link
Member

@echoix echoix Nov 11, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
libraries Python Related code is in Python
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants