Skip to content

Commit 778b8eb

Browse files
author
Jonathan Corbet
committed
docs: Move the python libraries to tools/lib/python
"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>
1 parent f690e07 commit 778b8eb

28 files changed

Lines changed: 29 additions & 19 deletions

.pylintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
[MASTER]
2-
init-hook='import sys; sys.path += ["scripts/lib/kdoc", "scripts/lib/abi", "tools/docs/lib"]'
2+
init-hook='import sys; sys.path += ["tools/lib/python"]'

Documentation/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,6 @@ dochelp:
115115
@echo ' make PAPER={a4|letter} Specifies the paper size used for LaTeX/PDF output.'
116116
@echo
117117
@echo ' make FONTS_CONF_DENY_VF={path} sets a deny list to block variable Noto CJK fonts'
118-
@echo ' for PDF build. See tools/docs/lib/latex_fonts.py for more details'
118+
@echo ' for PDF build. See tools/lib/python/kdoc/latex_fonts.py for more details'
119119
@echo
120120
@echo ' Default location for the generated documents is Documentation/output'

Documentation/sphinx/kernel_abi.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
from sphinx.util import logging
4444

4545
srctree = os.path.abspath(os.environ["srctree"])
46-
sys.path.insert(0, os.path.join(srctree, "scripts/lib/abi"))
46+
sys.path.insert(0, os.path.join(srctree, "tools/lib/python/abi"))
4747

4848
from abi_parser import AbiParser
4949

Documentation/sphinx/kernel_include.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
from sphinx.util import logging
9898

9999
srctree = os.path.abspath(os.environ["srctree"])
100-
sys.path.insert(0, os.path.join(srctree, "tools/docs/lib"))
100+
sys.path.insert(0, os.path.join(srctree, "tools/lib/python/kdoc"))
101101

102102
from parse_data_structs import ParseDataStructs
103103

Documentation/sphinx/kerneldoc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
from pprint import pformat
4343

4444
srctree = os.path.abspath(os.environ["srctree"])
45-
sys.path.insert(0, os.path.join(srctree, "scripts/lib/kdoc"))
45+
sys.path.insert(0, os.path.join(srctree, "tools/lib/python/kdoc"))
4646

4747
from kdoc_files import KernelFiles
4848
from kdoc_output import RestFormat

MAINTAINERS

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7412,8 +7412,7 @@ P: Documentation/doc-guide/maintainer-profile.rst
74127412
T: git git://git.lwn.net/linux.git docs-next
74137413
F: Documentation/
74147414
F: scripts/kernel-doc*
7415-
F: scripts/lib/abi/*
7416-
F: scripts/lib/kdoc/*
7415+
F: tools/lib/python/*
74177416
F: tools/docs/
74187417
F: tools/net/ynl/pyynl/lib/doc_generator.py
74197418
X: Documentation/ABI/

scripts/jobserver-exec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ See:
1313
import os
1414
import sys
1515

16-
LIB_DIR = "lib"
16+
LIB_DIR = "../tools/lib/python"
1717
SRC_DIR = os.path.dirname(os.path.realpath(__file__))
1818

1919
sys.path.insert(0, os.path.join(SRC_DIR, LIB_DIR))

scripts/kernel-doc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@
111111

112112
# Import Python modules
113113

114-
LIB_DIR = "lib/kdoc"
114+
LIB_DIR = "../tools/lib/python/kdoc"
115115
SRC_DIR = os.path.dirname(os.path.realpath(__file__))
116116

117117
sys.path.insert(0, os.path.join(SRC_DIR, LIB_DIR))

tools/docs/check-variable-fonts.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,17 @@
99
"""
1010
Detect problematic Noto CJK variable fonts.
1111
12-
or more details, see lib/latex_fonts.py.
12+
or more details, see .../tools/lib/python/kdoc/latex_fonts.py.
1313
"""
1414

1515
import argparse
1616
import sys
17+
import os.path
1718

18-
from lib.latex_fonts import LatexFontChecker
19+
src_dir = os.path.dirname(os.path.realpath(__file__))
20+
sys.path.insert(0, os.path.join(src_dir, '../lib/python/kdoc'))
21+
22+
from latex_fonts import LatexFontChecker
1923

2024
checker = LatexFontChecker()
2125

tools/docs/get_abi.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
# Import Python modules
1616

17-
LIB_DIR = "../../scripts/lib/abi"
17+
LIB_DIR = "../lib/python/abi"
1818
SRC_DIR = os.path.dirname(os.path.realpath(__file__))
1919

2020
sys.path.insert(0, os.path.join(SRC_DIR, LIB_DIR))

0 commit comments

Comments
 (0)