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

checks: Fix E402 Flake8 in for wxGUI Sphinx doc #4391

Merged
merged 5 commits into from
Sep 26, 2024

Conversation

arohanajit
Copy link
Contributor

Fixed E402 error in gui/wxpython/docs/wxgui_sphinx - moved import module to the top

@github-actions github-actions bot added GUI wxGUI related Python Related code is in Python labels Sep 26, 2024
@arohanajit arohanajit changed the title docs: Fixed 'E402' in wxpython/docs docs: Fixed E402 flake8 in wxpython/docs Sep 26, 2024
@echoix
Copy link
Member

echoix commented Sep 26, 2024

What I see here is that the check for gisbase was made probably to prevent loading grass.script core if not set. However, if it were that important, it would've been a pattern we see everywhere.

Does @wenzeslaus know if we are more robust now and the import can be done and the check after? If so, that PR is fine to merge!

Copy link
Member

@wenzeslaus wenzeslaus left a comment

Choose a reason for hiding this comment

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

It seems to be that this code was never doing anything useful. Adding etc/python/grass to sys.path does not make grass.script importable which is clearly the intention here (an import after a sys.path.append call).

You can just remove the whole block with GISBASE. Who wants to compile the documentation, needs to have grass on path - that's not such an unexpected requirement at this point. GISBASE may not even be needed on the other hand.

If I'm not mistaken, we don't compile wxGUI doc anywhere on servers, so this should be very safe to mess with.

@petrasovaa petrasovaa added this to the 8.5.0 milestone Sep 26, 2024
@arohanajit
Copy link
Contributor Author

arohanajit commented Sep 26, 2024

Got it, I'll remove that code block. I'll also remove sys and os library imports since that was the only place where they are used and will highlight new flake8 errors

wenzeslaus
wenzeslaus previously approved these changes Sep 26, 2024
@wenzeslaus wenzeslaus enabled auto-merge (squash) September 26, 2024 14:52
@wenzeslaus wenzeslaus changed the title docs: Fixed E402 flake8 in wxpython/docs checks: Fix E402 Flake8 in for wxGUI Sphinx doc Sep 26, 2024
@echoix
Copy link
Member

echoix commented Sep 26, 2024

I fixed the merge conflict

@wenzeslaus wenzeslaus merged commit c502c1c into OSGeo:main Sep 26, 2024
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GUI wxGUI related Python Related code is in Python
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants