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

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

Merged
merged 6 commits into from
Dec 18, 2024

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.

@github-actions github-actions bot added Python Related code is in Python libraries labels Nov 22, 2024
echoix
echoix previously approved these changes Nov 27, 2024
Copy link
Member

@echoix echoix left a comment

Choose a reason for hiding this comment

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

Assuming it was done with the help of a tool the same way as the other PRs, it looks good to me. If there are some parts you'd want me to look more attentively in an IDE, tell me here before we merge

@arohanajit
Copy link
Contributor Author

Assuming it was did with the help of a tool the same way as the other PRs, it looks good to me. If there are some parts you'd want me to look more attentively in an IDE, tell me here before we merge

I basically listed out all function calls and added them. I had tried using GPT for this, but it misclassifies some functions like it did in a similar PR previously. Subsequently I ran isort on them

@echoix
Copy link
Member

echoix commented Nov 27, 2024

If you use vscode, why not activate pylance/pyright? It'll discover the methods and modules and you won't have to fear hallucinations. You'll have the autocomplete suggestions feeded through the LSP protocol.

@echoix
Copy link
Member

echoix commented Nov 27, 2024

I'll try to open it myself next time I'm on a computer with time for this.

@arohanajit
Copy link
Contributor Author

If you use vscode, why not activate pylance/pyright? It'll discover the methods and modules and you won't have to fear hallucinations. You'll have the autocomplete suggestions feeded through the LSP protocol.

Got it! I'll try it out next time I have a similar PR

@echoix echoix changed the title init: Fix F401 Linter Warnings by Replacing Wildcard Imports with Explicit Imports in __init__.py temporal: Fix F401 Linter Warnings by Replacing Wildcard Imports with Explicit Imports in __init__.py Nov 27, 2024
@echoix echoix dismissed their stale review November 27, 2024 22:36

To look at in IDE

@arohanajit
Copy link
Contributor Author

@echoix I looked at it in iDE, and it matches the functions on the files

@arohanajit arohanajit requested a review from echoix December 12, 2024 23:34
@echoix
Copy link
Member

echoix commented Dec 13, 2024

I don't know how well we could check it, but is there a way to do a little double check on the gui tools that use this module? It's less used than grass.script, so it might be possible to search for all references.

Recently there was an overlook that ended up having grass.script.named_colors not being exposed anymore, and a gui component wasn't working anymore. Since the gui code is poorly tested (I'm being generous here), we didn't catch it until a bug was filed. See #4825 and the issue it fixed.

@echoix echoix merged commit e1c90df into OSGeo:main Dec 18, 2024
26 checks passed
@github-actions github-actions bot added this to the 8.5.0 milestone Dec 18, 2024
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.

2 participants