Debian Codegraph @

docs/source/conf.py

raw
1 # Copyright (C) 2025 Siemens
2 #
3 # SPDX-License-Identifier: MIT
4
5 import os
6 import sys
7 import importlib.metadata as _metadata
8
9 # Insert the project root (two levels up) and the src folder.
10 # Fixed mismatched parentheses.
11 sys.path.insert(
12 0,
13 os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..", "src")),
14 )
15
16 import debsbom
17
18 # -- Project information -----------------------------------------------------
19 # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
20
21 project = "debsbom"
22 copyright = "2025, Siemens"
23 authors = ["Christoph Steiger", "Felix Moessbauer"]
24
25 # Derive the version from the installed package metadata.
26 # If the package is not installed, fall back to a placeholder.
27 try:
28 release = _metadata.version("debsbom")
29 except _metadata.PackageNotFoundError:
30 release = "0.0.0" # fallback for development builds
31
32 # -- General configuration ---------------------------------------------------
33 # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
34
35 extensions = [
36 "sphinx.ext.autodoc", # pull doc‑strings from code
37 "sphinx.ext.autodoc.typehints", # optional, if you installed sphinx-autodoc-typehints
38 "sphinx.ext.intersphinx", # link to Python, etc.
39 "sphinx.ext.viewcode", # “[source]” links
40 "sphinxarg.ext", # argparse
41 ]
42
43 templates_path = ["_templates"]
44 exclude_patterns = ["man/man"]
45 if tags.has("man/man"):
46 exclude_patterns.remove("man/man")
47
48 intersphinx_mapping = {
49 "python": ("https://docs.python.org/3", None),
50 }
51
52 # -- Options for HTML output -------------------------------------------------
53 # https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
54
55 html_theme = "sphinx_rtd_theme"
56 # If you want to customize:
57 # html_theme_options = {
58 # "logo_only": True,
59 # "display_version": True,
60 # }
61
62 html_static_path = ["_static"]
63
64 # One entry per manual page. List of tuples
65 # (source start file, name, description, authors, manual section).
66 man_pages = [
67 ("man/debsbom", "debsbom", "a SBOM tool for Debian", authors, 1),
68 ("man/debsbom-decisions", "debsbom-decisions", "debsbom design decisions", authors, 1),
69 ("man/debsbom-download", "debsbom-download", "debsbom download command", authors, 1),
70 ("man/debsbom-export", "debsbom-export", "debsbom export command", authors, 1),
71 ("man/debsbom-generate", "debsbom-generate", "debsbom generate command", authors, 1),
72 ("man/debsbom-merge", "debsbom-merge", "debsbom merge command", authors, 1),
73 ("man/debsbom-repack", "debsbom-repack", "debsbom repack command", authors, 1),
74 ("man/debsbom-trace-path", "debsbom-trace-path", "debsbom trace-path command", authors, 1),
75 ("man/debsbom-delta", "debsbom-delta", "debsbom delta command", authors, 1),
76 ("man/debsbom-filter", "debsbom-filter", "debsbom filter command", authors, 1),
77 ("man/debsbom-sec-scan", "debsbom-sec-scan", "debsbom sec-scan command", authors, 1),
78 (
79 "man/debsbom-source-merge",
80 "debsbom-source-merge",
81 "debsbom source-merge command",
82 authors,
83 1,
84 ),
85 ]