#!/usr/bin/env python3
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (c) 2017-2025 Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
#
# pylint: disable=C0103,C0114,C0115,C0116,C0301,C0302
# pylint: disable=R0902,R0904,R0911,R0912,R0914,R0915,R1705,R1710,E1121
# Note: this script requires at least Python 3.6 to run.
# Don't add changes not compatible with it, it is meant to report
# incompatible python versions.
"""
Dependency checker for Sphinx documentation Kernel build.
This module provides tools to check for all required dependencies needed to
build documentation using Sphinx, including system packages, Python modules
and LaTeX packages for PDF generation.
It detect packages for a subset of Linux distributions used by Kernel
maintainers, showing hints and missing dependencies.
The main class SphinxDependencyChecker handles the dependency checking logic
and provides recommendations for installing missing packages. It supports both
system package installations and Python virtual environments. By default,
system pacage install is recommended.
"""
import argparse
import locale
import os
import re
import subprocess
import sys
from glob import glob
import os.path
src_dir = os.pat