From c502c1c05f7208a48f1b44b835ab23ac9d1708be Mon Sep 17 00:00:00 2001 From: Arohan Ajit Date: Thu, 26 Sep 2024 18:35:30 -0400 Subject: [PATCH] checks: Fix E402 Flake8 in for wxGUI Sphinx doc (#4391) This fixes Flake8 E402 (Module level import not at top of file) for Sphinx documentation generator configuration script by removing import path manipulation block which was not properly working anyway. --- .flake8 | 1 - gui/wxpython/docs/wxgui_sphinx/conf.py | 12 ------------ 2 files changed, 13 deletions(-) diff --git a/.flake8 b/.flake8 index dd80ca9b6a0..7bad3afc185 100644 --- a/.flake8 +++ b/.flake8 @@ -25,7 +25,6 @@ per-file-ignores = doc/python/m.distance.py: E501 doc/gui/wxpython/example/dialogs.py: F401 gui/scripts/d.wms.py: E501 - gui/wxpython/docs/wxgui_sphinx/conf.py: E402, W291 gui/wxpython/gcp/manager.py: E722 gui/wxpython/gui_core/*: E722 gui/wxpython/gui_core/dialogs.py: E722 diff --git a/gui/wxpython/docs/wxgui_sphinx/conf.py b/gui/wxpython/docs/wxgui_sphinx/conf.py index 3641c2aab48..f0b61a31996 100644 --- a/gui/wxpython/docs/wxgui_sphinx/conf.py +++ b/gui/wxpython/docs/wxgui_sphinx/conf.py @@ -10,21 +10,9 @@ # All configuration values have a default; values that are commented out # serve to show the default. -import sys -import os from datetime import date import string from shutil import copy - -# If extensions (or modules to document with autodoc) are in another directory, -# add these directories to sys.path here. If the directory is relative to the -# documentation root, use os.path.abspath to make it absolute, like shown here. -if not os.getenv("GISBASE"): - sys.exit("GISBASE not defined") -sys.path.insert( - 0, os.path.abspath(os.path.join(os.environ["GISBASE"], "etc", "python", "grass")) -) - from grass.script import core footer_tmpl = string.Template(