"scripts/lib" was always a bit of an awkward place for Python modules. We
already have tools/lib; create a tools/lib/python, move the libraries
there, and update the users accordingly.
While at it, move the contents of tools/docs/lib. Rather than make another
directory, just put these documentation-oriented modules under "kdoc".
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Message-ID: <
20251110220430.726665-2-corbet@lwn.net>
[MASTER]
-init-hook='import sys; sys.path += ["scripts/lib/kdoc", "scripts/lib/abi", "tools/docs/lib"]'
+init-hook='import sys; sys.path += ["tools/lib/python"]'
@echo ' make PAPER={a4|letter} Specifies the paper size used for LaTeX/PDF output.'
@echo
@echo ' make FONTS_CONF_DENY_VF={path} sets a deny list to block variable Noto CJK fonts'
- @echo ' for PDF build. See tools/docs/lib/latex_fonts.py for more details'
+ @echo ' for PDF build. See tools/lib/python/kdoc/latex_fonts.py for more details'
@echo
@echo ' Default location for the generated documents is Documentation/output'
from sphinx.util import logging
srctree = os.path.abspath(os.environ["srctree"])
-sys.path.insert(0, os.path.join(srctree, "scripts/lib/abi"))
+sys.path.insert(0, os.path.join(srctree, "tools/lib/python/abi"))
from abi_parser import AbiParser
from sphinx.util import logging
srctree = os.path.abspath(os.environ["srctree"])
-sys.path.insert(0, os.path.join(srctree, "tools/docs/lib"))
+sys.path.insert(0, os.path.join(srctree, "tools/lib/python/kdoc"))
from parse_data_structs import ParseDataStructs
from pprint import pformat
srctree = os.path.abspath(os.environ["srctree"])
-sys.path.insert(0, os.path.join(srctree, "scripts/lib/kdoc"))
+sys.path.insert(0, os.path.join(srctree, "tools/lib/python/kdoc"))
from kdoc_files import KernelFiles
from kdoc_output import RestFormat
T: git git://git.lwn.net/linux.git docs-next
F: Documentation/
F: scripts/kernel-doc*
-F: scripts/lib/abi/*
-F: scripts/lib/kdoc/*
+F: tools/lib/python/*
F: tools/docs/
F: tools/net/ynl/pyynl/lib/doc_generator.py
X: Documentation/ABI/
import os
import sys
-LIB_DIR = "lib"
+LIB_DIR = "../tools/lib/python"
SRC_DIR = os.path.dirname(os.path.realpath(__file__))
sys.path.insert(0, os.path.join(SRC_DIR, LIB_DIR))
# Import Python modules
-LIB_DIR = "lib/kdoc"
+LIB_DIR = "../tools/lib/python/kdoc"
SRC_DIR = os.path.dirname(os.path.realpath(__file__))
sys.path.insert(0, os.path.join(SRC_DIR, LIB_DIR))
"""
Detect problematic Noto CJK variable fonts.
-or more details, see lib/latex_fonts.py.
+or more details, see .../tools/lib/python/kdoc/latex_fonts.py.
"""
import argparse
import sys
+import os.path
-from lib.latex_fonts import LatexFontChecker
+src_dir = os.path.dirname(os.path.realpath(__file__))
+sys.path.insert(0, os.path.join(src_dir, '../lib/python/kdoc'))
+
+from latex_fonts import LatexFontChecker
checker = LatexFontChecker()
# Import Python modules
-LIB_DIR = "../../scripts/lib/abi"
+LIB_DIR = "../lib/python/abi"
SRC_DIR = os.path.dirname(os.path.realpath(__file__))
sys.path.insert(0, os.path.join(SRC_DIR, LIB_DIR))
replace define V4L2_EVENT_MD_FL_HAVE_FRAME_SEQ :c:type:`v4l2_event_motion_det`
"""
-import argparse
+import argparse, sys
+import os.path
-from lib.parse_data_structs import ParseDataStructs
-from lib.enrich_formatter import EnrichFormatter
+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
def main():
"""Main function"""
from concurrent import futures
from glob import glob
-from lib.python_version import PythonVersion
-from lib.latex_fonts import LatexFontChecker
-LIB_DIR = "../../scripts/lib"
+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 jobserver import JobserverExec # pylint: disable=C0413,C0411,E0401
#
import subprocess
import sys
from glob import glob
+import os.path
-from lib.python_version import PythonVersion
+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
RECOMMENDED_VERSION = PythonVersion("3.4.3").version
MIN_PYTHON_VERSION = PythonVersion("3.7").version