mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-07-16 14:30:06 -04:00
docs: bring some order to our Python module hierarchy
Now that we have tools/lib/python for our Python modules, turn them into proper packages with a single namespace so that everything can just use tools/lib/python in sys.path. No functional change. Signed-off-by: Jonathan Corbet <corbet@lwn.net> Message-ID: <20251110220430.726665-3-corbet@lwn.net>
This commit is contained in:
@@ -17,9 +17,9 @@ import sys
|
||||
import os.path
|
||||
|
||||
src_dir = os.path.dirname(os.path.realpath(__file__))
|
||||
sys.path.insert(0, os.path.join(src_dir, '../lib/python/kdoc'))
|
||||
sys.path.insert(0, os.path.join(src_dir, '../lib/python'))
|
||||
|
||||
from latex_fonts import LatexFontChecker
|
||||
from kdoc.latex_fonts import LatexFontChecker
|
||||
|
||||
checker = LatexFontChecker()
|
||||
|
||||
|
||||
@@ -14,15 +14,15 @@ import sys
|
||||
|
||||
# Import Python modules
|
||||
|
||||
LIB_DIR = "../lib/python/abi"
|
||||
LIB_DIR = "../lib/python"
|
||||
SRC_DIR = os.path.dirname(os.path.realpath(__file__))
|
||||
|
||||
sys.path.insert(0, os.path.join(SRC_DIR, LIB_DIR))
|
||||
|
||||
from abi_parser import AbiParser # pylint: disable=C0413
|
||||
from abi_regex import AbiRegex # pylint: disable=C0413
|
||||
from helpers import ABI_DIR, DEBUG_HELP # pylint: disable=C0413
|
||||
from system_symbols import SystemSymbols # pylint: disable=C0413
|
||||
from abi.abi_parser import AbiParser # pylint: disable=C0413
|
||||
from abi.abi_regex import AbiRegex # pylint: disable=C0413
|
||||
from abi.helpers import ABI_DIR, DEBUG_HELP # pylint: disable=C0413
|
||||
from abi.system_symbols import SystemSymbols # pylint: disable=C0413
|
||||
|
||||
# Command line classes
|
||||
|
||||
|
||||
@@ -28,9 +28,9 @@ import argparse, sys
|
||||
import os.path
|
||||
|
||||
src_dir = os.path.dirname(os.path.realpath(__file__))
|
||||
sys.path.insert(0, os.path.join(src_dir, '../lib/python/kdoc'))
|
||||
from parse_data_structs import ParseDataStructs
|
||||
from enrich_formatter import EnrichFormatter
|
||||
sys.path.insert(0, os.path.join(src_dir, '../lib/python'))
|
||||
from kdoc.parse_data_structs import ParseDataStructs
|
||||
from kdoc.enrich_formatter import EnrichFormatter
|
||||
|
||||
def main():
|
||||
"""Main function"""
|
||||
|
||||
@@ -61,10 +61,9 @@ LIB_DIR = "../lib/python"
|
||||
SRC_DIR = os.path.dirname(os.path.realpath(__file__))
|
||||
|
||||
sys.path.insert(0, os.path.join(SRC_DIR, LIB_DIR))
|
||||
sys.path.insert(0, os.path.join(SRC_DIR, LIB_DIR + '/kdoc')) # temporary
|
||||
|
||||
from python_version import PythonVersion
|
||||
from latex_fonts import LatexFontChecker
|
||||
from kdoc.python_version import PythonVersion
|
||||
from kdoc.latex_fonts import LatexFontChecker
|
||||
from jobserver import JobserverExec # pylint: disable=C0413,C0411,E0401
|
||||
|
||||
#
|
||||
|
||||
@@ -35,8 +35,8 @@ from glob import glob
|
||||
import os.path
|
||||
|
||||
src_dir = os.path.dirname(os.path.realpath(__file__))
|
||||
sys.path.insert(0, os.path.join(src_dir, '../lib/python/kdoc'))
|
||||
from python_version import PythonVersion
|
||||
sys.path.insert(0, os.path.join(src_dir, '../lib/python'))
|
||||
from kdoc.python_version import PythonVersion
|
||||
|
||||
RECOMMENDED_VERSION = PythonVersion("3.4.3").version
|
||||
MIN_PYTHON_VERSION = PythonVersion("3.7").version
|
||||
|
||||
Reference in New Issue
Block a user